diff options
author | Paul Moore <paul@paul-moore.com> | 2021-02-19 21:04:58 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2021-03-22 20:24:14 +0100 |
commit | 1fb057dcde11b355fc9acde95cee3b2caa5dafb0 (patch) | |
tree | 3c821b21ccfe51a95353a5f9c0f11f15c897d29c /security/smack/smack.h | |
parent | selinux: clarify task subjective and objective credentials (diff) | |
download | linux-1fb057dcde11b355fc9acde95cee3b2caa5dafb0.tar.xz linux-1fb057dcde11b355fc9acde95cee3b2caa5dafb0.zip |
smack: differentiate between subjective and objective task credentials
With the split of the security_task_getsecid() into subjective and
objective variants it's time to update Smack to ensure it is using
the correct task creds.
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r-- | security/smack/smack.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h index a9768b12716b..08f9cb80655c 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -383,7 +383,23 @@ static inline struct smack_known *smk_of_task(const struct task_smack *tsp) return tsp->smk_task; } -static inline struct smack_known *smk_of_task_struct( +static inline struct smack_known *smk_of_task_struct_subj( + const struct task_struct *t) +{ + struct smack_known *skp; + const struct cred *cred; + + rcu_read_lock(); + + cred = rcu_dereference(t->cred); + skp = smk_of_task(smack_cred(cred)); + + rcu_read_unlock(); + + return skp; +} + +static inline struct smack_known *smk_of_task_struct_obj( const struct task_struct *t) { struct smack_known *skp; |