mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
mnt: Move the FS_USERNS_MOUNT check into sget_userns
Allowing a filesystem to be mounted by other than root in the initial user namespace is a filesystem property not a mount namespace property and as such should be checked in filesystem specific code. Move the FS_USERNS_MOUNT test into super.c:sget_userns(). Acked-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
6e4eab577a
commit
a001e74cef
2 changed files with 4 additions and 4 deletions
|
@ -2397,10 +2397,6 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
|
|||
return -ENODEV;
|
||||
|
||||
if (user_ns != &init_user_ns) {
|
||||
if (!(type->fs_flags & FS_USERNS_MOUNT)) {
|
||||
put_filesystem(type);
|
||||
return -EPERM;
|
||||
}
|
||||
/* Only in special cases allow devices from mounts
|
||||
* created outside the initial user namespace.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue