From: "Theodore Tso" <tytso@mit.edu>
To: ZhengYuan Huang <gality369@gmail.com>
Cc: adilger.kernel@dilger.ca, tahsin@google.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
baijiaju1990@gmail.com, r33s3n6@gmail.com, zzzccc427@gmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH] ext4: xattr: fix out-of-bounds access in ext4_xattr_set_entry
Date: Fri, 20 Mar 2026 08:32:22 -0400 [thread overview]
Message-ID: <20260320123222.GC14752@macsyma-wired.lan> (raw)
In-Reply-To: <CAOmEq9VAW_a7RsSPquy0_eJOLP4aHOWvwTtzmeLUPXpy85xJvw@mail.gmail.com>
On Fri, Mar 20, 2026 at 03:43:21PM +0800, ZhengYuan Huang wrote:
>
> There seem to be three layers of defense: fsck, mount-time checks, and
> runtime checks.
Within runtime checks, there are those checks that are done the first
time metadata is loaded from disk --- for example, see the checks in
__ext4_iget() and the functions it calls, such as check_igot_inode().
And then there are checks that are done in hotpaths, since at least in
theory, a stupid system administrator which makes a block device be
world-writeable and so a malicious or accidental actor could modify
the copy of the metadata in the buffer cache. Those are the ones
sorts of runtime checks we sould try to avoid.
Mount-time checks tend to be those that validate superblock and block
group descriptor contents. They can't validate all of the inodes
because that would take a lot longer.
> Would it be more accurate to understand the boundary
> this way: once the filesystem metadata has passed mount-time
> validation (even if it would not necessarily pass fsck), the
> filesystem is still expected to handle later errors gracefully rather
> than crash?
It is a nice to have that a file system, should handle errors
gracefully rather than crash. However, if the inconsistency would
have been caught and corrected by fsck, I don't consider it a
CVE-worthy security bug, but rather a quality-of-implementation bug.
This is important, because there are risks associated with rolling out
a new kernel to hundreds of thousands of machines, or using live
patching to fix high severity security bugs. If the issue could have
been caught by fsck, and a competently administered system *does* run
fsck at boot time (such as at $WORK), the cost benefit ratio of
treating such bugs as security bugs doesn't make sense.
> More specifically, for inconsistencies that arise at runtime, is the
> general expectation that they are outside the filesystem's
> responsibility and should instead be handled by other layers (for
> example, lower-level storage redundancy / RAID)? Or is there still
> room for defensive checks in the filesystem, as long as they are done
> outside hot paths?
This would be on a case by case basis. If the check is *super* cheap,
and it's done outside of a hotpath --- say, when a file is first
opened. And if doesn't cause long-term maintenance issues, it is
comething that could be considered. But in terms of the priority of
dealing with such patches, it is not something that would be
considered high priority. Perhaps just a step above spelling or
grammer fixes in comments. :-)
Consider that for a enterprise hard drives, the bit error rate is 1 in
10**15. And the chances that such as a bit error would be cause a
metadata inconsistency that would lead to a crash has to be factored
in. If we had infinite resources, it might be something that would be
considered higher priority, but in the real world, when the
opportunity cost of having software engineers working on other
improvements, it's not necessarily going to be a compelling business
case when I go to my management asking for more headcount. And if you
are an academic, perhaps the impact of such work might also be called
into question.
Cheers,
- Ted
prev parent reply other threads:[~2026-03-20 12:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 7:58 [PATCH] ext4: xattr: fix out-of-bounds access in ext4_xattr_set_entry ZhengYuan Huang
2026-03-18 8:09 ` Greg KH
2026-03-18 14:45 ` Theodore Tso
2026-03-19 11:13 ` ZhengYuan Huang
2026-03-19 13:58 ` Theodore Tso
2026-03-20 7:43 ` ZhengYuan Huang
2026-03-20 12:32 ` Theodore Tso [this message]
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=20260320123222.GC14752@macsyma-wired.lan \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=baijiaju1990@gmail.com \
--cc=gality369@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=r33s3n6@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tahsin@google.com \
--cc=zzzccc427@gmail.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