path: root/security/smack/smack.h
diff options
authorCasey Schaufler <casey@schaufler-ca.com>2018-09-21 17:19:54 -0700
committerKees Cook <keescook@chromium.org>2019-01-08 13:18:45 -0800
commit019bcca4626a9ed119e1d9ebfadb9fdbdcf9b35b (patch)
treee6f19e844748ee33d6b78a9cae1169ad2494f669 /security/smack/smack.h
parent7c6538280ae99eaebd589a5c029e1ed1c063909c (diff)
Smack: Abstract use of ipc security blobs
Don't use the ipc->security pointer directly. Don't use the msg_msg->security pointer directly. Provide helper functions that provides the security blob pointers. 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')
1 files changed, 11 insertions, 0 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h
index bf0abc35ca1c..0adddbeecc62 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -24,6 +24,7 @@
#include <linux/list.h>
#include <linux/rculist.h>
#include <linux/lsm_audit.h>
+#include <linux/msg.h>
* Use IPv6 port labeling if IPv6 is enabled and secmarks
@@ -373,6 +374,16 @@ static inline struct inode_smack *smack_inode(const struct inode *inode)
return inode->i_security + smack_blob_sizes.lbs_inode;
+static inline struct smack_known **smack_msg_msg(const struct msg_msg *msg)
+ return (struct smack_known **)&msg->security;
+static inline struct smack_known **smack_ipc(const struct kern_ipc_perm *ipc)
+ return (struct smack_known **)&ipc->security;
* Is the directory transmuting?