From: "Theodore Ts'o" <tytso@mit.edu>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, joneslee@google.com,
syzbot+0827b4b52b5ebf65f219@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2] ext4: Fix possible use-after-free in ext4_find_extent
Date: Fri, 30 Dec 2022 15:22:00 -0500 [thread overview]
Message-ID: <Y69IaMqZvnGk5skX@mit.edu> (raw)
In-Reply-To: <cf1be149-392d-afa0-092a-c3426868f852@linaro.org>
On Fri, Dec 30, 2022 at 01:42:45PM +0200, Tudor Ambarus wrote:
> > This is (incompletely) validating the extent header in the inode. Isn't that
> > supposed to happen when the inode is loaded? See how __ext4_iget() calls
> > ext4_ext_check_inode(). Why isn't that working here?
> >
>
> Seems that __ext4_iget() is not called on writes. You can find below the
> sequence of calls that leads to the bug. The debug was done on v6.2-rc1.
> I assume the extents check is no longer done on writes since
> commit 7a262f7c69163cd4811f2f838faef5c5b18439c9. The commit doesn't
> specify the reason though.
Commit 7a262f7c6916 no longer does the check if the inode is already
in memory (which is the case when there is an open file descriptor).
That's because it should have been checked when it was first read into
memory.
So the the question is, did the inode get corrupted somehow after it
was read in from disk? If so that's the real problem, and that's what
needs to be root caused and fixed. It's not sufficient to just to
make the syzbot reproducer only longer reproduce. The question is
understanding what is fundamentally going on and fixing the real root
problem.
Regards,
- Ted
prev parent reply other threads:[~2022-12-30 20:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-30 6:29 [PATCH v2] ext4: Fix possible use-after-free in ext4_find_extent Tudor Ambarus
2022-12-30 6:56 ` Eric Biggers
2022-12-30 11:42 ` Tudor Ambarus
2022-12-30 20:07 ` Eric Biggers
2023-01-02 5:41 ` Tudor Ambarus
2022-12-30 20:22 ` Theodore Ts'o [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=Y69IaMqZvnGk5skX@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=ebiggers@kernel.org \
--cc=joneslee@google.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+0827b4b52b5ebf65f219@syzkaller.appspotmail.com \
--cc=tudor.ambarus@linaro.org \
/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