From: Cedric Le Goater <clg@fr.ibm.com>
To: Kirill Korotaev <dev@openvz.org>
Cc: Andrew Morton <akpm@osdl.org>,
devel@openvz.org, xemul@openvz.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
ebiederm@xmission.com, herbert@13thfloor.at, saw@sw.ru,
serue@us.ibm.com, sfrench@us.ibm.com, sam@vilain.net,
haveblue@us.ibm.com
Subject: Re: [PATCH 2/6] IPC namespace - utils
Date: Mon, 12 Jun 2006 19:08:38 +0200 [thread overview]
Message-ID: <448D9F96.5030305@fr.ibm.com> (raw)
In-Reply-To: <44898E39.3080801@openvz.org>
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
Kirill Korotaev wrote:
> +static struct ipc_namespace *clone_ipc_ns(struct ipc_namespace *old_ns)
> +{
> + int err;
> + struct ipc_namespace *ns;
> +
> + err = -ENOMEM;
> + ns = kmalloc(sizeof(struct ipc_namespace), GFP_KERNEL);
> + if (ns == NULL)
> + goto err_mem;
> +
> + err = sem_init_ns(ns);
> + if (err)
> + goto err_sem;
> + err = msg_init_ns(ns);
> + if (err)
> + goto err_msg;
> + err = shm_init_ns(ns);
> + if (err)
> + goto err_shm;
> +
> + kref_init(&ns->kref);
> + return ns;
> +
> +err_shm:
> + msg_exit_ns(ns);
> +err_msg:
> + sem_exit_ns(ns);
> +err_sem:
> + kfree(ns);
> +err_mem:
> + return ERR_PTR(err);
> +}
I've used the ipc namespace patchset in rc6-mm2. Thanks for putting this
together, it works pretty well ! A few questions when we clone :
* We should do something close to what exit_sem() already does to clear the
sem_undo list from the task doing the clone() or unshare().
* I don't like the idea of being able to unshare the ipc namespace and keep
some shared memory from the previous ipc namespace mapped in the process mm.
Should we forbid the unshare ?
Small fix follows,
thanks,
C.
[-- Attachment #2: ipc-namespace-unshare-fix.patch.patch --]
[-- Type: text/x-patch, Size: 785 bytes --]
From: Cedric Le Goater <clg@fr.ibm.com>
Subject: ipc namespace : unshare fix
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
---
kernel/fork.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: 2.6.17-rc6-mm2/kernel/fork.c
===================================================================
--- 2.6.17-rc6-mm2.orig/kernel/fork.c
+++ 2.6.17-rc6-mm2/kernel/fork.c
@@ -1599,7 +1599,8 @@ asmlinkage long sys_unshare(unsigned lon
/* Return -EINVAL for all unsupported flags */
err = -EINVAL;
if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|
- CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|CLONE_NEWUTS))
+ CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|
+ CLONE_NEWUTS|CLONE_NEWIPC))
goto bad_unshare_out;
if ((err = unshare_thread(unshare_flags)))
next prev parent reply other threads:[~2006-06-12 17:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 14:55 [PATCH] IPC namespace Kirill Korotaev
2006-06-09 15:01 ` [PATCH 1/6] IPC namespace core Kirill Korotaev
2006-06-09 15:20 ` Cedric Le Goater
2006-06-09 15:26 ` James Morris
2006-06-09 18:38 ` Andrew Morton
2006-06-10 0:44 ` Eric W. Biederman
2006-06-10 3:22 ` Andrew Morton
2006-06-09 15:05 ` [PATCH 2/6] IPC namespace - utils Kirill Korotaev
2006-06-12 17:08 ` Cedric Le Goater [this message]
2006-06-12 18:01 ` Eric W. Biederman
2006-06-12 21:05 ` Cedric Le Goater
2006-06-12 21:49 ` Eric W. Biederman
2006-06-13 21:17 ` Cedric Le Goater
2006-06-14 11:14 ` Kirill Korotaev
2006-06-09 15:07 ` [PATCH 3/6] IPC namespace - msg Kirill Korotaev
2006-06-09 15:08 ` [PATCH 4/6] IPC namespace - sem Kirill Korotaev
2006-06-09 15:09 ` [PATCH 5/6] IPC namespace - shm Kirill Korotaev
2006-06-09 15:11 ` [PATCH 6/6] IPC namespace - sysctls Kirill Korotaev
2006-06-12 17:19 ` [PATCH] IPC namespace Dave Hansen
2006-06-13 2:44 ` Eric W. Biederman
2006-06-13 16:41 ` Kirill Korotaev
2006-06-13 17:01 ` Eric W. Biederman
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=448D9F96.5030305@fr.ibm.com \
--to=clg@fr.ibm.com \
--cc=akpm@osdl.org \
--cc=dev@openvz.org \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=haveblue@us.ibm.com \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@vilain.net \
--cc=saw@sw.ru \
--cc=serue@us.ibm.com \
--cc=sfrench@us.ibm.com \
--cc=xemul@openvz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox