Re: [PATCH v2] ext4: Fix possible use-after-free in ext4_find_extent

From: Eric Biggers
Date: Fri Dec 30 2022 - 15:07:30 EST


On Fri, Dec 30, 2022 at 01:42:45PM +0200, Tudor Ambarus wrote:
>
> Seems that __ext4_iget() is not called on writes.

It is called when the inode is first accessed. Usually that's when the file is
opened.

So the question is why didn't it validate the inode's extent header, or
alternatively how did the inode's extent header get corrupted afterwards.

> You can find below the sequence of calls that leads to the bug.

A stack trace is not a reproducer. Things must have happened before that point.

- Eric