All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jann Horn <jannh@google.com>
Cc: Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Serge Hallyn <serge.hallyn@ubuntu.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Prakash Sangappa <prakash.sangappa@oracle.com>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [RFC] Allow user namespace inside chroot
Date: Mon, 15 Oct 2018 13:07:21 -0500	[thread overview]
Message-ID: <87o9bvm6cm.fsf@xmission.com> (raw)
In-Reply-To: <CAG48ez2cHT1U5nn+dNCAg3Lk5047=Tr20T8HkKhBUt1Mv+gNeg@mail.gmail.com> (Jann Horn's message of "Mon, 15 Oct 2018 19:22:12 +0200")

Jann Horn <jannh@google.com> writes:

> On Mon, Oct 15, 2018 at 7:10 PM <nagarathnam.muthusamy@oracle.com> wrote:
>> @@ -1281,7 +1285,7 @@ static int userns_install(struct nsproxy *nsproxy, struct ns_common *ns)
>>                 return -ENOMEM;
>>
>>         put_user_ns(cred->user_ns);
>> -       set_cred_user_ns(cred, get_user_ns(user_ns));
>> +       set_cred_user_ns(cred, get_user_ns(user_ns), 0);
>
> This looks bogus. With this, I think your restriction can be bypassed
> if process A forks a child B, B creates a new user namespace, then A
> enters the user namespace with setns() and has full capabilities. Am I
> missing something?

Nope.  I feel silly for missing that angle.

Even without the full capabilities the userns_install angle will place
you at the root of the mount namespace outside of the chroot.

At which point I have visions of the special cases multiplying like
bunnies make this work.  Without a very strong case I don't like this at all.

Eric




  parent reply	other threads:[~2018-10-15 18:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 17:10 [RFC] Allow user namespace inside chroot nagarathnam.muthusamy
2018-10-15 17:22 ` Jann Horn
2018-10-15 17:27   ` Andy Lutomirski
2018-10-15 18:07   ` Eric W. Biederman [this message]
2018-10-15 17:42 ` Eric W. Biederman
2018-10-15 18:00   ` Nagarathnam Muthusamy

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=87o9bvm6cm.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=nagarathnam.muthusamy@oracle.com \
    --cc=oleg@redhat.com \
    --cc=prakash.sangappa@oracle.com \
    --cc=serge.hallyn@ubuntu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.