Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp199200pxa; Tue, 11 Aug 2020 00:04:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxYZfw3UmXJGLn1F5eNXVyHvwA2+Sk8f68pjVI6Yy/X69WNatIe2bapcOAaka4zF+i+eXS X-Received: by 2002:a17:906:528d:: with SMTP id c13mr25757669ejm.61.1597129490147; Tue, 11 Aug 2020 00:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597129490; cv=none; d=google.com; s=arc-20160816; b=xKMNj7uPOoUFGU2nknWzw9LK0qwQxs9rIFPxkj9RFlyhV+55lFcg6mIbsKbeceYSD0 ieLl/geukqcrKXYd13k6SfarJYaNqPap4GpqI3nHIJRjxHEMvydFC3vQhgqI4UZEgetZ rRWY2Vjue90PBSWhYy4aCA03FmB1eJecrnxegbGrTth3b5BbgX1hZFs2ooSr7kGVifIQ AFSAVtVHnTkjpFkRYpEkLMFYnghqUzsd5El+mwiLHNJQy3ODQ2lmWw5i5KPYdn93RbTj 0s/F+KkT1M34lUtEeSyT5Z6bI0BOPd7XyRZF+/QPIOLcAR1UXBjoURiK4eCVQKGT26v9 vLiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=TEG2fDTMrT9CyNXx3j58WMIBzVoaSf9PoptkoEoE8fA=; b=ibBOcD74pBqSwAp0rvzW5jWYYytN8QmTwr0J9Efp3UXrNnp7WLt4u6vf8WiKkmOWue 8LrZ6lqwPRkWHmhYyDpalPXL418eXnXa4kvFry17aetvpfMst+VAUkQmEtNfZe7qjqLD mdOYwa+dDQDsvAlot80dfv59E6sqYU2rPdmXFnOVspjqKBIUXogJ1EzMqZ4pvn2sRxKX sdAOVfFaYaERP9HnUuJS7Ga8lneO8QLFCP18LA9kCc9r4YBPHxu1xAqQkurS0Kide9LC zSo0psaulaTzLTak3dLFd7lisSq6LZLpKfbm4XhU/shPIN7FW6Fq7EFqerzYrsQybf1R 5hFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fxy7bKRc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si9866862edy.553.2020.08.11.00.04.27; Tue, 11 Aug 2020 00:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fxy7bKRc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728368AbgHKHBY (ORCPT + 99 others); Tue, 11 Aug 2020 03:01:24 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:55145 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728142AbgHKHBT (ORCPT ); Tue, 11 Aug 2020 03:01:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597129278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=TEG2fDTMrT9CyNXx3j58WMIBzVoaSf9PoptkoEoE8fA=; b=fxy7bKRch+AtDqFCDMFZw1TB1p0a+nGTBvCV1OQ9SXj2DBjXBIFBCS708hpH9nSkmtEbcu 8vOk7GnYvBI3AtAW2qz7QXI1vGF1r/nNo8ooyywgCpnm4/8l8lGP09Z/xTQX7mNuIEWioQ 4cLRnhTOqBCV6Mq2/pWfJmgO2XtQ9LE= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-Gag3b5agPze19uFDepiZGw-1; Tue, 11 Aug 2020 03:01:14 -0400 X-MC-Unique: Gag3b5agPze19uFDepiZGw-1 Received: by mail-pl1-f198.google.com with SMTP id b11so8420671plx.21 for ; Tue, 11 Aug 2020 00:01:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TEG2fDTMrT9CyNXx3j58WMIBzVoaSf9PoptkoEoE8fA=; b=uLgt6XawWonTMt74uUtf/O4XOrBrwCJ8LlnS1SJEpY2yEpHGtjpCejX6euj9PbHryi wCAzmQMvwLPpdzu4DOzBAnWUdmTX4y+gIehyE2NHRvqRlaEAdc3NsNbyrvCEypAwPm5G tT+iZyMiN5uGWQWjwhqRSUmz1hM6L3OwnN/oxlL2gqfC2H4SAJ/lcH+hi1tHZEDqBYk8 EqPIAdH1lyO+PrY/8AG4ZIUbPxc7SO0Pk/eeoWtAf/Sh5CuYWh4WeoKW1oPg27jow2JW jAdYcrAnOtL3FfJm1xhHz3DDYWspFAp5RCnWIqOe9CeSPSISTwHKVVc18QCuKeSGSQ5f IsAA== X-Gm-Message-State: AOAM530QLVVqBX6eTWosH2GehsnaE7ZDOtz0z8Dt3BLi06uvSCCVBdbp qlg2RWb/REwMZ4jexvtcK0LEXI8WGRs1kw7OI/Sjk85DDRdMXp7smjmEJokac5xY14ik4ObVn8W QAubSmsqPZZzwdS1Abr/7eb8S X-Received: by 2002:a17:902:b417:: with SMTP id x23mr25968237plr.231.1597129273223; Tue, 11 Aug 2020 00:01:13 -0700 (PDT) X-Received: by 2002:a17:902:b417:: with SMTP id x23mr25968217plr.231.1597129272976; Tue, 11 Aug 2020 00:01:12 -0700 (PDT) Received: from xiangao.remote.csb ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id y19sm24098541pfn.77.2020.08.11.00.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 00:01:12 -0700 (PDT) From: Gao Xiang To: linux-erofs@lists.ozlabs.org, Chao Yu Cc: LKML , Chao Yu , Hongyu Jin , Gao Xiang , stable@vger.kernel.org Subject: [PATCH] erofs: avoid duplicated permission check for "trusted." xattrs Date: Tue, 11 Aug 2020 15:00:20 +0800 Message-Id: <20200811070020.6339-1-hsiangkao@redhat.com> X-Mailer: git-send-email 2.18.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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+, so it'd be better to backport to 5.4+ rather than pure cleanup on mainline. ] Cc: # 5.4+ Signed-off-by: Gao Xiang --- related commit: https://android-review.googlesource.com/c/kernel/common/+/1121623/6/fs/xattr.c#b284 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; -- 2.18.1