From: Jaegeuk Kim Date: Wed, 13 Mar 2019 23:15:08 +0000 (-0700) Subject: f2fs: set pin_file under CAP_SYS_ADMIN X-Git-Tag: v5.1-rc1~25^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aff7b628ac2d58616b74789389ebb1e987081f49;p=thirdparty%2Fkernel%2Flinux.git f2fs: set pin_file under CAP_SYS_ADMIN Android uses pin_file for uncrypt during OTA, and that should be managed by CAP_SYS_ADMIN only. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 807a97ad2430a..012815d816e6b 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2873,8 +2873,8 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg) __u32 pin; int ret = 0; - if (!inode_owner_or_capable(inode)) - return -EACCES; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; if (get_user(pin, (__u32 __user *)arg)) return -EFAULT;