Skip to contentSkip to conversation

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

PATCH New Gao Xiang 1 participant 1 message Oct 31, 2020 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Gao Xiang

author
#1 lore raw

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

From: Gao Xiang <[email protected]>

commit d578b46db69d125a654f509bdc9091d84e924dc8 upstream.

Don't recheck it since xattr_permission() already
checks CAP_SYS_ADMIN capability.

Just follow 5d3ce4f70172 ("f2fs: avoid duplicated permission check for "trusted." xattrs")

[ Gao Xiang: since it could cause some complex Android overlay
permission issue as well on android-5.4+, it'd be better to backport to 5.4+ rather than pure cleanup on mainline. ]

---
 fs/erofs/xattr.c | 2 --
 1 file changed, 2 deletions(-)
fs/erofs/xattr.c +0 -2
index b766c3ee5fa8..503bea20cde2 100644
@@ -473,8 +473,6 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler,
 			return -EOPNOTSUPP;
 		break;
 	case EROFS_XATTR_INDEX_TRUSTED:
-		if (!capable(CAP_SYS_ADMIN))
-			return -EPERM;
 		break;
 	case EROFS_XATTR_INDEX_SECURITY:
 		break;
Signature · 1 line
2.24.0