Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2887134rwb; Mon, 15 Aug 2022 13:20:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR52bIv9+5afJJtNWbrF1+7Uhos9kwSoTZcmIZVCBkhmp4PS/0W/S1wlqzWHedV1ljYanpkO X-Received: by 2002:aa7:ccc4:0:b0:43d:9e0e:b7ff with SMTP id y4-20020aa7ccc4000000b0043d9e0eb7ffmr16374656edt.14.1660594802752; Mon, 15 Aug 2022 13:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594802; cv=none; d=google.com; s=arc-20160816; b=ylSKy8qEGydw6RIfoZNje4xIWfq+DDYME7HCz+D6kqrWB97npLMd0FQzReGWozJC6d ifLG3AULds5Iuvj+4aZRimZ4tv53bO9dRLGbgCKdn4MnU9kr6bNU7Oct/Rr/p2vm+Xqp OzFvLLlOihTJ2E+i4f8Q7sxA+q+jDApOXDUxvmoz1STFuyxDTjnYzbTMMCGpV998eThr zTkRKMr/eaJEefE+WZsmH9AloEZc4p9Jk8fzWQmLJDIHub7FgVB7CmMMm506+RwzBzsW GWfXEiZO0FF0UNnVywikiBUtCbtnWNCU6RSiuPjCVW40gbbUo6yM4Pbfl/DipLCWBISk E+Ew== 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=V6+jTnnTB6MmmFv2UmLfQSfyKTfQr1HL3xLF91BSTss=; b=SjSRlYFiYm4N2ZeP9NrVVHAUKtbpdcOg2aEhvf65sWSfU1XDKeUd/pSBUdYhkUz0Yy Mqm0Vp2BnnT1mESroH8gy+x2ALXRfIdCwJxVyA9F7pHcAiLnOJZGgiMk8D5kq3ENR1iN dO2fK1fIyt/kYr3AIHYJ/P+AcPd5iJMRLYOPy6PITMSxAMxD7xjDWmLRvhRAQJ/GZKJV FB/ojdFdy/PqeVgcLPPcjRWJcPiI3K5vHVSOEgTUlp5Jb/hGI4QronPfZDaliGz0exR/ zPSb2Y38tI22CG8wRAI8+2MGfQ0PqHix/6hRt2t3QlDeJhVjwi1/Qv1tQe9ZmL6p2GZE rglQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HG9d90tE; 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 hz5-20020a1709072ce500b00730ed690a72si9927009ejc.630.2022.08.15.13.19.34; Mon, 15 Aug 2022 13:20:02 -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=HG9d90tE; 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 S1345495AbiHOT5s (ORCPT + 99 others); Mon, 15 Aug 2022 15:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344837AbiHOTyU (ORCPT ); Mon, 15 Aug 2022 15:54:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83CF146DAB; Mon, 15 Aug 2022 11:52:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id E5ADEB810A1; Mon, 15 Aug 2022 18:52:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 464E1C433D6; Mon, 15 Aug 2022 18:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589525; bh=0KD7QWSgaLCh+FTKLs8Nuov2UeaSqaFCWzUcFIzW7MY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HG9d90tEWjCXpX9RZRNQ4abvldWMAEIE3a5fISfwwpHEt/mLYByu+7tShsZWVXTV2 wwMqO5oABXHegYbBZ/tqezklTWcTdCOTPInm2Xf9Y3qY2D3Yz57Y6fcLclMMxoZQUL Mi8DMbuy23XRA6kutiv5wHp6t+tYeOe5qkXyD2N4= 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.15 746/779] ext4: correct the misjudgment in ext4_iget_extra_inode Date: Mon, 15 Aug 2022 20:06:30 +0200 Message-Id: <20220815180409.361550591@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 149377c849ee..f95c73defe05 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4516,8 +4516,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