aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2024-02-14 10:47:06 -0800
committerCasey Schaufler <casey@schaufler-ca.com>2024-02-14 10:47:06 -0800
commit69b6d71052b54fb10feba68564ccb41c0f0ce1e9 (patch)
tree7bd0e2d9d2c1ee57a1a270a1a5bc18d783ed864c /security
parentf0816d4332c3f764cd42cf8124a193e17eeccba9 (diff)
downloadlinux-69b6d71052b54fb10feba68564ccb41c0f0ce1e9.tar.gz
Smack: use init_task_smack() in smack_cred_transfer()
smack_cred_transfer() open codes the same initialization as init_task_smack(). Remove the open coding and replace it with a call to init_task_smack(). Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security')
-rw-r--r--security/smack/smack_lsm.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index d52d2a7a813d76..b18b5023294797 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2101,12 +2101,7 @@ static void smack_cred_transfer(struct cred *new, const struct cred *old)
struct task_smack *old_tsp = smack_cred(old);
struct task_smack *new_tsp = smack_cred(new);
- new_tsp->smk_task = old_tsp->smk_task;
- new_tsp->smk_forked = old_tsp->smk_task;
- mutex_init(&new_tsp->smk_rules_lock);
- INIT_LIST_HEAD(&new_tsp->smk_rules);
-
- /* cbs copy rule list */
+ init_task_smack(new_tsp, old_tsp->smk_task, old_tsp->smk_task);
}
/**