From: Gao Xiang Date: Tue, 11 Aug 2020 07:00:20 +0000 (+0800) Subject: erofs: avoid duplicated permission check for "trusted." xattrs X-Git-Tag: v5.9.3~23 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=592927087b154a69ea60dced33a3e8a668cf8fc4;p=users%2Fdwmw2%2Flinux.git 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 [ 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: # 5.4+ Link: https://lore.kernel.org/r/20200811070020.6339-1-hsiangkao@redhat.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index c8c381eadcd60..5bde77d708524 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;