[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250929052718.334986-1-kartikey406@gmail.com>
Date: Mon, 29 Sep 2025 10:57:18 +0530
From: Deepanshu Kartikey <kartikey406@...il.com>
To: yi.zhang@...weicloud.com
Cc: tytso@....edu,
adilger.kernel@...ger.ca,
linux-ext4@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: validate extent entries before caching in ext4_find_extent()
Zhang Yi,
You're correct that ext4_ext_check_inode() should catch this. I investigated and found why it doesn't:
[ 18.824142] DEBUG: Validating inode 2 (no inline data)
[ 18.835777] DEBUG: verity inode 15, inline=0, extents=1
[ 18.836793] DEBUG: Skipping validation for inode 15 (has inline data)
The verity inode reports inline=0 when checking the flag directly, but ext4_has_inline_data() returns true at the validation check, causing validation to be skipped.
This corrupted filesystem has a verity file that somehow triggers the inline data check to return true, even though verity files should never have inline data. This allows the corrupted out-of-order extents to bypass validation.
My patch adds validation before caching extents, which catches such corruption regardless of why the inline data check fails. This provides necessary defense against corrupted filesystems at the point where extents are actually used.
Powered by blists - more mailing lists