Skip to content

Commit aff7b62

Browse files
author
Jaegeuk Kim
committed
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>
1 parent aadcef6 commit aff7b62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/f2fs/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,8 +2873,8 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg)
28732873
__u32 pin;
28742874
int ret = 0;
28752875

2876-
if (!inode_owner_or_capable(inode))
2877-
return -EACCES;
2876+
if (!capable(CAP_SYS_ADMIN))
2877+
return -EPERM;
28782878

28792879
if (get_user(pin, (__u32 __user *)arg))
28802880
return -EFAULT;

0 commit comments

Comments
 (0)