]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: (namespace) fs: Allow CAP_SYS_ADMIN in s_user_ns to freeze and thaw...
authorSeth Forshee <seth.forshee@canonical.com>
Sun, 15 Feb 2015 20:35:35 +0000 (14:35 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
The user in control of a super block should be allowed to freeze
and thaw it. Relax the restrictions on the FIFREEZE and FITHAW
ioctls to require CAP_SYS_ADMIN in s_user_ns.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
fs/ioctl.c

index cb9b02940805cba8d30720c0af63ec5174931c7e..0e16d6fd0472f9a4172d1d06753578d9213f5ed5 100644 (file)
@@ -546,7 +546,7 @@ static int ioctl_fsfreeze(struct file *filp)
 {
        struct super_block *sb = file_inode(filp)->i_sb;
 
-       if (!capable(CAP_SYS_ADMIN))
+       if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
                return -EPERM;
 
        /* If filesystem doesn't support freeze feature, return. */
@@ -563,7 +563,7 @@ static int ioctl_fsthaw(struct file *filp)
 {
        struct super_block *sb = file_inode(filp)->i_sb;
 
-       if (!capable(CAP_SYS_ADMIN))
+       if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
                return -EPERM;
 
        /* Thaw */