Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 05 Jan 2016 19:38:15 -0600
From: ebiederm@...ssion.com (Eric W. Biederman)
To: cve-assign@...re.org
Cc: john.johansen@...onical.com,  oss-security@...ts.openwall.com
Subject: Re: Re: CVE Request: Linux kernel: privilege escalation in user namespaces

cve-assign@...re.org writes:

> Use CVE-2015-8709 for the issue fixed in the
> https://lkml.org/lkml/2015/12/25/71 post.
>
> (This is not yet available at
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/kernel/ptrace.c
> and http://marc.info/?l=linux-kernel&m=145118185526359 might be the
> current end of the earlier discussion.)
>
> This issue has been covered in security advisories from one or more
> Linux distributions, e.g.,
>
>>> http://www.ubuntu.com/usn/usn-2847-1
>>> 
>>> Jann Horn discovered a ptrace issue with user namespaces in the Linux
>>> kernel. The namespace owner could potentially exploit this flaw by ptracing
>>> a root owned process entering the user namespace to elevate its privileges
>>> and potentially gain access outside of the namespace.
>>> (http://bugs.launchpad.net/bugs/1527374)
>
>
> There has been some discussion of whether the finding was a
> vulnerability discovery, e.g.,
>
>>>> Date: Fri, 18 Dec 2015 00:07:19 +0100
>>>> From: Jann Horn <jann@...jh.net>
>>>> 
>>>> I'm not sure whether this is CVE-worthy - the user_namespaces
>>>> manpage says "the process has full privileges for operations
>>>> inside the user namespace, but is unprivileged for operations
>>>> outside the namespace". ptrace()ing a process in the
>>>> namespace can reasonably be considered an "operation inside
>>>> the user namespace" ...
>>>> 
>>>> In my opinion, this patch is somewhere between hardening and
>>>> a security feature, but I wouldn't really call it a vuln fix.
>
>
>>>>> Date: Thu, 17 Dec 2015 23:54:03 +0000
>>>>> From: Serge Hallyn <serge.hallyn@...ntu.com>
>>>>> 
>>>>>> ptrace()ing a process in the
>>>>>> namespace can reasonably be considered an "operation inside
>>>>>> the user namespace"
>>>>> 
>>>>> Except by creating a file in the host namespace, you were, as
>>>>> root in the container, able to escape your namespace, right?
>
> We feel that, more generally, the usn-2847-1 mention of "and
> potentially gain access outside of the namespace" is a realistic
> concern.

My mind is boggling at some of the logic involved here.

There is no potentially gaining access outside of the namespace when it
is access to things that were put inside the namespace.

The discussion was about how to make it easier for userspace not to do
stupid things, not how to fix a bug in the kernel.

The code we have been discussing most definitely does not make it safe
for a arbitrary root owned processes to call setns and enter a user
namespace with a hostile user namespace root.  You have to close file
descriptors, unmap files and do I don't know what else.  Properly
and safely dropping privileges is a challenging problem.

Calling bug because it is possible to use a kernel feature wrong feels
completely inappropriate.

Eric

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.