cr: allocate security context for msg_msg
PATCH 1/1 cr: allocate security context for msg_msg
Since we create msg_msg structs by hand, we also need to ask LSM to allocate a security context. Otherwise selinux_msg_queue_msgrcv will throw a fit dereferencing msg->security (6b6b6b6b6b6b6000).
With this patch, cr tests can be executed with selinux enabled.
Signed-off-by Serge E. Hallyn <serue-r/[email protected]>
--- ipc/checkpoint_msg.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
ipc/checkpoint_msg.c +3 -0
@@ -17,6 +17,7 @@#include <linux/sched.h> #include <linux/syscalls.h> #include <linux/nsproxy.h> +#include <linux/security.h> #include <linux/ipc_namespace.h> #include "util.h"
@@ -248,6 +249,8 @@ static struct msg_msg *restore_msg_contents_one(struct ckpt_ctx *ctx, int *clen) msg->m_type = h->m_type; msg->m_ts = h->m_ts; *clen = h->m_ts; + ret =security_msg_msg_alloc (msg); + out:if (ret <0 && msg) {free_msg (msg);
Signature · 1 line
1.6.1
A message that is not in the archive (sent off-list or not yet received): 20090630201950.GA22761-r/[email protected]
Oren Laadan
AppliedApplied to v17.
Oren.
Quoted 34 lines · Serge E. Hallyn
Since we create
msg_msgstructs by hand, we also need to ask LSM to allocate a security context. Otherwiseselinux_msg_queue_msgrcvwill throw a fit dereferencingmsg->security(6b6b6b6b6b6b6000).With this patch, cr tests can be executed with selinux enabled.
Signed-off-by Serge E. Hallyn <serue-r/[email protected]>--- ipc/checkpoint_msg.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)ipc/checkpoint_msg.c +3
-0@@ -17,6 +17,7 @@#include <linux/sched.h> #include <linux/syscalls.h> #include <linux/nsproxy.h> +#include <linux/security.h> #include <linux/ipc_namespace.h> #include "util.h" @@ -248,6 +249,8 @@ static struct msg_msg *restore_msg_contents_one(struct ckpt_ctx *ctx, int *clen) msg->m_type = h->m_type; msg->m_ts = h->m_ts; *clen = h->m_ts; + ret =security_msg_msg_alloc (msg); + out:if (ret <0 && msg) {free_msg (msg);