Re: [PATCH] make new mount API honour SB_NOUSER (was Re: [PATCH] block: Avoid mounting the bdev pseudo-filesystem in userspace)

From: Al Viro

Date: Tue Jun 02 2026 - 10:17:35 EST


On Tue, Jun 02, 2026 at 11:11:11AM +0200, Jan Kara wrote:
> On Tue 02-06-26 03:04:44, Al Viro wrote:
> > one should *not* be allowed to mount one of those, new API or not.
> >
> > Reported-by: Denis Arefev <arefev@xxxxxxxxx>
> > Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
>
> Won't it make sense to actually check fc->sb_flags before we call
> vfs_create_mount()? Otherwise it looks good to me.

Interpretation of fc->sb_flags is up to your ->get_tree(). What matters
is ->s_flags in the resulting superblock; that's type-independent and
that's what we ought to check...