public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shigeru Yoshida <syoshida@redhat.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzbot+bf4bb7731ef73b83a3b4@syzkaller.appspotmail.com
Subject: Re: [PATCH] ext4: Verify extent header in ext4_find_extent()
Date: Tue, 3 Jan 2023 17:33:48 +0000	[thread overview]
Message-ID: <Y7Rm/AOlmaGp0JaL@kernel-devel> (raw)
In-Reply-To: <Y7NkW86aVcksg3i9@sol.localdomain>

On Mon, Jan 02, 2023 at 03:10:19PM -0800, Eric Biggers wrote:
> On Mon, Jan 02, 2023 at 02:58:33PM +0000, Shigeru Yoshida wrote:
> > syzbot reported use-after-free in ext4_find_extent() [1].  If there is
> > a corrupted file system, this can cause invalid memory access.
> > 
> > This patch fixes the issue by verifying extent header.
> > 
> > Reported-by: syzbot+bf4bb7731ef73b83a3b4@syzkaller.appspotmail.com
> > Link: https://syzkaller.appspot.com/bug?id=cd95cb722bfa1234ac4c78345c8953ee2e7170d0 [1]
> > Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
> > ---
> >  fs/ext4/extents.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> > index 9de1c9d1a13d..79bfa583ab1d 100644
> > --- a/fs/ext4/extents.c
> > +++ b/fs/ext4/extents.c
> > @@ -901,6 +901,9 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,
> >  		ret = -EFSCORRUPTED;
> >  		goto err;
> >  	}
> > +	ret = ext4_ext_check(inode, eh, depth, 0);
> > +	if (ret)
> > +		goto err;
> 
> This patch probably does not address the root cause of the problem.  Please see
> the discussion on the very similar patch
> https://lore.kernel.org/linux-ext4/20221230062931.2344157-1-tudor.ambarus@linaro.org/T/#u

Thank you so much for your comment!!  I missed the discussion you
mentioned.  I'll check that.

Regards,
Shigeru

> 
> - Eric
> 


      reply	other threads:[~2023-01-03 17:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 14:58 [PATCH] ext4: Verify extent header in ext4_find_extent() Shigeru Yoshida
2023-01-02 23:10 ` Eric Biggers
2023-01-03 17:33   ` Shigeru Yoshida [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=Y7Rm/AOlmaGp0JaL@kernel-devel \
    --to=syoshida@redhat.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=ebiggers@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+bf4bb7731ef73b83a3b4@syzkaller.appspotmail.com \
    --cc=tytso@mit.edu \
    /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