|
@@ -2185,13 +2185,7 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
|
|
}
|
|
}
|
|
if ((mnt->mnt.mnt_flags & MNT_LOCK_NODEV) &&
|
|
if ((mnt->mnt.mnt_flags & MNT_LOCK_NODEV) &&
|
|
!(mnt_flags & MNT_NODEV)) {
|
|
!(mnt_flags & MNT_NODEV)) {
|
|
- /* Was the nodev implicitly added in mount? */
|
|
|
|
- if ((mnt->mnt_ns->user_ns != &init_user_ns) &&
|
|
|
|
- !(sb->s_type->fs_flags & FS_USERNS_DEV_MOUNT)) {
|
|
|
|
- mnt_flags |= MNT_NODEV;
|
|
|
|
- } else {
|
|
|
|
- return -EPERM;
|
|
|
|
- }
|
|
|
|
|
|
+ return -EPERM;
|
|
}
|
|
}
|
|
if ((mnt->mnt.mnt_flags & MNT_LOCK_NOSUID) &&
|
|
if ((mnt->mnt.mnt_flags & MNT_LOCK_NOSUID) &&
|
|
!(mnt_flags & MNT_NOSUID)) {
|
|
!(mnt_flags & MNT_NOSUID)) {
|
|
@@ -2385,7 +2379,6 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
|
|
int mnt_flags, const char *name, void *data)
|
|
int mnt_flags, const char *name, void *data)
|
|
{
|
|
{
|
|
struct file_system_type *type;
|
|
struct file_system_type *type;
|
|
- struct user_namespace *user_ns = current->nsproxy->mnt_ns->user_ns;
|
|
|
|
struct vfsmount *mnt;
|
|
struct vfsmount *mnt;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
@@ -2396,16 +2389,6 @@ static int do_new_mount(struct path *path, const char *fstype, int flags,
|
|
if (!type)
|
|
if (!type)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
- if (user_ns != &init_user_ns) {
|
|
|
|
- /* Only in special cases allow devices from mounts
|
|
|
|
- * created outside the initial user namespace.
|
|
|
|
- */
|
|
|
|
- if (!(type->fs_flags & FS_USERNS_DEV_MOUNT)) {
|
|
|
|
- flags |= MS_NODEV;
|
|
|
|
- mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
mnt = vfs_kern_mount(type, flags, name, data);
|
|
mnt = vfs_kern_mount(type, flags, name, data);
|
|
if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
|
|
if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) &&
|
|
!mnt->mnt_sb->s_subtype)
|
|
!mnt->mnt_sb->s_subtype)
|