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>
This commit is contained in:
committed by
Kees Cook
parent
7c6538280a
commit
019bcca462
@@ -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?
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user