* Re: [RFC][PATCH 2/2] Prevent container-inits from using CLONE_PARENT
[not found] ` <20090618153501.GA6404@redhat.com>
@ 2009-06-18 15:42 ` Oleg Nesterov
0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2009-06-18 15:42 UTC (permalink / raw)
To: Sukadev Bhattiprolu
Cc: serue, Eric W. Biederman, roland, Pavel Emelyanov,
Alexey Dobriyan, Oren Laadan, David C. Hansen, Containers,
linux-kernel
On 06/18, Oleg Nesterov wrote:
>
> On 06/17, Sukadev Bhattiprolu wrote:
> >
> > @@ -974,6 +974,14 @@ static struct task_struct *copy_process(
> > if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
> > return ERR_PTR(-EINVAL);
> >
> > + /*
> > + * To keep pid namespace semantics simple, prevent container-inits
> > + * from creating siblings.
> > + */
> > + if ((clone_flags & CLONE_PARENT) &&
> > + is_container_init(current) && !is_global_init(current))
>
> Both is_ checks are not right afaics. There are per-thread. This means
> that container-init can do clone(CLONE_THREAD), and then this thread
> does CLONE_PARENT and fools copy_process().
>
> As for !is_global_init(). I never understood what should we do if the
> global init does CLONE_PARENT, this attaches another process to swapper,
> not good.
Hmm. And idle threads run with ->action[SIGHLD] == SIG_DFL, so this is
really wrong. Fortunately, we can trust the global init.
Oleg.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-18 15:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090618024743.GA31515@us.ibm.com>
[not found] ` <20090618025103.GB31672@us.ibm.com>
[not found] ` <20090618153501.GA6404@redhat.com>
2009-06-18 15:42 ` [RFC][PATCH 2/2] Prevent container-inits from using CLONE_PARENT Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox