syzbot


kernel BUG in gc_bucket

Status: fixed on 2024/07/09 19:14
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+246b47da27f8e7e7d6fb@syzkaller.appspotmail.com
Fix commit: 9432e90df1b8 bcachefs: Check for invalid bucket from bucket_gen(), gc_bucket()
First crash: 133d, last: 128d
Cause bisection: introduced by (bisect log) :
commit 228e1c91ae5ec44f38aa8852aa3953005badce82
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Wed Dec 27 23:31:46 2023 +0000

  bcachefs: KEY_TYPE_accounting

Crash: kernel BUG in bch2_check_allocations (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly bcachefs report (Jun 2024) 0 (1) 2024/06/11 08:27
[syzbot] [bcachefs?] kernel BUG in gc_bucket 0 (2) 2024/06/06 18:12

Sample crash report:
bcachefs (loop0): recovering from clean shutdown, journal seq 7
bcachefs (loop0): Doing compatible version upgrade from 1.7: mi_btree_bitmap to 1.9: disk_accounting_v2
  running recovery passes: check_allocations
bcachefs (loop0): accounting_read... done
bcachefs (loop0): alloc_read... done
bcachefs (loop0): stripes_read... done
bcachefs (loop0): snapshots_read... done
bcachefs (loop0): check_allocations...
------------[ cut here ]------------
kernel BUG at fs/bcachefs/buckets.h:96!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 PID: 5093 Comm: syz-executor366 Not tainted 6.10.0-rc1-next-20240531-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:gc_bucket+0x250/0x260 fs/bcachefs/buckets.h:96
Code: 8c e8 34 e1 62 fd e9 29 ff ff ff 89 f9 80 e1 07 fe c1 38 c1 0f 8c 36 ff ff ff e8 9b 71 ec fd e9 2c ff ff ff e8 71 84 86 fd 90 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90
RSP: 0018:ffffc900035be208 EFLAGS: 00010293
RAX: ffffffff840ff77f RBX: 000000000001007c RCX: ffff88807cc70000
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000001007c
RBP: ffff888021e84000 R08: ffffffff840ff6e1 R09: 0000000000000000
R10: ffffc900035befd0 R11: fffff520006b7dfc R12: ffff888053ddd130
R13: ffff888053ddd118 R14: 000000000001007c R15: 0000000000000080
FS:  0000555563627380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055cce0302c88 CR3: 000000007a7f6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_gc_alloc_start fs/bcachefs/btree_gc.c:899 [inline]
 bch2_check_allocations+0xc63/0xb9d0 fs/bcachefs/btree_gc.c:1109
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:183
 bch2_run_recovery_passes+0x19e/0x820 fs/bcachefs/recovery_passes.c:226
 bch2_fs_recovery+0x238b/0x3730 fs/bcachefs/recovery.c:846
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1017
 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2113
 bch2_mount fs/bcachefs/fs.c:1908 [inline]
 bch2_fs_get_tree+0x75e/0x14d0 fs/bcachefs/fs.c:2069
 vfs_get_tree+0x90/0x2a0 fs/super.c:1780
 do_new_mount+0x2be/0xb40 fs/namespace.c:3352
 do_mount fs/namespace.c:3692 [inline]
 __do_sys_mount fs/namespace.c:3898 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa6effe7dea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc6f97a5d8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc6f97a5f0 RCX: 00007fa6effe7dea
RDX: 0000000020005d80 RSI: 0000000020005dc0 RDI: 00007ffc6f97a5f0
RBP: 0000000000000004 R08: 00007ffc6f97a630 R09: 0000000000005dff
R10: 0000000000000400 R11: 0000000000000282 R12: 0000000000000400
R13: 00007ffc6f97a630 R14: 0000000000000003 R15: 0000000001000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:gc_bucket+0x250/0x260 fs/bcachefs/buckets.h:96
Code: 8c e8 34 e1 62 fd e9 29 ff ff ff 89 f9 80 e1 07 fe c1 38 c1 0f 8c 36 ff ff ff e8 9b 71 ec fd e9 2c ff ff ff e8 71 84 86 fd 90 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90
RSP: 0018:ffffc900035be208 EFLAGS: 00010293
RAX: ffffffff840ff77f RBX: 000000000001007c RCX: ffff88807cc70000
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000001007c
RBP: ffff888021e84000 R08: ffffffff840ff6e1 R09: 0000000000000000
R10: ffffc900035befd0 R11: fffff520006b7dfc R12: ffff888053ddd130
R13: ffff888053ddd118 R14: 000000000001007c R15: 0000000000000080
FS:  0000555563627380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055cce0302c88 CR3: 000000007a7f6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (221):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/31 21:31 linux-next 0e1980c40b6e 3113787f .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/06 03:44 linux-next 234cb065ad82 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/06 02:55 linux-next 234cb065ad82 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/06 00:33 linux-next 234cb065ad82 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 23:14 linux-next 234cb065ad82 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 22:42 linux-next 234cb065ad82 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 19:13 linux-next 234cb065ad82 e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 18:06 linux-next 234cb065ad82 e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 15:53 linux-next 234cb065ad82 e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 07:11 linux-next 234cb065ad82 e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/05 02:14 linux-next d97496ca23a2 e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/04 23:06 linux-next d97496ca23a2 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/04 14:54 linux-next d97496ca23a2 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/04 14:47 linux-next d97496ca23a2 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/04 08:34 linux-next d97496ca23a2 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/04 03:05 linux-next 861a3cb5a2a8 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/04 00:02 linux-next 861a3cb5a2a8 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/03 18:29 linux-next 861a3cb5a2a8 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/03 18:26 linux-next 861a3cb5a2a8 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/03 14:14 linux-next 861a3cb5a2a8 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/03 01:16 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 22:55 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 20:03 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 18:35 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 18:15 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 10:51 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 07:49 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 04:27 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/02 02:04 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 23:54 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 22:33 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 18:29 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 17:20 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 15:10 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 07:35 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 06:21 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 05:31 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 03:49 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 02:49 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 01:35 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/06/01 01:17 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/05/31 23:46 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
2024/05/31 21:09 linux-next 0e1980c40b6e 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in gc_bucket
* Struck through repros no longer work on HEAD.