Skip to contentSkip to conversation

f2fs: set pin_file under CAP_SYS_ADMIN

PATCH In review Jaegeuk Kim 2 participants 2 messages Mar 13, 2019 – Mar 14, 2019 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 fs/f2fs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/file.c +2 -2
index 807a97ad2430..012815d816e6 100644
@@ -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;
Signature · 1 line
2.19.0.605.g01d371f741-goog