Smack: Abstract use of cred security blob
Don't use the cred->security pointer directly. Provide a helper function that provides the security blob pointer. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: Kees Cook <keescook@chromium.org> [kees: adjusted for ordered init series] Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:

committed by
Kees Cook

parent
6d9c939dbe
commit
b17103a8b8
@@ -275,7 +275,7 @@ out_audit:
|
||||
int smk_curacc(struct smack_known *obj_known,
|
||||
u32 mode, struct smk_audit_info *a)
|
||||
{
|
||||
struct task_smack *tsp = current_security();
|
||||
struct task_smack *tsp = smack_cred(current_cred());
|
||||
|
||||
return smk_tskacc(tsp, obj_known, mode, a);
|
||||
}
|
||||
@@ -635,7 +635,7 @@ DEFINE_MUTEX(smack_onlycap_lock);
|
||||
*/
|
||||
bool smack_privileged_cred(int cap, const struct cred *cred)
|
||||
{
|
||||
struct task_smack *tsp = cred->security;
|
||||
struct task_smack *tsp = smack_cred(cred);
|
||||
struct smack_known *skp = tsp->smk_task;
|
||||
struct smack_known_list_elem *sklep;
|
||||
int rc;
|
||||
|
Reference in New Issue
Block a user