Re: [syzbot] [btrfs?] KMSAN: uninit-value in ZSTD_compressBlock_doubleFast

From: David Sterba
Date: Tue Jul 30 2024 - 10:29:14 EST


On Thu, Jun 06, 2024 at 08:40:27PM -0700, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 614da38e2f7a Merge tag 'hid-for-linus-2024051401' of git:/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=164aa5f2980000
> kernel config: https://syzkaller.appspot.com/x/.config?x=f5d2cbf33633f507
> dashboard link: https://syzkaller.appspot.com/bug?extid=c86c7974966b98aab23d
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/89eafb874b71/disk-614da38e.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/356000512ad9/vmlinux-614da38e.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/839c73939115/bzImage-614da38e.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+c86c7974966b98aab23d@xxxxxxxxxxxxxxxxxxxxxxxxx

Most likely this was a side effect of bug fixed by commit f3a5367c679d
("btrfs: protect folio::private when attaching extent buffer folios").
There are 3 reports by syzbot, timeframe corresponds with increased
number of bogus errors caused by use-after-free of a page, compression
is reuses pages quite often.

The fix is best guess.

#syz fix: btrfs: protect folio::private when attaching extent buffer folios