From: Deepanshu Kartikey <kartikey406@gmail.com>
To: yi.zhang@huaweicloud.com
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: validate extent entries before caching in ext4_find_extent()
Date: Mon, 29 Sep 2025 10:57:18 +0530 [thread overview]
Message-ID: <20250929052718.334986-1-kartikey406@gmail.com> (raw)
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.
next reply other threads:[~2025-09-29 5:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 5:27 Deepanshu Kartikey [this message]
2025-09-29 12:07 ` Zhang Yi
-- strict thread matches above, loose matches on Subject: below --
2025-09-29 15:45 Deepanshu Kartikey
2025-09-29 14:00 Deepanshu Kartikey
2025-09-29 5:23 Deepanshu Kartikey
2025-09-28 10:09 Deepanshu Kartikey
2025-09-29 2:01 ` Zhang Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250929052718.334986-1-kartikey406@gmail.com \
--to=kartikey406@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=yi.zhang@huaweicloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®