From: David Miller <davem@davemloft.net>
To: ebiederm@xmission.com
Cc: hannes@stressinduktion.org, daniel@iogearbox.net, ast@kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net] bpf: Use mount_nodev not mount_ns to mount the bpf filesystem
Date: Fri, 20 May 2016 19:46:55 -0400 (EDT) [thread overview]
Message-ID: <20160520.194655.1996549847813859589.davem@davemloft.net> (raw)
In-Reply-To: <874m9sfjyf.fsf_-_@x220.int.ebiederm.org>
From: ebiederm@xmission.com (Eric W. Biederman)
Date: Fri, 20 May 2016 17:22:48 -0500
>
> While reviewing the filesystems that set FS_USERNS_MOUNT I spotted the
> bpf filesystem. Looking at the code I saw a broken usage of mount_ns
> with current->nsproxy->mnt_ns. As the code does not acquire a
> reference to the mount namespace it can not possibly be correct to
> store the mount namespace on the superblock as it does.
>
> Replace mount_ns with mount_nodev so that each mount of the bpf
> filesystem returns a distinct instance, and the code is not buggy.
>
> In discussion with Hannes Frederic Sowa it was reported that the use
> of mount_ns was an attempt to have one bpf instance per mount
> namespace, in an attempt to keep resources that pin resources from
> hiding. That intent simply does not work, the vfs is not built to
> allow that kind of behavior. Which means that the bpf filesystem
> really is buggy both semantically and in it's implemenation as it does
> not nor can it implement the original intent.
>
> This change is userspace visible, but my experience with similar
> filesystems leads me to believe nothing will break with a model of each
> mount of the bpf filesystem is distinct from all others.
>
> Fixes: b2197755b263 ("bpf: add support for persistent maps/progs")
> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Applied and queued up for -stable, thanks everyone.
next prev parent reply other threads:[~2016-05-20 23:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87oa84wa6h.fsf@x220.int.ebiederm.org>
2016-05-18 10:48 ` [RFC][PATCH net] bpf: Use mount_nodev not mount_ns to mount the bpf filesystem Hannes Frederic Sowa
2016-05-18 14:56 ` Eric W. Biederman
2016-05-18 20:43 ` Daniel Borkmann
2016-05-18 20:46 ` Hannes Frederic Sowa
2016-05-20 22:22 ` [PATCH " Eric W. Biederman
2016-05-20 23:27 ` Hannes Frederic Sowa
2016-05-20 23:46 ` David Miller [this message]
2016-05-20 22:31 ` [RFC][PATCH " Eric W. Biederman
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=20160520.194655.1996549847813859589.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=ebiederm@xmission.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.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).