summaryrefslogtreecommitdiffstats
path: root/security/selinux/include
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2018-09-22 02:22:32 +0200
committerKees Cook <keescook@chromium.org>2019-01-08 22:18:44 +0100
commitbb6c6b02ccb7d76f628c5dc6abe13f1115637cfd (patch)
treed8b08890fd9b9c84d6d1a37f182c3441273e6579 /security/selinux/include
parentInfrastructure management of the cred security blob (diff)
downloadlinux-bb6c6b02ccb7d76f628c5dc6abe13f1115637cfd.tar.xz
linux-bb6c6b02ccb7d76f628c5dc6abe13f1115637cfd.zip
SELinux: Abstract use of file security blob
Don't use the file->f_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> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'security/selinux/include')
-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 c2974b031d05..e0ac2992e059 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -165,4 +165,9 @@ static inline struct task_security_struct *selinux_cred(const struct cred *cred)
return cred->security + selinux_blob_sizes.lbs_cred;
}
+static inline struct file_security_struct *selinux_file(const struct file *file)
+{
+ return file->f_security;
+}
+
#endif /* _SELINUX_OBJSEC_H_ */