From: Oleg Nesterov <oleg@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Brad Spengler <spender@grsecurity.net>,
Colin Walters <walters@redhat.com>,
Pavel Emelyanov <xemul@parallels.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] fork: unify and tighten up CLONE_NEWUSER/CLONE_NEWPID checks
Date: Fri, 23 Aug 2013 15:59:23 +0200 [thread overview]
Message-ID: <20130823135923.GA16773@redhat.com> (raw)
In-Reply-To: <CALCETrVT4r3G9tQpt4y22iB+y-fw5piH93OOn9wfvSd8xQdDBw@mail.gmail.com>
On 08/22, Andy Lutomirski wrote:
>
> On Thu, Aug 22, 2013 at 11:32 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> > On 08/22, Andy Lutomirski wrote:
> >>
> >> On Thu, Aug 22, 2013 at 11:15 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> >> >
> >> > Yes. Before this patch do_fork() did:
> >> >
> >> > if (clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) {
> >> > if (clone_flags & (CLONE_THREAD|CLONE_PARENT))
> >> > return -EINVAL;
> >> > }
> >> >
> >> > however, let me repeat, CLONE_PARENT after unshare(CLONE_NEWPID) was
> >> > allowed. With this patch CLONE_PARENT is nacked in both cases.
> >>
> >> Is this -stable-worthy?
> >
> > Honestly, I do not know. I do not want to abuse -stable, and I will
> > sleep better if this patch won't go into the stable trees ;)
> >
> > OTOH, I think that at least 1/3 is probably -stable material... Since
> > I am going to send v2, I would not mind to add stable@vger.kernel.org
> > if both you and Eric agree.
>
> This may allow creation of a process with tgid and pid in different
> pid namespaces. If so, I have no idea what the consequences would be.
and share the parent with the creator.
Not good. But probably not too bad, one can abuse ->pidns_install()
anyway, create a child in another ns, exit. Like it or not but pid_ns
is "special" and you even sent the patch to reflect this sad^W fact.
Anyway. The main point of this patch is the consistency (plus imho it
cleanups/simplifies the code). Both CLONE_NEWPID and
"task_active_pid_ns() != pid_ns" create a task in another namespace,
we should use the same restrictions.
And you seem to agree with this change, can I take it as your ack ?
I am going to preserve your acks in 1-2 and resend.
Oleg.
next prev parent reply other threads:[~2013-08-23 14:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-22 17:09 [PATCH 0/3] namespaces && fork fixes/cleanups Oleg Nesterov
2013-08-22 17:09 ` [PATCH 1/3] pidns: fix vfork() after unshare(CLONE_NEWPID) Oleg Nesterov
2013-08-22 17:59 ` Andy Lutomirski
2013-08-22 18:22 ` Oleg Nesterov
2013-08-22 17:10 ` [PATCH 2/3] pidns: kill the unnecessary CLONE_NEWPID in copy_process() Oleg Nesterov
2013-08-22 18:05 ` Andy Lutomirski
2013-08-22 17:10 ` [PATCH 3/3] fork: unify and tighten up CLONE_NEWUSER/CLONE_NEWPID checks Oleg Nesterov
2013-08-22 18:10 ` Andy Lutomirski
2013-08-22 18:15 ` Oleg Nesterov
2013-08-22 18:29 ` Andy Lutomirski
2013-08-22 18:32 ` Oleg Nesterov
2013-08-22 19:11 ` Andy Lutomirski
2013-08-23 13:59 ` Oleg Nesterov [this message]
2013-08-23 17:42 ` Andy Lutomirski
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=20130823135923.GA16773@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=spender@grsecurity.net \
--cc=torvalds@linux-foundation.org \
--cc=walters@redhat.com \
--cc=xemul@parallels.com \
/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;
as well as URLs for NNTP newsgroup(s).