aboutsummaryrefslogtreecommitdiff
path: root/security/selinux/include/objsec.h
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2018-09-21 17:17:16 -0700
committerKees Cook <keescook@chromium.org>2019-01-08 13:18:44 -0800
commit0c6cfa622cf57109607f3416b286b6b55561a2ea (patch)
treeb19919a635083c0e7dd218e794d78cf536ffb194 /security/selinux/include/objsec.h
parentb17103a8b8ae9c9ecc5e1e6501b1478ee2dc6fe4 (diff)
downloadlinux-0c6cfa622cf57109607f3416b286b6b55561a2ea.tar.gz
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>
Diffstat (limited to 'security/selinux/include/objsec.h')
-rw-r--r--security/selinux/include/objsec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index cc5e26b0161b..734b6833bdff 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -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_ */