summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-08-11 15:00:20 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-01 12:01:04 +0100
commit95daf621291c1203d9d2cebb119d0cd2d53898f9 (patch)
treed0b3e578558cb187ca0b75e5530175269429af78 /fs
parentb8321829036ff93e98de67eb6391e4aa6cccfef8 (diff)
erofs: avoid duplicated permission check for "trusted." xattrs
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") Reported-by: Hongyu Jin <hongyu.jin@unisoc.com> [ 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. ] Cc: <stable@vger.kernel.org> # 5.4+ Link: https://lore.kernel.org/r/20200811070020.6339-1-hsiangkao@redhat.com Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Gao Xiang <hsiangkao@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/erofs/xattr.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c
index b766c3ee5fa8..503bea20cde2 100644
--- a/fs/erofs/xattr.c
+++ b/fs/erofs/xattr.c
@@ -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;