public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Daniel Lezcano <daniel.lezcano@free.fr>
Cc: akpm@linux-foundation.org, containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, xemul@openvz.org,
	sukadev@us.ibm.com, ebiederm@xmission.com
Subject: Re: [PATCH 2/2] pidns: Support unsharing the pid namespace.
Date: Tue, 15 Feb 2011 20:01:18 +0100	[thread overview]
Message-ID: <20110215190118.GA16707@redhat.com> (raw)
In-Reply-To: <1297788824-20534-2-git-send-email-daniel.lezcano@free.fr>

On 02/15, Daniel Lezcano wrote:
>
> - Pass both nsproxy->pid_ns and task_active_pid_ns to copy_pid_ns
>   As they can now be different.

But since they can be different we have to convert some users of
current->nsproxy first? But that patch was dropped.

> Unsharing of the pid namespace unlike unsharing of other namespaces
> does not take effect immediately.  Instead it affects the children
> created with fork and clone.

IOW, unshare(CLONE_NEWPID) implicitly affects the subsequent fork(),
using the very subtle way.

I have to admit, I can't say I like this very much. OK, if we need
this, can't we just put something into, say, signal->flags so that
copy_process can check and create the new namespace.

Also. I remember, I already saw something like this and google found
my questions. I didn't actually read the new version, perhaps my
concerns were already answered...

	But what if the task T does unshare(CLONE_NEWPID) and then, say,
	pthread_create() ? Unless I missed something, the new thread won't
	be able to see T ?

	and, in this case the exiting sub-namespace init also kills its
	parent?

	OK, suppose it does fork() after unshare(), then another fork().
	In this case the second child lives in the same namespace with
	init created by the 1st fork, but it is not descendant ? This means
	in particular that if the new init exits, zap_pid_ns_processes()->
	do_wait() can't work.

Or not?

Oleg.


  reply	other threads:[~2011-02-15 19:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 16:53 [PATCH 1/2] pidns: Don't allow new pids after the namespace is dead Daniel Lezcano
2011-02-15 16:53 ` [PATCH 2/2] pidns: Support unsharing the pid namespace Daniel Lezcano
2011-02-15 19:01   ` Oleg Nesterov [this message]
2011-02-15 19:15     ` [PATCH 0/1] Was: " Oleg Nesterov
2011-02-15 19:17       ` [PATCH 1/1][3rd resend] sys_unshare: remove the dead CLONE_THREAD/SIGHAND/VM code Oleg Nesterov
2011-02-21  0:17         ` Serge E. Hallyn
2011-02-16 23:47     ` [PATCH 2/2] pidns: Support unsharing the pid namespace Daniel Lezcano
2011-02-17 20:29       ` Oleg Nesterov
2011-02-17 22:35         ` Greg Kurz
2011-02-18 14:40           ` Oleg Nesterov
2011-02-24  1:12   ` Rob Landley
2011-02-15 18:30 ` [PATCH 1/2] pidns: Don't allow new pids after the namespace is dead Oleg Nesterov
2011-02-16 23:21   ` Daniel Lezcano
2011-02-17 20:54     ` Oleg Nesterov

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=20110215190118.GA16707@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=daniel.lezcano@free.fr \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sukadev@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