]> Git Repo - linux.git/blobdiff - fs/namespace.c
Merge branch 'for-6.1/logitech' into for-linus
[linux.git] / fs / namespace.c
index 68789f896f0819e0abeb509e90aea20dbc0fc7c7..df137ba19d3756bd08d544f0d7e95eb52cb4869c 100644 (file)
@@ -4238,6 +4238,13 @@ static int build_mount_idmapped(const struct mount_attr *attr, size_t usize,
                err = -EPERM;
                goto out_fput;
        }
+
+       /* We're not controlling the target namespace. */
+       if (!ns_capable(mnt_userns, CAP_SYS_ADMIN)) {
+               err = -EPERM;
+               goto out_fput;
+       }
+
        kattr->mnt_userns = get_user_ns(mnt_userns);
 
 out_fput:
This page took 0.023251 seconds and 4 git commands to generate.