aboutsummaryrefslogtreecommitdiff
path: root/security/smack/smack.h
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2018-11-12 09:38:53 -0800
committerKees Cook <keescook@chromium.org>2019-01-08 13:18:44 -0800
commitf28952ac900822a189fc383a5b73631e72c69356 (patch)
tree4daaf025cb9fa286cb5b4d76025e3e6b3f7588fa /security/smack/smack.h
parentbb6c6b02ccb7d76f628c5dc6abe13f1115637cfd (diff)
downloadlinux-f28952ac900822a189fc383a5b73631e72c69356.tar.gz
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?
*/