All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] cr: allocate security context for msg_msg
@ 2009-06-30 20:19 Serge E. Hallyn
       [not found] ` <20090630201950.GA22761-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Serge E. Hallyn @ 2009-06-30 20:19 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

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/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 1/1] cr: allocate security context for msg_msg
@ 2009-06-25 18:57 Serge E. Hallyn
  0 siblings, 0 replies; 3+ messages in thread
From: Serge E. Hallyn @ 2009-06-25 18:57 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

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/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-02 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30 20:19 [PATCH 1/1] cr: allocate security context for msg_msg Serge E. Hallyn
     [not found] ` <20090630201950.GA22761-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-02 10:08   ` Oren Laadan
  -- strict thread matches above, loose matches on Subject: below --
2009-06-25 18:57 Serge E. Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.