From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E44C6FCD0B4 for ; Wed, 18 Mar 2026 06:08:21 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fbJKc35d4z2xYk; Wed, 18 Mar 2026 17:08:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773814100; cv=none; b=RTzb7ZXXQrwoxYMAbM97KCoyShdw3caEGJSDe1OgGXJl3c70OgQTSi8cCyGf0ehutvtxNtee+lRe5Tqk076frHwDMAiRB/F8kVAIcRC7/5NTTkO9Kcts8ed/RO068+r4SJE+b1TVyFD1TTsFvhfJdVTiKtFSyyAWTDdSkoWmsuBe02pF6XLKE5kBkzyO2SD/2AcIWykXVtqk/E5WVOLfnlii4hFB9tHpFqJZy/s1tcYuM82+DjZakxIZHsYCXFnnNDTP7wnR7DFnP1JFSUK+4I9ZyAyhSAiPTUq9ZP/E1jCQyk+edWie+IisOYPKyLedQEvYZKMoSXlly+LoasM+YQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773814100; c=relaxed/relaxed; bh=81iU4GxYFjYy2wsoXiDzJqAgWFbrdp72/QRnLAtntXg=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=Kj/LUsIXDtbRHk3el6XuGLFv+p/ej3blW8CzpAYG8HxRwiAPII0/bWJG/Sf6T2IZ4ASBLC9gkRxcHNlRkASTP2kKb86KAmvk9l+rpIa2jrcIaxPMyQ5nk4dGG37V2LZdwAtCEglD+BYdj1DbXC2yYz3xXMwJEPS68twilRIiGiNg24wyRztIH0mg8DsVGmUa1JXkfBN+OhNVzpEBRF1pK1xxl8VZ5y/51VfDHc1h63ulrXSNxxOoeVQX+eZEpPA99O8DkMwhWek29unlvaPTk+/D86AVt3KU6cDl6aZ6iHIpPuncQ96RCdTMEnTv4bOoBViG2WhaFtVxZMBHx9v1kQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uN8CxQJB; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=chao@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uN8CxQJB; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=chao@kernel.org; receiver=lists.ozlabs.org) Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fbJKb64HGz2xQB for ; Wed, 18 Mar 2026 17:08:19 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id E8370600C4; Wed, 18 Mar 2026 06:08:17 +0000 (UTC) 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 X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , List-Unsubscribe: Precedence: list 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,