From: Oren Laadan Subject: Re: [PATCH 1/1] cr: allocate security context for msg_msg Date: Thu, 02 Jul 2009 06:08:34 -0400 Message-ID: <4A4C8722.1040704@cs.columbia.edu> References: <20090630201950.GA22761@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090630201950.GA22761-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Serge E. Hallyn" Cc: Linux Containers List-Id: containers.vger.kernel.org Applied to v17. Oren. Serge E. Hallyn wrote: > 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 > --- > 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 > #include > #include > +#include > #include > > #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);