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 117263644A2 for ; Wed, 18 Mar 2026 06:08:17 +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=1773814098; cv=none; b=a6ORWWUSzw/a5PMqXcqfIk0tHUEqfceoqLAtiReQrY8kh8uoI7H1VXlck5a9icvjEKCdYmde3/106bl7xNymNfKLBKZVUMnCKKoLasj94V9R3Ra3AoOmlabY+2qeFPmjPXXrOrCIuAll6GYr3AC9NPYPheVQ4AgmwZR9D7HFphE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773814098; c=relaxed/simple; bh=QVqJ+ZgjVb432Bp9YL91Pp7BrnCufp1ZeUvDfJS+iGU=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=MlD/VNbYlfYUjKwERMwVsq7kPH6UyqqmW4P4TBtXwlRrdh3IwgPWJlpPq0qSnNGVHdrZjimW296QNkfSNl2DYTnL3V9snStbMUmuw4lt5t+MRWbAyWez5B4MK9eG9rjtfjpQl9A9smZMSmOAKtHsLgxSnAcuNGyWqcXcA+K5oDw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uN8CxQJB; 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="uN8CxQJB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25B2DC19421; Wed, 18 Mar 2026 06:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773814097; bh=QVqJ+ZgjVb432Bp9YL91Pp7BrnCufp1ZeUvDfJS+iGU=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=uN8CxQJB+z5DZbnUnA9JFDRYekiNfdTIKRHs4FYRQPk3mQMHqZ1IEyoJXP6nSwm54 oMcidtvta3iueIIkDanUgLI0qEtuAb1LoiPie3dwjW7EGs2TQ9RI8xPltLnqqevl5z pMMda8gM4t0TrIEphvKrsKHFS9m3hv011bNtze7eLyjtBPDjH0xWuHVsk566o/7goX aYOd492JQIjugq3KrjYWy2h5UpRoMySa6EcHRhLOdW/TVFN3RL/koV8TQLq4fSxt26 AH/P5lwHiNibC83POoeKinZTsk1PCKDJqJWHfGOhOKw0VODTxc38lzyj2HbM75SdRI s6Y8kLjBwoeOg== Message-ID: <7ac4676c-f68b-4cfd-9356-0f26f8215aed@kernel.org> Date: Wed, 18 Mar 2026 14:08:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, xiang@kernel.org, yifan.yfzhao@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] erofs: harden h_shared_count in erofs_init_inode_xattrs() To: Utkal Singh , linux-erofs@lists.ozlabs.org References: <20260317152439.5738-1-singhutkal015@gmail.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260317152439.5738-1-singhutkal015@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026/3/17 23:24, Utkal Singh wrote: > `u8 h_shared_count` indicates the shared xattr count of an inode. It is > read from the on-disk xattr ibody header, which should be corrupted if > the size of the shared xattr array exceeds the space available in > `xattr_isize`. > > It does not cause harmful consequence (e.g. crashes), since the image is > already considered corrupted, it indeed results in the silent processing > of garbage metadata. > > Let's harden it to report -EFSCORRUPTED earlier. > > Signed-off-by: Utkal Singh Reviewed-by: Chao Yu Thanks,