mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
mnt: If fs_fully_visible fails call put_filesystem.
Add this trivial missing error handling.
Cc: stable@vger.kernel.org
Fixes: 1b852bceb0
("mnt: Refactor the logic for mounting sysfs and proc in a user namespace")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
af8c34ce6a
commit
97c1df3e54
1 changed files with 3 additions and 1 deletions
|
@ -2409,8 +2409,10 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
|
||||||
mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
|
mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
|
||||||
}
|
}
|
||||||
if (type->fs_flags & FS_USERNS_VISIBLE) {
|
if (type->fs_flags & FS_USERNS_VISIBLE) {
|
||||||
if (!fs_fully_visible(type, &mnt_flags))
|
if (!fs_fully_visible(type, &mnt_flags)) {
|
||||||
|
put_filesystem(type);
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue