]> git.proxmox.com Git - mirror_ubuntu-artful-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)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 5 Sep 2017 12:33:37 +0000 (07:33 -0500)
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>
fs/ioctl.c

index 569db68d02b317bbc7f1b4fd040268c3c53afa8a..48a068c81396029c20e61d50cb1d3d1684c9f475 100644 (file)
@@ -548,7 +548,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. */
@@ -565,7 +565,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 */