diff options
author | Seth Forshee <seth.forshee@canonical.com> | 2015-02-15 21:35:35 +0100 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-05-24 19:04:28 +0200 |
commit | f3f1a18330ac1b717cd7a32adff38d965f365aa2 (patch) | |
tree | 9dc33f121860883e67be6e677099010659828fa1 /fs/ioctl.c | |
parent | capabilities: Allow privileged user in s_user_ns to set security.* xattrs (diff) | |
download | linux-f3f1a18330ac1b717cd7a32adff38d965f365aa2.tar.xz linux-f3f1a18330ac1b717cd7a32adff38d965f365aa2.zip |
fs: Allow CAP_SYS_ADMIN in s_user_ns to freeze and thaw filesystems
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>
Acked-by: Christian Brauner <christian@brauner.io>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/ioctl.c')
-rw-r--r-- | fs/ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ioctl.c b/fs/ioctl.c index 4823431d1c9d..b445b13fc59b 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -549,7 +549,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. */ @@ -566,7 +566,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 */ |