From: Al Viro <viro@zeniv.linux.org.uk>
To: David Howells <dhowells@redhat.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
Johannes Weiner <hannes@cmpxchg.org>,
cgroups@vger.kernel.org, fenghua.yu@intel.com,
linux-kernel@vger.kernel.org
Subject: Re: fs_context-related oops in mainline
Date: Fri, 15 Mar 2019 14:51:55 +0000 [thread overview]
Message-ID: <20190315145155.GZ2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <11428.1552659870@warthog.procyon.org.uk>
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...
prev parent reply other threads:[~2019-03-15 14:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 7:43 fs_context-related oops in mainline Dominik Brodowski
2019-03-15 11:34 ` Al Viro
2019-03-15 11:46 ` Dominik Brodowski
2019-03-15 11:44 ` David Howells
2019-03-15 11:50 ` Dominik Brodowski
2019-03-15 12:18 ` Al Viro
2019-03-15 12:57 ` Dominik Brodowski
2019-03-15 14:24 ` David Howells
2019-03-15 14:29 ` Greg Kroah-Hartman
2019-03-15 14:51 ` Al Viro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190315145155.GZ2217@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=cgroups@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=fenghua.yu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=lizefan@huawei.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).