syzbot


kernel BUG in __bch2_btree_node_hash_insert (2)

Status: upstream: reported C repro on 2025/01/16 02:22
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+3b2a86ce65e01acca028@syzkaller.appspotmail.com
First crash: 32d, last: 23d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] kernel BUG in __bch2_btree_node_hash_insert (2) 0 (2) 2025/01/20 23:00
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in __bch2_btree_node_hash_insert bcachefs C done 396 87d 95d 28/28 fixed on 2024/12/16 09:51
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/02/03 23:48 21m retest repro upstream OK log

Sample crash report:
bucket 0:42 data type btree stale dirty ptr: 0 < 1
while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 1db8f60c84bb244c written 8 min_key POS_MIN durability: 1 ptr: 0:42:0 gen 0 stale, fixing
------------[ cut here ]------------
kernel BUG at fs/bcachefs/btree_cache.c:280!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5300 Comm: syz-executor829 Not tainted 6.13.0-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:__bch2_btree_node_hash_insert+0x12ed/0x1310 fs/bcachefs/btree_cache.c:280
Code: ed fd e9 9d f5 ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c f2 f7 ff ff 48 89 df e8 8e 76 ed fd e9 e5 f7 ff ff e8 f4 0b 87 fd 90 <0f> 0b e8 ec 0b 87 fd 90 0f 0b e8 e4 0b 87 fd 90 0f 0b e8 ec 7d b0
RSP: 0018:ffffc9000d2c5de0 EFLAGS: 00010293
RAX: ffffffff84186bcc RBX: ffff888040678228 RCX: ffff888000a50000
RDX: 0000000000000000 RSI: ffff888040678000 RDI: ffff888048c01a80
RBP: ffffc9000d2c5f10 R08: ffffffff841874b1 R09: 1ffff110080cf016
R10: dffffc0000000000 R11: ffffed10080cf017 R12: 1ffff110080cf045
R13: dffffc0000000000 R14: ffff888048c01a80 R15: ffff888040678000
FS:  000055557bdba380(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005644f46e5018 CR3: 0000000042ec0000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_btree_node_update_key_early+0xa8d/0xbd0 fs/bcachefs/btree_cache.c:332
 bch2_check_fix_ptrs+0x5dc7/0x6530 fs/bcachefs/buckets.c:380
 bch2_trigger_extent+0x92c/0xaa0 fs/bcachefs/buckets.c:856
 bch2_key_trigger fs/bcachefs/bkey_methods.h:87 [inline]
 bch2_gc_mark_key+0x6b5/0x10e0 fs/bcachefs/btree_gc.c:634
 bch2_gc_btree fs/bcachefs/btree_gc.c:670 [inline]
 bch2_gc_btrees fs/bcachefs/btree_gc.c:729 [inline]
 bch2_check_allocations+0x1c3e/0x7070 fs/bcachefs/btree_gc.c:1133
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:191
 bch2_run_recovery_passes+0x3a7/0x880 fs/bcachefs/recovery_passes.c:244
 bch2_fs_recovery+0x25cc/0x39d0 fs/bcachefs/recovery.c:861
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1037
 bch2_fs_get_tree+0xd68/0x1710 fs/bcachefs/fs.c:2170
 vfs_get_tree+0x90/0x2b0 fs/super.c:1814
 do_new_mount+0x2be/0xb40 fs/namespace.c:3511
 do_mount fs/namespace.c:3851 [inline]
 __do_sys_mount fs/namespace.c:4061 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4038
 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:0x7f4025b9c88a
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:00007ffc9288bcf8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc9288bd10 RCX: 00007f4025b9c88a
RDX: 00000000200000c0 RSI: 0000000020000180 RDI: 00007ffc9288bd10
RBP: 0000000000000004 R08: 00007ffc9288bd50 R09: 00000000000059ad
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000
R13: 00007ffc9288bd50 R14: 0000000000000003 R15: 0000000001000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__bch2_btree_node_hash_insert+0x12ed/0x1310 fs/bcachefs/btree_cache.c:280
Code: ed fd e9 9d f5 ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c f2 f7 ff ff 48 89 df e8 8e 76 ed fd e9 e5 f7 ff ff e8 f4 0b 87 fd 90 <0f> 0b e8 ec 0b 87 fd 90 0f 0b e8 e4 0b 87 fd 90 0f 0b e8 ec 7d b0
RSP: 0018:ffffc9000d2c5de0 EFLAGS: 00010293
RAX: ffffffff84186bcc RBX: ffff888040678228 RCX: ffff888000a50000
RDX: 0000000000000000 RSI: ffff888040678000 RDI: ffff888048c01a80
RBP: ffffc9000d2c5f10 R08: ffffffff841874b1 R09: 1ffff110080cf016
R10: dffffc0000000000 R11: ffffed10080cf017 R12: 1ffff110080cf045
R13: dffffc0000000000 R14: ffff888048c01a80 R15: ffff888040678000
FS:  000055557bdba380(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005644f46e5018 CR3: 0000000042ec0000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/20 23:00 upstream ffd294d346d1 6e87cfa2 .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_btree_node_hash_insert
2025/01/20 22:45 upstream ffd294d346d1 6e87cfa2 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in __bch2_btree_node_hash_insert
2025/01/12 02:14 upstream b62cef9a5c67 6dbc6a9b .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in __bch2_btree_node_hash_insert
* Struck through repros no longer work on HEAD.