lkml.org 
[lkml]   [2019]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fs_context-related oops in mainline
On Fri, Mar 15, 2019 at 02:24:30PM +0000, David Howells wrote:
> Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> > - if (fc->user_ns)
> > - put_user_ns(fc->user_ns);
> > - fc->user_ns = get_user_ns(netns->user_ns);
> > + if (netns) {
> > + if (fc->user_ns)
> > + put_user_ns(fc->user_ns);
> > + fc->user_ns = get_user_ns(netns->user_ns);
> > + }
>
> This begs the question why is sysfs using the current network namespace's idea
> of the user namespace? Why not just use the one directly from current->cred?

Because it gives access to that netns guts, presumably. In a saner world sysfs
wouldn't _have_ netns-dependent bits; a separate per-netns filesystem would
contain those, and be mounted separately. And yes, we do have way too many
kinds of namespaces, along with filesystems that try to mix unrelated bits and
lead to something that looks like Cthulhu's arse after an unfortunate
accident with capsaicin suppository...

\
 
 \ /
  Last update: 2019-03-15 15:53    [W:0.052 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site