Skip to content

Commit 6dd3c68

Browse files
Al Virobrauner
authored andcommitted
mount: honour SB_NOUSER in the new mount API
One should *not* be allowed to mount one of those, new API or not. Reported-by: Denis Arefev <arefev@swemel.ru> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Link: https://patch.msgid.link/20260602020444.GP2636677@ZenIV Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
1 parent 00633c4 commit 6dd3c68

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/namespace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4498,6 +4498,10 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
44984498
new_mnt = vfs_create_mount(fc);
44994499
if (IS_ERR(new_mnt))
45004500
return PTR_ERR(new_mnt);
4501+
if (new_mnt->mnt_sb->s_flags & SB_NOUSER) {
4502+
mntput(new_mnt);
4503+
return -EINVAL;
4504+
}
45014505
new_mnt->mnt_flags = mnt_flags;
45024506

45034507
new_path.dentry = dget(fc->root);

0 commit comments

Comments
 (0)