syzbot


kernel BUG in __bch2_str_hash_check_key

Status: upstream: reported C repro on 2025/04/10 06:58
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+843981bb836d699c07d1@syzkaller.appspotmail.com
First crash: 20d, last: 2d11h
Cause bisection: introduced by (bisect log) :
commit d37c14ac6f05ec98db9b3d9db424dc73a0f5b1cd
Author: Joshua Ashton <joshua@froggi.es>
Date: Sun Aug 13 17:34:17 2023 +0000

  bcachefs: bcachefs_metadata_version_casefolding

Crash: kernel BUG in __bch2_str_hash_check_key (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] kernel BUG in __bch2_str_hash_check_key 5 (8) 2025/04/24 06:27

Sample crash report:
bcachefs (loop0): hash table key at wrong offset: btree dirents inode 4096 offset 6229884513039707068, hashed to 2263426191451115502
  u64s 7 type dirent 4096:6229884513039707068:U32_MAX len 0 ver 0: ΝΛle2 -> 2165878814 -> 1056964609 type subvol, fixing
bcachefs (loop0): hash table key at wrong offset: btree dirents inode 4096 offset 6229884513039707068, hashed to 2263426191451115502
  u64s 7 type dirent 4096:6229884513039707068:U32_MAX len 0 ver 0: ΝΛle2 -> 2165878814 -> 1056964609 type subvol, fixing
------------[ cut here ]------------
kernel BUG at fs/bcachefs/fsck.c:979!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 5831 Comm: syz-executor240 Not tainted 6.15.0-rc3-syzkaller-00032-ga79be02bba5c #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:bch2_fsck_update_backpointers+0x4ed/0x4f0 fs/bcachefs/fsck.c:979
Code: e9 2b fc ff ff 89 d9 80 e1 07 38 c1 0f 8c 62 fc ff ff 48 89 df e8 83 b9 b7 fd e9 55 fc ff ff e8 09 15 b5 07 e8 24 11 50 fd 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e
RSP: 0018:ffffc900040ee460 EFLAGS: 00010293
RAX: ffffffff8472ab3c RBX: 0000000000000010 RCX: ffff88802d629e00
RDX: 0000000000000000 RSI: 0000000000000010 RDI: 0000000000000010
RBP: ffffc900040ee600 R08: ffffffff8472a799 R09: 0000000000000000
R10: ffffc900040ee530 R11: fffff5200081dcaf R12: ffffc900040ef290
R13: dffffc0000000000 R14: ffff88807bb16800 R15: ffff888030120000
FS:  000055556abe5380(0000) GS:ffff888124fcf000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055a44b8c0f28 CR3: 00000000776f8000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __bch2_str_hash_check_key+0x202c/0x3b50 fs/bcachefs/str_hash.c:257
 bch2_str_hash_check_key fs/bcachefs/str_hash.h:415 [inline]
 check_dirent fs/bcachefs/fsck.c:2177 [inline]
 bch2_check_dirents+0x2d45/0x3b90 fs/bcachefs/fsck.c:2272
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:226
 bch2_run_recovery_passes+0x2ad/0xa90 fs/bcachefs/recovery_passes.c:285
 bch2_fs_recovery+0x292a/0x3e20 fs/bcachefs/recovery.c:936
 bch2_fs_start+0x310/0x620 fs/bcachefs/super.c:1065
 bch2_fs_get_tree+0x113e/0x18f0 fs/bcachefs/fs.c:2253
 vfs_get_tree+0x90/0x2b0 fs/super.c:1759
 do_new_mount+0x2cf/0xb70 fs/namespace.c:3881
 do_mount fs/namespace.c:4221 [inline]
 __do_sys_mount fs/namespace.c:4432 [inline]
 __se_sys_mount+0x38c/0x400 fs/namespace.c:4409
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f4ada1faf2a
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:00007ffffcce9dd8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffffcce9df0 RCX: 00007f4ada1faf2a
RDX: 000020000000f640 RSI: 0000200000000200 RDI: 00007ffffcce9df0
RBP: 0000200000000200 R08: 00007ffffcce9e30 R09: 000000000000f64b
R10: 0000000002a18414 R11: 0000000000000282 R12: 000020000000f640
R13: 00007ffffcce9e30 R14: 0000000000000003 R15: 0000000002a18414
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_fsck_update_backpointers+0x4ed/0x4f0 fs/bcachefs/fsck.c:979
Code: e9 2b fc ff ff 89 d9 80 e1 07 38 c1 0f 8c 62 fc ff ff 48 89 df e8 83 b9 b7 fd e9 55 fc ff ff e8 09 15 b5 07 e8 24 11 50 fd 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e
RSP: 0018:ffffc900040ee460 EFLAGS: 00010293
RAX: ffffffff8472ab3c RBX: 0000000000000010 RCX: ffff88802d629e00
RDX: 0000000000000000 RSI: 0000000000000010 RDI: 0000000000000010
RBP: ffffc900040ee600 R08: ffffffff8472a799 R09: 0000000000000000
R10: ffffc900040ee530 R11: fffff5200081dcaf R12: ffffc900040ef290
R13: dffffc0000000000 R14: ffff88807bb16800 R15: ffff888030120000
FS:  000055556abe5380(0000) GS:ffff8881250cf000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005618f2077098 CR3: 00000000776f8000 CR4: 00000000003526f0
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
2025/04/23 21:07 upstream a79be02bba5c 73a168d0 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in __bch2_str_hash_check_key
2025/04/21 23:43 upstream 9d7a0577c9db 2a20f901 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root kernel BUG in __bch2_str_hash_check_key
2025/04/21 23:25 upstream 9d7a0577c9db 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in __bch2_str_hash_check_key
2025/04/16 15:30 upstream 1a1d569a75f3 a95239b1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in __bch2_str_hash_check_key
2025/04/06 06:51 upstream 56f944529ec2 1c65791e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in __bch2_str_hash_check_key
* Struck through repros no longer work on HEAD.