From: Junjie Cao <junjie.cao@intel.com>
To: Jan Kara <jack@suse.cz>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
libaokun@linux.alibaba.com, ojaswin@linux.ibm.com,
ritesh.list@gmail.com, yi.zhang@huawei.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org,
syzbot+26c4a8cab92d0cda3e3b@syzkaller.appspotmail.com,
junjie.cao@intel.com
Subject: Re: [PATCH] ext4: prevent out-of-bounds read in ext4_read_inline_data()
Date: Fri, 24 Apr 2026 01:05:26 +0800 [thread overview]
Message-ID: <20260423170527.129423-1-junjie.cao@intel.com> (raw)
In-Reply-To: <ulfo7ut5ziqvrjy24besb4jtobijunycglvmqki7cwfzsancwi@5ycrwypubh56>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1021 bytes --]
Thanks for the review, Jan.
You're right that v1 failed to identify why the buffer changes. I dug
into the syzbot reproducer — the corruption path is:
1. Mount a crafted ext4 image on a loop device
2. Bind-mount the loop device, open + mmap it MAP_SHARED|PROT_WRITE
3. Write through the mapping — this overwrites the inline xattr
entry directly in the bdev page cache
The inode buffer_head stays uptodate throughout, so no re-validation
ever triggers — xattr_check_inode() at iget time is thorough but only
runs once, leaving subsequent in-place corruption of the page cache
undetected.
However, ext4_xattr_ibody_get() already guards against this with a
bounds check before its memcpy (xattr.c:674). ext4_read_inline_data()
lacks the same check because it indexes via the cached i_inline_off,
bypassing xattr_find_entry() entirely. I think aligning the two paths
is worthwhile, and it would also clear this syzbot report.
Would a v2 with this framing be acceptable to you?
Many thanks,
Junjie
next prev parent reply other threads:[~2026-04-23 9:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 9:31 [PATCH] ext4: prevent out-of-bounds read in ext4_read_inline_data() Junjie Cao
2026-04-21 10:04 ` Jan Kara
2026-04-23 17:05 ` Junjie Cao [this message]
2026-04-23 9:46 ` Jan Kara
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=20260423170527.129423-1-junjie.cao@intel.com \
--to=junjie.cao@intel.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=stable@vger.kernel.org \
--cc=syzbot+26c4a8cab92d0cda3e3b@syzkaller.appspotmail.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.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