summaryrefslogtreecommitdiffstats
path: root/security/smack/smack.h
diff options
context:
space:
mode:
authorCasey Schaufler2018-11-12 18:38:53 +0100
committerKees Cook2019-01-08 22:18:44 +0100
commitf28952ac900822a189fc383a5b73631e72c69356 (patch)
tree4daaf025cb9fa286cb5b4d76025e3e6b3f7588fa /security/smack/smack.h
parentSELinux: Abstract use of file security blob (diff)
downloadkernel-qcow2-linux-f28952ac900822a189fc383a5b73631e72c69356.tar.gz
kernel-qcow2-linux-f28952ac900822a189fc383a5b73631e72c69356.tar.xz
kernel-qcow2-linux-f28952ac900822a189fc383a5b73631e72c69356.zip
Smack: 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/smack/smack.h')
-rw-r--r--security/smack/smack.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h
index b27eb252e953..50854969a391 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -362,6 +362,11 @@ static inline struct task_smack *smack_cred(const struct cred *cred)
return cred->security + smack_blob_sizes.lbs_cred;
}
+static inline struct smack_known **smack_file(const struct file *file)
+{
+ return (struct smack_known **)&file->f_security;
+}
+
/*
* Is the directory transmuting?
*/