mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
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>
This commit is contained in:
committed by
Christian Brauner
parent
00633c4683
commit
6dd3c6884c
@@ -4498,6 +4498,10 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
|
||||
new_mnt = vfs_create_mount(fc);
|
||||
if (IS_ERR(new_mnt))
|
||||
return PTR_ERR(new_mnt);
|
||||
if (new_mnt->mnt_sb->s_flags & SB_NOUSER) {
|
||||
mntput(new_mnt);
|
||||
return -EINVAL;
|
||||
}
|
||||
new_mnt->mnt_flags = mnt_flags;
|
||||
|
||||
new_path.dentry = dget(fc->root);
|
||||
|
||||
Reference in New Issue
Block a user