On Fri, Dec 22, 2017 at 03:32:31PM +0100, Dongsu Park wrote:
> From: Seth Forshee <[email protected]>
> 
> 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.
> 
> Cc: [email protected]
> Cc: [email protected]
> Cc: Alexander Viro <[email protected]>
> Signed-off-by: Seth Forshee <[email protected]>
> Signed-off-by: Dongsu Park <[email protected]>

Reviewed-by: Serge Hallyn <[email protected]>

> ---
>  fs/ioctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ioctl.c b/fs/ioctl.c
> index 5ace7efb..8c628a8d 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 */
> -- 
> 2.13.6
> 
> _______________________________________________
> Containers mailing list
> [email protected]
> https://lists.linuxfoundation.org/mailman/listinfo/containers

Reply via email to