[Devel] [PATCH 1/1] cr: allocate security context for msg_msg

Serge E. Hallyn serue at us.ibm.com
Thu Jun 25 11:57:32 PDT 2009


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 at us.ibm.com>
---
 ipc/checkpoint_msg.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ipc/checkpoint_msg.c b/ipc/checkpoint_msg.c
index 51385b0..fca8e7d 100644
--- a/ipc/checkpoint_msg.c
+++ b/ipc/checkpoint_msg.c
@@ -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);
-- 
1.6.1

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list