From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: [PATCH 1/1] cr: allocate security context for msg_msg
Date: Thu, 25 Jun 2009 13:57:32 -0500 [thread overview]
Message-ID: <20090625185732.GA11699@us.ibm.com> (raw)
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
next reply other threads:[~2009-06-25 18:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-25 18:57 Serge E. Hallyn [this message]
-- strict thread matches above, loose matches on Subject: below --
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090625185732.GA11699@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.