From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1605C3F23DD for ; Tue, 17 Mar 2026 16:48:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773766138; cv=none; b=IqbYiGF32V8azcrcc762mGufYqeP3J548vEfgYvbYLkZXzMYlaMZEbKgUpCRN1zWwoHMJJpFmf5JdpmOOqoe3BgNbl4t4g2K851GilMmw0YT/S7MFODcW5CtA55sU3viUvlMnNQOqc23r8Lzmc7gLs9wQx2HDvPzvMuSig9AEto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773766138; c=relaxed/simple; bh=nXLfEz81Gf3gYHnAYQWj5VS95cn73nUWk/srtCPnV5M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HmBRbQ2Vilt3wpzkdiwJ/j6/M6/RjSvgH70cdNcuQRa6wtn6yj7mWT6n5enGtkZ2zN9DmqXFrsCypc5vI5x7V5Tv2DvvsMqRrph6o2FklvruvDx4KEPX41DLv18LqMROSozgYAqomPG7m/wYHPktYTyOm82ooUryev4afzBGX8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ClYjRaf9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ClYjRaf9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A40EC4CEF7; Tue, 17 Mar 2026 16:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773766137; bh=nXLfEz81Gf3gYHnAYQWj5VS95cn73nUWk/srtCPnV5M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ClYjRaf9Tqp2gbPoOm3ec+iKWyWhA2GTl+nKOG5EpG7t+dopPPIrRUHHxtWchq41o 601+QbKX+9EuKUJacDq7N5j3wLcG3XTDc8QiGm/4hzqVJLGlmm/qcV/Ub/R2QIc/Yv XMd5oaaW/Y/ts/BtJ5szxcjqccnJPPf8B7liQY0Y9jpQjU0Qex5yffM2OB1iaNZyFr tv96ooSemOPojNOGFi8BtQrv+WIEPWZYh9F4zOZQjt9Q6w7JqE7hs484xH5H7yQ+ii cwoX4LOeFjJ7WH0YQX1z4Y8MaWElroR8BZv9YP+7SrXL/3SwgmZBSWLL3qb9nq4IP3 u1HIOn6rFvWmw== Date: Wed, 18 Mar 2026 00:48:52 +0800 From: Gao Xiang To: Utkal Singh Cc: linux-erofs@lists.ozlabs.org, xiang@kernel.org, yifan.yfzhao@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] erofs: validate h_shared_count in erofs_init_inode_xattrs() Message-ID: Mail-Followup-To: Utkal Singh , linux-erofs@lists.ozlabs.org, xiang@kernel.org, yifan.yfzhao@linux.dev, linux-kernel@vger.kernel.org References: <20260317152439.5738-1-singhutkal015@gmail.com> <20260317164135.24892-1-singhutkal015@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260317164135.24892-1-singhutkal015@gmail.com> On Tue, Mar 17, 2026 at 04:41:35PM +0000, Utkal Singh wrote: > A crafted image can set h_shared_count to a value much larger than > what xattr_isize allows. The loop in erofs_init_inode_xattrs() then > reads shared xattr IDs far beyond the inode's xattr region, causing > an out-of-bounds metadata read. > > Add a sanity check ensuring: > > h_shared_count <= (xattr_isize - sizeof(erofs_xattr_ibody_header)) / 4 > > Return -EFSCORRUPTED when the check fails. > > Signed-off-by: Utkal Singh What happens with your v3? What happens with the commit message and the division? Could you explain what happened? Thanks, Gao Xiang