Re: fs_context-related oops in mainline

From: Greg Kroah-Hartman
Date: Fri Mar 15 2019 - 10:29:22 EST


On Fri, Mar 15, 2019 at 02:24:30PM +0000, David Howells wrote:
> Al Viro <viro@xxxxxxxxxxxxxxxxxx> 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?

Ask the networking people that question, I have no idea :)