mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Filipe Manana <fdmanana@kernel.org>
Cc: Edward Adam Davis <eadavis@qq.com>,
	syzbot+c3a3a153f0190dca5be9@syzkaller.appspotmail.com,
	clm@fb.com, dsterba@suse.com, josef@toxicpanda.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH next] btrfs: Accessing head_ref within delayed_refs lock
Date: Tue, 15 Oct 2024 18:38:28 +0200	[thread overview]
Message-ID: <20241015163828.GK1609@twin.jikos.cz> (raw)
In-Reply-To: <CAL3q7H7D=uNsvgKwBcK+jtNXayDYPLO=ZowWyjjaeYK27ZgirQ@mail.gmail.com>

On Tue, Oct 15, 2024 at 01:49:04PM +0100, Filipe Manana wrote:
> On Tue, Oct 15, 2024 at 1:40 PM Edward Adam Davis <eadavis@qq.com> wrote:
> >
> > This is because the thread routine btrfs_work_helper released head_def after
> > exiting delayed_refs->lock in add_delayed_ref.
> 
> This should be explained a lot better. Starting the changelog with
> "This is because..." is odd. It should explain why the head reference
> was freed (because delayed references were run).
> 
> > Causing add_delayed_ref to encounter uaf when accessing head_def->bytenr
> > outside the delayed_refs->lock.
> >
> > Move head_ref->bytenr into the protection range of delayed_refs->lock
> > to avoid uaf in add_delayed_ref.
> 
> 
> This was already fixed yesterday, in a simpler way and with an
> explanation of what's going on to trigger the use-after-free:
> 
> https://lore.kernel.org/linux-btrfs/02fc507b62b19be2348fc08de8b13bd7af1a440e.1728922973.git.fdmanana@suse.com/

This will be in the upcoming linux-next, so we'll not get the syzbot and
build reports anymore.

      reply	other threads:[~2024-10-15 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 15:56 [syzbot] [btrfs?] KASAN: slab-use-after-free Read in add_delayed_ref syzbot
2024-10-14 17:34 ` syzbot
2024-10-15  9:55 ` Edward Adam Davis
2024-10-15 10:15   ` [syzbot] " syzbot
2024-10-15 10:49 ` Edward Adam Davis
2024-10-15 11:14   ` [syzbot] " syzbot
2024-10-15 12:26 ` [PATCH next] btrfs: Accessing head_ref within delayed_refs lock Edward Adam Davis
2024-10-15 12:49   ` Filipe Manana
2024-10-15 16:38     ` David Sterba [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=20241015163828.GK1609@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=eadavis@qq.com \
    --cc=fdmanana@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+c3a3a153f0190dca5be9@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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

all inboxes | Powered by JetHome®