From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@redhat.com>
Cc: Glauber Costa <glommer@parallels.com>,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
devel@openvz.org, kir@parallels.com,
Serge Hallyn <serge.hallyn@canonical.com>,
Michael Kerrisk <mtk.manpages@gmail.com>,
Tejun Heo <tj@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH] allow a task to join a pid namespace
Date: Tue, 05 Jun 2012 10:18:52 -0700 [thread overview]
Message-ID: <874nqp7k3n.fsf@xmission.com> (raw)
In-Reply-To: <20120604165117.GA13091@redhat.com> (Oleg Nesterov's message of "Mon, 4 Jun 2012 18:51:17 +0200")
Oleg Nesterov <oleg@redhat.com> writes:
> On 06/04, Glauber Costa wrote:
>>
>> Currently, it is possible for a process to join existing
>> net, uts and ipc namespaces. This patch allows a process to join an
>> existing pid namespace as well.
>
> I can't understand this patch... but probably I missed something,
> I never really understood setns.
The idea with setns is akin to callusermodehelper in the kernel.
>From outside a container we want to allow an appropriately privileged
user to create a process inside the container.
We run into all kinds of interesting gotchas with entering the
pid namespace:
- Disjoint process trees.
- Ensuring all processes are gone when we exit a pid namespace.
- Not letting an empty pid namespace accept more processes.
We really only have two possbilities here.
- Allocate a new struct pid that is a superset of our current struct
pid but having additional processes ids inside a new pid namespace.
Along with all of the appropriate sanity checks to make that safe.
- Just modify the pid namespace the child processes of setns will use.
I lean towards the second option as that seems to have the best semantic
match to practical applications, and fewer kernel races to contend with,
but I might be persuadable.
However we do this we need to fix the bugs in pid namespace cleanup,
and deal with the issues that disjoint process trees bring to waiting
for all processes in a pid namespace to exit.
Ugh. Getting the waking up of zap_pid_ns_processes right and handling
the reaping of zombines in the cases of disjoint process trees is going
to be interesting.
Eric
next prev parent reply other threads:[~2012-06-05 17:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 13:33 [PATCH] allow a task to join a pid namespace Glauber Costa
2012-06-04 16:51 ` Oleg Nesterov
2012-06-05 9:30 ` Daniel Lezcano
2012-06-05 17:18 ` Eric W. Biederman [this message]
2012-06-05 9:36 ` Daniel Lezcano
2012-06-05 9:37 ` Glauber Costa
2012-06-05 10:00 ` [Devel] " Glauber Costa
2012-06-05 12:52 ` Daniel Lezcano
2012-06-05 12:53 ` Glauber Costa
2012-06-05 13:18 ` Daniel Lezcano
2012-06-05 17:39 ` Eric W. Biederman
2012-06-05 11:33 ` Glauber Costa
2012-06-06 18:29 ` Eric W. Biederman
2012-06-05 16:49 ` Eric W. Biederman
2012-06-06 8:54 ` Glauber Costa
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=874nqp7k3n.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=cgroups@vger.kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devel@openvz.org \
--cc=glommer@parallels.com \
--cc=kir@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=oleg@redhat.com \
--cc=serge.hallyn@canonical.com \
--cc=tj@kernel.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