aboutsummaryrefslogtreecommitdiff
path: root/security/selinux/include
diff options
context:
space:
mode:
authorCasey Schaufler2018-09-21 17:19:11 -0700
committerKees Cook2019-01-08 13:18:44 -0800
commit80788c229116b28cc914d73c142f74bdee28ab57 (patch)
tree7edfa0487db83194c6497ee4ac089204ece986c3 /security/selinux/include
parent33bf60cabcc7687b194a689b068b65e9ecd556be (diff)
SELinux: Abstract use of inode security blob
Don't use the inode->i_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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index 96374dbf4ace..26b4ff6b4d81 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -170,4 +170,10 @@ static inline struct file_security_struct *selinux_file(const struct file *file)
return file->f_security + selinux_blob_sizes.lbs_file;
}
+static inline struct inode_security_struct *selinux_inode(
+ const struct inode *inode)
+{
+ return inode->i_security;
+}
+
#endif /* _SELINUX_OBJSEC_H_ */