lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 15 Mar 2019 14:51:55 +0000
From:   Al Viro <viro@...iv.linux.org.uk>
To:     David Howells <dhowells@...hat.com>
Cc:     Dominik Brodowski <linux@...inikbrodowski.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Tejun Heo <tj@...nel.org>, Li Zefan <lizefan@...wei.com>,
        Johannes Weiner <hannes@...xchg.org>, cgroups@...r.kernel.org,
        fenghua.yu@...el.com, linux-kernel@...r.kernel.org
Subject: Re: fs_context-related oops in mainline

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ