[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241029205506.GR31418@twin.jikos.cz>
Date: Tue, 29 Oct 2024 21:55:06 +0100
From: David Sterba <dsterba@...e.cz>
To: Qu Wenruo <quwenruo.btrfs@....com>
Cc: dsterba@...e.cz, Edward Adam Davis <eadavis@...com>,
syzbot+5d2b33d7835870519b5f@...kaller.appspotmail.com, clm@...com,
dsterba@...e.com, josef@...icpanda.com, linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] btrfs: add a sanity check for csum root before fill the
data csum
On Sat, Oct 26, 2024 at 07:45:18AM +1030, Qu Wenruo wrote:
>
>
> 在 2024/10/26 05:14, David Sterba 写道:
> > On Wed, Oct 23, 2024 at 07:04:40PM +0800, Edward Adam Davis wrote:
> >> Syzbot reported a null-ptr-deref in btrfs_lookup_csums_bitmap.
> >> The btrfs info contains IGNOREDATACSUMS, which prevents the csum root from
> >> being loaded.
> >> Before filling in the csum data, check the flag BTRFS_FS_STATE_NO_DATA_CSUMS
> >> to confirm that the csum root has been loaded.
> >>
> >> Reported-and-tested-by: syzbot+5d2b33d7835870519b5f@...kaller.appspotmail.com
> >> Closes: https://syzkaller.appspot.com/bug?extid=5d2b33d7835870519b5f
> >> Signed-off-by: Edward Adam Davis <eadavis@...com>
> >
> > Added to for-next, thanks.
>
> Wait for a second, I believe LiZhi Xu's solution is better.
>
> And sorry I didn't notice that until his patch is submitted.
>
> The problem for this fix is, although it fixes the crash, it also gives
> a false feel of safety that scrub is finding nothing wrong.
>
> But the truth is, there is no csum root, and everything can go wrong.
>
> Thus I'd prefer LiZhi's solution which error out and terminate the scrub
> immediately.
Ok, I've dropped this patch from for-next. Please add "btrfs: add a
sanity check for btrfs root".
Powered by blists - more mailing lists