mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-29 05:12:59 +01:00
fs: refuse fspick() on internal superblocks
There's a few instances where a internal superblock is reachable by
fspick(). Block that. graft_tree() and fsmount() already refuse them.
fanotify refuses mount and superblock marks on them for the same reason.
Fixes: cf3cba4a42 ("vfs: syscall: Add fspick() to select a superblock for reconfiguration")
Cc: [email protected] # v5.2+
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Christian Brauner (Amutable) <[email protected]>
This commit is contained in:
1 file changed
+3
@@ -190,6 +190,9 @@ SYSCALL_DEFINE3(fspick, int, dfd, const char __user *, path, unsigned int, flags
|
||||
ret = -EINVAL;
|
||||
if (target.mnt->mnt_root != target.dentry)
|
||||
goto err_path;
|
||||
/* kernel-internal superblocks are nobody's to reconfigure */
|
||||
if (target.dentry->d_sb->s_flags & SB_NOUSER)
|
||||
goto err_path;
|
||||
|
||||
fc = fs_context_for_reconfigure(target.dentry, 0, 0);
|
||||
if (IS_ERR(fc)) {
|
||||
|
||||
Reference in new issue
Block a user