From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) (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 CC4DB30E0FB for ; Tue, 17 Mar 2026 16:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773763849; cv=none; b=qsdy776EeOXPhmFCOOj0H6VryJ+1ZSUlUTYxOGInp0PM308GZOYcH8MMEM8bAPeZbpwtl+oBGA0O5+Yr9uIJUsZkad8FfUg59USZAs6wafgkmd5miXo8OB7YTqGZtfueA8GP77mVEDv/wD1vr3XW9HFOEl/LoQ3DvVpLbgmw9qg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773763849; c=relaxed/simple; bh=3RC7GZSWLY5Z2INoy8PXYgaUGLzqJo2CWx3tw60yOwI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MAxdRAWE/WKF6f/gfebYnRb3LTJBbQP5AUNyAjs38EV+Wxu7Wf4qKZTSUmyAbG6YHqYGTU/xdkG2FWmcvwEhjLUz2U25nCZO+cjzwg/mx49CvJiYUKoz8dM9bb65IoA/ZDxIATax6fgG4eHHC0n5t2zZ51hDGbtxlGl1l1SB3/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=AaJAAW3N; arc=none smtp.client-ip=115.124.30.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="AaJAAW3N" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1773763844; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=yT9B7syCuF6JdXe7xjWZQufmR34xFJzO4znY8Ol0NDI=; b=AaJAAW3NH4+AXZhaLhZjvPz88V35MgdRqnoIV38+fijRGpk9BMeeQiqHJ5pM7Xr0FMDjW2FgqRiQ/SuImhuyDa3xFt0x9dk/7mECiCckzjD1hDFEN50gl9LOYrNA5reKs2TCw/kcDxMsnmN8P9tzcXzozt0WUBrky9Q3qfPK2Qw= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0X.BVdQe_1773763843; Received: from 30.170.14.2(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0X.BVdQe_1773763843 cluster:ay36) by smtp.aliyun-inc.com; Wed, 18 Mar 2026 00:10:43 +0800 Message-ID: <635b6c28-36d6-4301-9cb0-7f81745aebdf@linux.alibaba.com> Date: Wed, 18 Mar 2026 00:10:42 +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 Subject: Re: [PATCH v2] erofs: harden h_shared_count in erofs_init_inode_xattrs() To: Utkal Singh , linux-erofs@lists.ozlabs.org Cc: xiang@kernel.org, yifan.yfzhao@linux.dev, linux-kernel@vger.kernel.org References: <20260317152439.5738-1-singhutkal015@gmail.com> From: Gao Xiang 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: Gao Xiang Thanks, Gao Xiang