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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user