Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-29 Thread Serge E. Hallyn
On Wed, Jul 29, 2015 at 11:04:50AM -0500, Serge E. Hallyn wrote: > On Thu, Jul 16, 2015 at 12:04:43AM -0500, Eric W. Biederman wrote: > > > I tend to thing that, if we're not honoring the fcaps, we shouldn't be > > > honoring the setuid bit either. After all, it's really not a trusted > > > file,

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-29 Thread Serge E. Hallyn
On Thu, Jul 16, 2015 at 12:04:43AM -0500, Eric W. Biederman wrote: > > I tend to thing that, if we're not honoring the fcaps, we shouldn't be > > honoring the setuid bit either. After all, it's really not a trusted > > file, even though the only user who could have messed with it really > > is

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-29 Thread Serge E. Hallyn
On Thu, Jul 16, 2015 at 12:04:43AM -0500, Eric W. Biederman wrote: I tend to thing that, if we're not honoring the fcaps, we shouldn't be honoring the setuid bit either. After all, it's really not a trusted file, even though the only user who could have messed with it really is the

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-29 Thread Serge E. Hallyn
On Wed, Jul 29, 2015 at 11:04:50AM -0500, Serge E. Hallyn wrote: On Thu, Jul 16, 2015 at 12:04:43AM -0500, Eric W. Biederman wrote: I tend to thing that, if we're not honoring the fcaps, we shouldn't be honoring the setuid bit either. After all, it's really not a trusted file, even

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-16 Thread Eric W. Biederman
Seth Forshee writes: > On Thu, Jul 16, 2015 at 12:44:49AM -0500, Eric W. Biederman wrote: >> Andy Lutomirski writes: >> >> > On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman >> > wrote: >> >> Andy Lutomirski writes: >> >> >> >>> >> >>> So here's the semantic question: >> >>> >> >>>

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-16 Thread Seth Forshee
On Thu, Jul 16, 2015 at 12:44:49AM -0500, Eric W. Biederman wrote: > Andy Lutomirski writes: > > > On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman > > wrote: > >> Andy Lutomirski writes: > >> > >>> > >>> So here's the semantic question: > >>> > >>> Suppose an unprivileged user (uid 1000)

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-16 Thread Seth Forshee
On Wed, Jul 15, 2015 at 06:23:01PM -0700, Andy Lutomirski wrote: > > So if we have the s_user_ns check in get_file_caps the mnt_may_suid pass > > isn't strictly necessary, but I still think it is useful as a mitigation > > to the "leaks" Eric mentions. It _should_ be impossible for a user to > >

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-16 Thread Seth Forshee
On Wed, Jul 15, 2015 at 06:23:01PM -0700, Andy Lutomirski wrote: So if we have the s_user_ns check in get_file_caps the mnt_may_suid pass isn't strictly necessary, but I still think it is useful as a mitigation to the leaks Eric mentions. It _should_ be impossible for a user to gain access

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-16 Thread Seth Forshee
On Thu, Jul 16, 2015 at 12:44:49AM -0500, Eric W. Biederman wrote: Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman ebied...@xmission.com wrote: Andy Lutomirski l...@amacapital.net writes: So here's the semantic question: Suppose an

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-16 Thread Eric W. Biederman
Seth Forshee seth.fors...@canonical.com writes: On Thu, Jul 16, 2015 at 12:44:49AM -0500, Eric W. Biederman wrote: Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman ebied...@xmission.com wrote: Andy Lutomirski l...@amacapital.net writes:

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Andy Lutomirski writes: > On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman > wrote: >> Andy Lutomirski writes: >> >>> >>> So here's the semantic question: >>> >>> Suppose an unprivileged user (uid 1000) creates a user namespace and a >>> mount namespace. They stick a file (owned by uid

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: > >> On Wed, Jul 15, 2015 at 9:23 PM, Eric W. Biederman >> wrote: >>> >>> Ok. Andy I have stopped and really looked at your patch that is 4/7 in >>> this series. Something I had not done before since it

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Andy Lutomirski writes: > On Wed, Jul 15, 2015 at 9:23 PM, Eric W. Biederman > wrote: >> >> Ok. Andy I have stopped and really looked at your patch that is 4/7 in >> this series. Something I had not done before since it sounded totally >> wrong. >> >> That combined with your earlier comments

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 9:23 PM, Eric W. Biederman wrote: > > Ok. Andy I have stopped and really looked at your patch that is 4/7 in > this series. Something I had not done before since it sounded totally > wrong. > > That combined with your earlier comments I think I can say something >

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Ok. Andy I have stopped and really looked at your patch that is 4/7 in this series. Something I had not done before since it sounded totally wrong. That combined with your earlier comments I think I can say something meaningful. Andy as I read your patch the thread you are primarily worried

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 6:14 PM, Seth Forshee wrote: > mnt_may_suid would also restrict the namespaces where the capabilities > would be honored, but not to only namespaces where the mounter is > already privileged. Of course it does require a user privileged in > another namespace to perform a

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 3:35 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: > >> On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn wrote: >>> On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: Capability sets attached to files must be ignored except in the user

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Seth Forshee
On Wed, Jul 15, 2015 at 05:35:24PM -0500, Eric W. Biederman wrote: > Andy Lutomirski writes: > > > On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn wrote: > >> On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: > >>> Capability sets attached to files must be ignored except in the >

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Andy Lutomirski writes: > On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn wrote: >> On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: >>> Capability sets attached to files must be ignored except in the >>> user namespaces where the mounter is privileged, i.e. s_user_ns >>> and its

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn wrote: > On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: >> Capability sets attached to files must be ignored except in the >> user namespaces where the mounter is privileged, i.e. s_user_ns >> and its descendants. Otherwise a vector

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Serge E. Hallyn
On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: > Capability sets attached to files must be ignored except in the > user namespaces where the mounter is privileged, i.e. s_user_ns > and its descendants. Otherwise a vector exists for gaining > privileges in namespaces where a user is

[PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Seth Forshee
Capability sets attached to files must be ignored except in the user namespaces where the mounter is privileged, i.e. s_user_ns and its descendants. Otherwise a vector exists for gaining privileges in namespaces where a user is not already privileged. Add a new helper function, in_user_ns(), to

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman ebied...@xmission.com wrote: Andy Lutomirski l...@amacapital.net writes: So here's the semantic question: Suppose an unprivileged user (uid 1000) creates a user namespace and a mount

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 10:04 PM, Eric W. Biederman ebied...@xmission.com wrote: Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 9:23 PM, Eric W. Biederman ebied...@xmission.com wrote: Ok. Andy I have stopped and really looked at your patch that is 4/7 in this series.

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Ok. Andy I have stopped and really looked at your patch that is 4/7 in this series. Something I had not done before since it sounded totally wrong. That combined with your earlier comments I think I can say something meaningful. Andy as I read your patch the thread you are primarily worried

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 9:23 PM, Eric W. Biederman ebied...@xmission.com wrote: Ok. Andy I have stopped and really looked at your patch that is 4/7 in this series. Something I had not done before since it sounded totally wrong. That combined with your earlier comments I think I can say

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 9:23 PM, Eric W. Biederman ebied...@xmission.com wrote: Ok. Andy I have stopped and really looked at your patch that is 4/7 in this series. Something I had not done before since it sounded totally wrong. That combined

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Seth Forshee
On Wed, Jul 15, 2015 at 05:35:24PM -0500, Eric W. Biederman wrote: Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn se...@hallyn.com wrote: On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: Capability sets attached to files must be

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 3:35 PM, Eric W. Biederman ebied...@xmission.com wrote: Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn se...@hallyn.com wrote: On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: Capability sets attached to files

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 6:14 PM, Seth Forshee seth.fors...@canonical.com wrote: mnt_may_suid would also restrict the namespaces where the capabilities would be honored, but not to only namespaces where the mounter is already privileged. Of course it does require a user privileged in another

[PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Seth Forshee
Capability sets attached to files must be ignored except in the user namespaces where the mounter is privileged, i.e. s_user_ns and its descendants. Otherwise a vector exists for gaining privileges in namespaces where a user is not already privileged. Add a new helper function, in_user_ns(), to

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Eric W. Biederman
Andy Lutomirski l...@amacapital.net writes: On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn se...@hallyn.com wrote: On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: Capability sets attached to files must be ignored except in the user namespaces where the mounter is privileged,

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Serge E. Hallyn
On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: Capability sets attached to files must be ignored except in the user namespaces where the mounter is privileged, i.e. s_user_ns and its descendants. Otherwise a vector exists for gaining privileges in namespaces where a user is not

Re: [PATCH 3/7] fs: Ignore file caps in mounts from other user namespaces

2015-07-15 Thread Andy Lutomirski
On Wed, Jul 15, 2015 at 2:48 PM, Serge E. Hallyn se...@hallyn.com wrote: On Wed, Jul 15, 2015 at 02:46:04PM -0500, Seth Forshee wrote: Capability sets attached to files must be ignored except in the user namespaces where the mounter is privileged, i.e. s_user_ns and its descendants. Otherwise