Skip to contentSkip to conversation

f2fs: avoid duplicated permission check for "trusted." xattrs

PATCH In review Hyunchul Lee 2 participants 2 messages Jul 19, 2018 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: avoid duplicated permission check for "trusted." xattrs

From: Hyunchul Lee <[email protected]>

Because xattr_permission already checks CAP_SYS_ADMIN capability, we don't need to check it.

---
 fs/f2fs/xattr.c | 6 ------
 1 file changed, 6 deletions(-)
fs/f2fs/xattr.c +0 -6
index 708271871f94..4b34244dcc69 100644
@@ -37,9 +37,6 @@ static int f2fs_xattr_generic_get(const struct xattr_handler *handler,
 			return -EOPNOTSUPP;
 		break;
 	case F2FS_XATTR_INDEX_TRUSTED:
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
-		break;
 	case F2FS_XATTR_INDEX_SECURITY:
 		break;
 	default:
@@ -62,9 +59,6 @@ static int f2fs_xattr_generic_set(const struct xattr_handler *handler,
 			return -EOPNOTSUPP;
 		break;
 	case F2FS_XATTR_INDEX_TRUSTED:
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
-		break;
 	case F2FS_XATTR_INDEX_SECURITY:
 		break;
 	default:
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Hyunchul Lee

From: Hyunchul Lee <[email protected]>

Because xattr_permission already checks CAP_SYS_ADMIN capability, we don't need to check it.

Thanks,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot