summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2019-03-13 16:15:08 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2019-03-14 14:17:33 -0700
commit22c197243aeef0fa552f7e2ae41500a437e79890 (patch)
treeca5f82233c76840f480acf17314783e59d820363 /fs
parent557dadbd8114716f215d72d2d89060720e5ad45d (diff)
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 <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9cc2563d6811..637a9dfbd578 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2653,8 +2653,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;