aboutsummaryrefslogtreecommitdiff
path: root/security/selinux/include/objsec.h
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2018-09-21 17:22:32 -0700
committerKees Cook <keescook@chromium.org>2019-01-08 13:18:44 -0800
commitbb6c6b02ccb7d76f628c5dc6abe13f1115637cfd (patch)
treed8b08890fd9b9c84d6d1a37f182c3441273e6579 /security/selinux/include/objsec.h
parentbbd3662a834813730912a58efb44dd6df6d952e6 (diff)
downloadlinux-bb6c6b02ccb7d76f628c5dc6abe13f1115637cfd.tar.gz
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/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 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_ */