Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3261559rwb; Mon, 15 Aug 2022 22:36:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4r8bXIqJuly5s+1oyWmW788ES0IuEM8Uev+6mLNaIaPRtskUnNtIQnXpVTm/zsHf2mgfrB X-Received: by 2002:a05:6a00:234f:b0:525:1f7c:f2bf with SMTP id j15-20020a056a00234f00b005251f7cf2bfmr19875722pfj.14.1660628204226; Mon, 15 Aug 2022 22:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628204; cv=none; d=google.com; s=arc-20160816; b=btZm1vpMbQiUwvRXQ0cG/ujPuMJtIl+BQvNZVfFWNGnmubUTnk69+yc+9/h6QLPdVr 0CmDGIS3nAr44Ocmdiwg4gZdgZFKSs3HK06mzgIyh3v2tsf4RGMA0pxqGyekjUVfpPRv nJuD4b1ZSp2e9FV0ILadXSjXkL0o+1Mo2W+uNnpbr5XrSKxFs+PyDPtyPlhF5nsdM+Ig yEeJHazuKUhgiJ0YVnGblIB/OnF7yEhrtpxSz/uDtNn360pRw34xkDd8PKPzur21fgBp Egu2OLm4ncIPW8hAfccW3svDYU2oojTir0/CTK8JngOm0yy0anL94aUIn8XiHtwFPpn8 yp+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=78DdVGZJXV1EkPdxjT8z6OoQXr92WxgomGdbP245NOY=; b=mDLcTamgNbV9R8HRxnfSlJen7xzvZcIb93FU9qwcinScnH1pjQOi4SDNd7xpzfvxYu Nwpt5fruosvWf1VzZ1MEu3vzp5wUPORe+nmyYDMDjLzg7/Oqc2V4YhTHWCH/LpygxC3J by8uZXnQAOwgm1wfChD44vuynwjIRViDkcOPyNEgFthInerO0EWrNx7FA2Y7aFQmPmFq RLkemXVZW2p4TqCJVKA7nf8FJVw5Uza5YuaOKfGXr4Fm81IzmbDIDrokeQSOBj9pbtN5 3owu3O0dlioREEjpS6X68hvAIxPp25BnVbaqIfNl+1L4D629I7jz8ztzI0p2TT09M2u1 9WKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bEzBjMqg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a17090a404700b001f0fb79b75csi12993545pjg.81.2022.08.15.22.36.33; Mon, 15 Aug 2022 22:36:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bEzBjMqg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233502AbiHPE4l (ORCPT + 99 others); Tue, 16 Aug 2022 00:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234052AbiHPE4Q (ORCPT ); Tue, 16 Aug 2022 00:56:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5CED2B1C; Mon, 15 Aug 2022 13:51:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F1F1C61291; Mon, 15 Aug 2022 20:51:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF0E0C433C1; Mon, 15 Aug 2022 20:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596675; bh=OZJvAq8h4v8tCXwPfnrarqVhzBRJQTNstViF5kG+Flk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEzBjMqgtfPMvKa9+nRF/dixKGDeT3wJtp1l9qADgr2uJCNyywgZ7g2IKNNYcIL6K IzKsnp/KekppqwaLoUMOH3EpH69Sn/u9MHhsOr1wEt1VuTjwMktfDlShIMMhcA/Nnw X9ho8Vg6M7drgrI4Hkovkcc6hfKpaM2SDOiq/pGA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Baokun Li , "Ritesh Harjani (IBM)" , Jan Kara , Theodore Tso , Sasha Levin Subject: [PATCH 5.19 1122/1157] ext4: correct the misjudgment in ext4_iget_extra_inode Date: Mon, 15 Aug 2022 20:07:58 +0200 Message-Id: <20220815180525.229583663@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baokun Li [ Upstream commit fd7e672ea98b95b9d4c9dae316639f03c16a749d ] Use the EXT4_INODE_HAS_XATTR_SPACE macro to more accurately determine whether the inode have xattr space. Cc: stable@kernel.org Signed-off-by: Baokun Li Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220616021358.2504451-5-libaokun1@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0ccff6214fc8..2ad139d78574 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4692,8 +4692,7 @@ static inline int ext4_iget_extra_inode(struct inode *inode, __le32 *magic = (void *)raw_inode + EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize; - if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize + sizeof(__le32) <= - EXT4_INODE_SIZE(inode->i_sb) && + if (EXT4_INODE_HAS_XATTR_SPACE(inode) && *magic == cpu_to_le32(EXT4_XATTR_MAGIC)) { ext4_set_inode_state(inode, EXT4_STATE_XATTR); return ext4_find_inline_data_nolock(inode); -- 2.35.1