SELinux: 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:
Casey Schaufler
2018-09-21 17:17:16 -07:00
committed by Kees Cook
parent b17103a8b8
commit 0c6cfa622c
3 changed files with 34 additions and 29 deletions

View File

@@ -158,4 +158,9 @@ struct bpf_security_struct {
u32 sid; /*SID of bpf obj creater*/
};
static inline struct task_security_struct *selinux_cred(const struct cred *cred)
{
return cred->security;
}
#endif /* _SELINUX_OBJSEC_H_ */