syzbot


kernel BUG in bch2_printbuf_exit

Status: upstream: reported C repro on 2025/07/17 19:13
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+1faf405b707c6475482f@syzkaller.appspotmail.com
Fix commit: bcachefs: convert str_hash.c to CLASS
Patched on: [ci-upstream-linux-next-kasan-gce-root ci-upstream-rust-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 15d, last: 10d
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] kernel BUG in bch2_printbuf_exit 2 (3) 2025/07/18 17:37

Sample crash report:
    bi_fields_set=0
    bi_dir=0
    bi_dir_offset=0
    bi_subvol=0
    bi_parent_subvol=0
    bi_nocow=0
    bi_depth=0
    bi_inodes_32bit=0
    bi_casefold=0, fixing
bcachefs (loop0): hash table key at wrong offset: should be at 6053843396831044271
  u64s 7 type dirent 4096:4330382808765833931:U32_MAX len 0 ver 0: ÿÿÿÿ1 -> 536870912 type reg, fixing
------------[ cut here ]------------
kernel BUG at arch/x86/mm/physaddr.c:23!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 1 UID: 0 PID: 5848 Comm: syz-executor288 Not tainted 6.16.0-rc6-next-20250716-syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:__phys_addr+0x17b/0x180 arch/x86/mm/physaddr.c:23
Code: 50 fe fa 8d 48 89 de 4c 89 f2 e8 80 15 8b 03 e9 4d ff ff ff e8 e6 32 4b 00 90 0f 0b e8 de 32 4b 00 90 0f 0b e8 d6 32 4b 00 90 <0f> 0b 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3
RSP: 0018:ffffc90003e0dfa8 EFLAGS: 00010293
RAX: ffffffff817473fa RBX: 000000007ffffffc RCX: ffff888031bf8000
RDX: 0000000000000000 RSI: 000000007ffffffc RDI: 000000001fffffff
RBP: 0000000000000002 R08: fffffffffffffffc R09: fffffffffffffffc
R10: 0000000000000000 R11: 0000000000000000 R12: ffffc90003e0e530
R13: ffffc90003e0ee00 R14: 000000007ffffffc R15: dffffc0000000000
FS:  000055558a225380(0000) GS:ffff888125ce2000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f740dd9b000 CR3: 0000000071cd2000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 virt_to_folio include/linux/mm.h:1178 [inline]
 kfree+0x77/0x440 mm/slub.c:4871
 bch2_printbuf_exit+0x6f/0xb0 fs/bcachefs/printbuf.c:219
 class_printbuf_destructor fs/bcachefs/printbuf.h:148 [inline]
 bch2_str_hash_repair_key+0xf2b/0x4030 fs/bcachefs/str_hash.c:336
 __bch2_str_hash_check_key+0xa85/0xd60 fs/bcachefs/str_hash.c:391
 bch2_str_hash_check_key fs/bcachefs/str_hash.h:427 [inline]
 check_dirent fs/bcachefs/fsck.c:2310 [inline]
 bch2_check_dirents+0x21fe/0x3440 fs/bcachefs/fsck.c:2449
 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:479 [inline]
 __bch2_run_recovery_passes+0x39d/0x1050 fs/bcachefs/recovery_passes.c:535
 bch2_run_recovery_passes+0x184/0x210 fs/bcachefs/recovery_passes.c:606
 bch2_fs_recovery+0x2544/0x3860 fs/bcachefs/recovery.c:995
 bch2_fs_start+0x957/0xbf0 fs/bcachefs/super.c:1216
 bch2_fs_get_tree+0xb39/0x1540 fs/bcachefs/fs.c:2456
 vfs_get_tree+0x8f/0x2b0 fs/super.c:1804
 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805
 do_mount fs/namespace.c:4133 [inline]
 __do_sys_mount fs/namespace.c:4344 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4321
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe9b6ab4e2a
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:00007ffc69216268 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc69216280 RCX: 00007fe9b6ab4e2a
RDX: 00002000000000c0 RSI: 0000200000000340 RDI: 00007ffc69216280
RBP: 0000200000000340 R08: 00007ffc692162c0 R09: 000000000000597e
R10: 0000000001014040 R11: 0000000000000282 R12: 00002000000000c0
R13: 00007ffc692162c0 R14: 0000000000000003 R15: 0000000001014040
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__phys_addr+0x17b/0x180 arch/x86/mm/physaddr.c:23
Code: 50 fe fa 8d 48 89 de 4c 89 f2 e8 80 15 8b 03 e9 4d ff ff ff e8 e6 32 4b 00 90 0f 0b e8 de 32 4b 00 90 0f 0b e8 d6 32 4b 00 90 <0f> 0b 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3
RSP: 0018:ffffc90003e0dfa8 EFLAGS: 00010293
RAX: ffffffff817473fa RBX: 000000007ffffffc RCX: ffff888031bf8000
RDX: 0000000000000000 RSI: 000000007ffffffc RDI: 000000001fffffff
RBP: 0000000000000002 R08: fffffffffffffffc R09: fffffffffffffffc
R10: 0000000000000000 R11: 0000000000000000 R12: ffffc90003e0e530
R13: ffffc90003e0ee00 R14: 000000007ffffffc R15: dffffc0000000000
FS:  000055558a225380(0000) GS:ffff888125be2000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f740e4bed30 CR3: 0000000071cd2000 CR4: 00000000003526f0

Crashes (29):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/17 06:21 linux-next e8352908bdcd 44f8051e .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 bch2_printbuf_exit
2025/07/17 05:51 linux-next e8352908bdcd 44f8051e .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 bch2_printbuf_exit
2025/07/21 07:20 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/21 06:11 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/21 04:29 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/21 04:00 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/20 19:19 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/20 17:54 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/20 13:18 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/20 12:52 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/20 11:07 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/20 02:09 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/19 12:22 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/19 12:22 linux-next d086c886ceb9 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/18 23:01 linux-next d086c886ceb9 f550e092 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/18 18:20 linux-next d086c886ceb9 f550e092 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/18 18:20 linux-next d086c886ceb9 f550e092 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 18:40 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 18:39 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 15:58 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 14:14 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 14:14 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
2025/07/16 12:54 linux-next e8352908bdcd c118d736 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_printbuf_exit
* Struck through repros no longer work on HEAD.