From patchwork Sat Oct 31 03:00:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gao Xiang X-Patchwork-Id: 317437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 066F3C00A89 for ; Sat, 31 Oct 2020 03:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B77AB22245 for ; Sat, 31 Oct 2020 03:01:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=aol.com header.i=@aol.com header.b="q+paeUcz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbgJaDBZ (ORCPT ); Fri, 30 Oct 2020 23:01:25 -0400 Received: from sonic307-8.consmr.mail.gq1.yahoo.com ([98.137.64.32]:38433 "EHLO sonic307-8.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbgJaDBY (ORCPT ); Fri, 30 Oct 2020 23:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1604113283; bh=FeHupOjDLgTuh+cfBealVPpt32jZjy4W4SnCc6bzdVk=; h=From:To:Cc:Subject:Date:References:From:Subject; b=q+paeU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SxHCiKNqIyTre8qOdLCMMl8Nk6eUP.POIbxuUm jbjJ0xBLt3KbBf5oOqyJEM3qr7gW9wmfOspdoIULQtcvjNO9.blgcfXD8hOHgAKqzzGAzqet3oQK 37696Gabf8dgVnIeMkFtF8KcoyzThEFIIo3QE_M3r6csBqubNOMbNZqXjXnAZPrAp9tlRvpGTvbQ _sdZ6wmwVUzkJ0cGIK7wCZx0yDolyHRdpywTcyh6qZOdQtx2SWOyGqYhndcKbplAwkw1C2BTaY2y HVOcc7k8gH9i8F3CDbzFsAkYpHMMgW8jweT3mXtAD3oFV85eCQenTIeBsS50HVnfAGEB1gBnT7nq StXKxCAKPxjMyGnSf_enVg9NZ1SZ74DnYAMcJV5DqVS8JphyDol9LLpGr62MpctJcsIUQoy0gVTv 7ljI5gzi_DsaQLPbolALnEGKLPEanwtgk0CffYTXR_dQaePURSJi5ew1IrW9o8d01CreiRNA73cE GFfNJU6J.qIYCczgaZo4yUwtjg1mkwnjftPi41QQ0pLj33RdgZjAXaCgLfoGwIbUrQPgcZl05gi1 3InLGWJvaAxwKipV_PRywWUJ2XBDin8PwO8kdFI2xoB78ZdARLUD8IQ_mlRpEyXKapxjQblxYAjP ad7VuEXMR4X2_3q0VEiU0UeSeIlvRRv1BiK5XmCsjPG8u Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sat, 31 Oct 2020 03:01:23 +0000 Received: by smtp406.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8d93c36968a2c06b61e7cf2a8cfe1ffd; Sat, 31 Oct 2020 03:01:16 +0000 (UTC) From: Gao Xiang To: Greg Kroah-Hartman , stable@vger.kernel.org Cc: linux-erofs@lists.ozlabs.org, LKML , Gao Xiang , Hongyu Jin , Chao Yu Subject: [PATCH 5.8.y] erofs: avoid duplicated permission check for "trusted." xattrs Date: Sat, 31 Oct 2020 11:00:58 +0800 Message-Id: <20201031030058.850-1-hsiangkao@aol.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 References: <20201031030058.850-1-hsiangkao.ref@aol.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gao Xiang 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 --- fs/erofs/xattr.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c index 87e437e7b34f..f86e3247febc 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;