[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87o9bvm6cm.fsf@xmission.com>
Date: Mon, 15 Oct 2018 13:07:21 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Jann Horn <jannh@...gle.com>
Cc: Nagarathnam Muthusamy <nagarathnam.muthusamy@...cle.com>,
kernel list <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Serge Hallyn <serge.hallyn@...ntu.com>,
Oleg Nesterov <oleg@...hat.com>,
Prakash Sangappa <prakash.sangappa@...cle.com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Andy Lutomirski <luto@...capital.net>
Subject: Re: [RFC] Allow user namespace inside chroot
Jann Horn <jannh@...gle.com> writes:
> On Mon, Oct 15, 2018 at 7:10 PM <nagarathnam.muthusamy@...cle.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
Powered by blists - more mailing lists