syzbot


kernel BUG in btrfs_global_root_insert

Status: fixed on 2023/08/07 10:29
Reported-by: syzbot+6e93db69f8c16e336b49@syzkaller.appspotmail.com
Fix commit: 4389fb6b6a9d btrfs: do not ASSERT() on duplicated global roots
First crash: 591d, last: 521d
Fix bisection: fixed by (bisect log) :
commit 4389fb6b6a9d31704cc576b7671b6dfe9ac9f966
Author: Qu Wenruo <wqu@suse.com>
Date: Sun Jun 11 00:09:13 2023 +0000

  btrfs: do not ASSERT() on duplicated global roots

  
Bug presence (1)
Date Name Commit Repro Result
2023/07/18 upstream (ToT) 74f1456c4a5f C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in assertfail (2) btrfs C done done 162 525d 786d 23/28 fixed on 2023/09/28 17:51

Sample crash report:
BTRFS info (device loop0): using free space tree
BTRFS warning (device loop0): failed to read root (objectid=9): -5
BTRFS warning (device loop0): couldn't read tree root
BTRFS error (device loop0): parent transid verify failed on logical 5255168 mirror 1 wanted 5 found 7
BTRFS warning (device loop0): couldn't read tree root
assertion failed: !tmp, in fs/btrfs/disk-io.c:1105
------------[ cut here ]------------
kernel BUG at fs/btrfs/ctree.h:3716!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3538 Comm: syz-executor839 Not tainted 6.1.34-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:assertfail+0x18/0x1a fs/btrfs/ctree.h:3716
Code: 60 1c 2d 8b 48 c7 c2 80 19 2d 8b e8 07 e4 ff ff 0f 0b 89 f1 48 89 fe 48 c7 c7 60 4c 2d 8b 48 c7 c2 50 1e 2d 8b e8 ed e3 ff ff <0f> 0b 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 e4 e0 48 81 ec
RSP: 0018:ffffc900039ff448 EFLAGS: 00010246
RAX: 0000000000000032 RBX: 0000000000000000 RCX: b320dda0ee857800
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffff88801f8940a0 R08: ffffffff816d9a7c R09: ffffed1017304f1c
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88807b36e1f7 R14: ffff888073bec000 R15: ffff888073bec000
FS:  0000555555f79300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2a271a4ae0 CR3: 0000000078d97000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_global_root_insert+0x1a1/0x1b0 fs/btrfs/disk-io.c:1105
 load_global_roots_objectid+0x465/0x8b0 fs/btrfs/disk-io.c:2481
 load_global_roots fs/btrfs/disk-io.c:2515 [inline]
 btrfs_read_roots fs/btrfs/disk-io.c:2542 [inline]
 init_tree_roots+0xa28/0x1f6a fs/btrfs/disk-io.c:2961
 open_ctree+0x1b41/0x2e06 fs/btrfs/disk-io.c:3668
 btrfs_fill_super+0x1c7/0x2d0 fs/btrfs/super.c:1465
 btrfs_mount_root+0x803/0x930 fs/btrfs/super.c:1831
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 fc_mount fs/namespace.c:1043 [inline]
 vfs_kern_mount+0xb8/0x150 fs/namespace.c:1073
 btrfs_mount+0x395/0xb40 fs/btrfs/super.c:1891
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 do_new_mount+0x28b/0xae0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fddcd689caa
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff27aef678 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fddcd689caa
RDX: 00000000200000c0 RSI: 0000000020000040 RDI: 00007fff27aef690
RBP: 00007fff27aef690 R08: 00007fff27aef6d0 R09: 00007fff27aef700
R10: 0000000000800014 R11: 0000000000000282 R12: 0000000000000004
R13: 0000555555f792c0 R14: 0000000000800014 R15: 00007fff27aef6d0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:assertfail+0x18/0x1a fs/btrfs/ctree.h:3716
Code: 60 1c 2d 8b 48 c7 c2 80 19 2d 8b e8 07 e4 ff ff 0f 0b 89 f1 48 89 fe 48 c7 c7 60 4c 2d 8b 48 c7 c2 50 1e 2d 8b e8 ed e3 ff ff <0f> 0b 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 e4 e0 48 81 ec
RSP: 0018:ffffc900039ff448 EFLAGS: 00010246
RAX: 0000000000000032 RBX: 0000000000000000 RCX: b320dda0ee857800
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffff88801f8940a0 R08: ffffffff816d9a7c R09: ffffed1017304f1c
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88807b36e1f7 R14: ffff888073bec000 R15: ffff888073bec000
FS:  0000555555f79300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2a271a4ae0 CR3: 0000000078d97000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/18 20:44 linux-6.1.y ca87e77a2ef8 f3921d4d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan kernel BUG in btrfs_global_root_insert
2023/06/03 08:44 linux-6.1.y d2869ace6eeb a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan kernel BUG in btrfs_global_root_insert
2023/06/03 05:54 linux-6.1.y d2869ace6eeb a4ae4f42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan kernel BUG in btrfs_global_root_insert
2023/04/16 07:33 linux-6.1.y 0102425ac76b ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan kernel BUG in btrfs_global_root_insert
2023/04/10 05:42 linux-6.1.y 543aff194ab6 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan kernel BUG in btrfs_global_root_insert
* Struck through repros no longer work on HEAD.