From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: [PATCH 1/1] cr: allocate security context for msg_msg Date: Tue, 30 Jun 2009 15:19:50 -0500 Message-ID: <20090630201950.GA22761@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline 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: Oren Laadan Cc: Linux Containers List-Id: containers.vger.kernel.org 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); -- 1.6.1