LSM: Infrastructure management of the ipc security blob
Move management of the kern_ipc_perm->security and
msg_msg->security blobs out of the individual security
modules and into the security infrastructure. Instead
of allocating the blobs from within the modules the modules
tell the infrastructure how much space is required, and
the space is allocated there.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
[kees: adjusted for ordered init series]
Signed-off-by: Kees Cook <keescook@chromium.org>
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index 539cacf..231262d 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -179,13 +179,13 @@
static inline struct msg_security_struct *selinux_msg_msg(
const struct msg_msg *msg_msg)
{
- return msg_msg->security;
+ return msg_msg->security + selinux_blob_sizes.lbs_msg_msg;
}
static inline struct ipc_security_struct *selinux_ipc(
const struct kern_ipc_perm *ipc)
{
- return ipc->security;
+ return ipc->security + selinux_blob_sizes.lbs_ipc;
}
#endif /* _SELINUX_OBJSEC_H_ */