syzbot


kernel BUG in bch2_btree_path_level_init (4)

Status: upstream: reported C repro on 2025/09/05 12:19
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+55c84106264e92ea9ada@syzkaller.appspotmail.com
First crash: 52d, last: 18d
Cause bisection: introduced by (bisect log) :
commit f11ca2ab18e369a662c2f60d53b8bea46c54e312
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Thu Nov 28 03:29:54 2024 +0000

  bcachefs: Guard against backpointers to unknown btrees

Crash: kernel BUG in bch2_btree_path_level_init (log)
Repro: C syz .config
  
Discussions (4)
Title Replies (including bot) Last reply
Re: [PATCH] bcachefs:fix use-after-free in __bch2_bkey_fsck_err 1 (1) 2025/10/15 08:20
Re: [PATCH] bcachefs:fix use-after-free in __bch2_bkey_fsck_err 1 (1) 2025/10/05 18:05
[PATCH] bcachefs:fix use-after-free in __bch2_bkey_fsck_err 1 (1) 2025/10/05 16:05
[syzbot] [bcachefs?] kernel BUG in bch2_btree_path_level_init (4) 0 (2) 2025/09/05 16:39
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in bch2_btree_path_level_init bcachefs -1 C 2 491d 502d 0/29 auto-obsoleted due to no activity on 2024/10/01 02:22
upstream kernel BUG in bch2_btree_path_level_init (2) bcachefs -1 C done 29 318d 368d 28/29 fixed on 2024/12/16 09:50
upstream kernel BUG in bch2_btree_path_level_init (3) bcachefs -1 C done 489 52d 309d 29/29 fixed on 2025/09/04 16:57
Last patch testing requests (3)
Created Duration User Patch Repo Result
2025/10/23 08:36 19m retest repro upstream OK log
2025/10/23 08:31 21m retest repro upstream OK log
2025/10/05 16:08 21m ssrane_b23@ee.vjti.ac.in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log

Sample crash report:
bcachefs (loop9): dropping and reconstructing all alloc info
bcachefs (loop9): alloc_read... done
bcachefs (loop9): snapshots_read... done
bcachefs (loop9): done starting filesystem
------------[ cut here ]------------
kernel BUG at fs/bcachefs/btree_iter.c:633!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 1 UID: 0 PID: 7275 Comm: syz.9.135 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:bch2_btree_path_level_init+0x9e9/0xa20 fs/bcachefs/btree_iter.c:633
Code: c1 0f 8c 9e fb ff ff 4c 89 f7 e8 62 fa 00 fe e9 91 fb ff ff e8 28 b4 a1 fd 90 0f 0b e8 20 b4 a1 fd 90 0f 0b e8 18 b4 a1 fd 90 <0f> 0b e8 10 b4 a1 fd 90 0f 0b e8 08 b4 a1 fd 90 0f 0b e8 00 b4 a1
RSP: 0018:ffffc9000483f160 EFLAGS: 00010283
RAX: ffffffff841cba28 RBX: ffff8880240dc2d8 RCX: 0000000000080000
RDX: ffffc9000dc2a000 RSI: 000000000004b6cc RDI: 000000000004b6cd
RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff52000907e20 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: 0000000000000600
FS:  00007f1355ffe6c0(0000) GS:ffff8881269bc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbad3849fea CR3: 0000000050e6c000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 btree_path_lock_root fs/bcachefs/btree_iter.c:787 [inline]
 bch2_btree_path_traverse_one+0xfec/0x21d0 fs/bcachefs/btree_iter.c:1203
 bch2_btree_path_traverse fs/bcachefs/btree_iter.h:250 [inline]
 bch2_btree_iter_peek_slot+0x760/0x2290 fs/bcachefs/btree_iter.c:2828
 __bch2_bkey_get_iter fs/bcachefs/btree_iter.h:632 [inline]
 __bch2_bkey_get_val_typed+0x130/0x390 fs/bcachefs/btree_iter.h:673
 bch2_subvolume_get_inlined fs/bcachefs/subvolume.c:322 [inline]
 bch2_subvolume_get+0x63/0x100 fs/bcachefs/subvolume.c:334
 bch2_vfs_inode_get+0x132/0x330 fs/bcachefs/fs.c:521
 bch2_fs_get_tree+0xfe4/0x1520 fs/bcachefs/fs.c:2572
 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
 do_mount fs/namespace.c:4136 [inline]
 __do_sys_mount fs/namespace.c:4347 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4324
 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:0x7f1357da066a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1355ffde68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f1355ffdef0 RCX: 00007f1357da066a
RDX: 00002000000000c0 RSI: 0000200000000180 RDI: 00007f1355ffdeb0
RBP: 00002000000000c0 R08: 00007f1355ffdef0 R09: 0000000000800000
R10: 0000000000800000 R11: 0000000000000246 R12: 0000200000000180
R13: 00007f1355ffdeb0 R14: 00000000000059b1 R15: 000020000000ac40
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_btree_path_level_init+0x9e9/0xa20 fs/bcachefs/btree_iter.c:633
Code: c1 0f 8c 9e fb ff ff 4c 89 f7 e8 62 fa 00 fe e9 91 fb ff ff e8 28 b4 a1 fd 90 0f 0b e8 20 b4 a1 fd 90 0f 0b e8 18 b4 a1 fd 90 <0f> 0b e8 10 b4 a1 fd 90 0f 0b e8 08 b4 a1 fd 90 0f 0b e8 00 b4 a1
RSP: 0018:ffffc9000483f160 EFLAGS: 00010283
RAX: ffffffff841cba28 RBX: ffff8880240dc2d8 RCX: 0000000000080000
RDX: ffffc9000dc2a000 RSI: 000000000004b6cc RDI: 000000000004b6cd
RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff52000907e20 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: 0000000000000600
FS:  00007f1355ffe6c0(0000) GS:ffff8881269bc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbad3849fea CR3: 0000000050e6c000 CR4: 00000000003526f0

Crashes (286):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/24 02:51 upstream cec1e6e5d1ab e667a34f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in bch2_btree_path_level_init
2025/09/05 09:08 upstream d69eb204c255 d291dd2d .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in bch2_btree_path_level_init
2025/09/30 08:49 upstream 449c2b302c8e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/30 04:09 upstream 449c2b302c8e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/30 01:13 upstream 449c2b302c8e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/30 01:08 upstream 449c2b302c8e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 20:34 upstream e5f0a698b34e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 16:42 upstream e5f0a698b34e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 15:33 upstream e5f0a698b34e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 11:41 upstream e5f0a698b34e 86341da6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 07:18 upstream 8f9736633f8c 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 04:00 upstream 8f9736633f8c 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/29 01:42 upstream 8f9736633f8c 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 22:22 upstream 8f9736633f8c 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 20:51 upstream 8f9736633f8c 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 17:13 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 15:53 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 14:52 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 13:26 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 10:07 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 07:40 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 06:27 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 04:34 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 02:54 upstream 51a24b7deaae 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/28 00:06 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 21:36 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 20:27 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 19:03 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 16:47 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 15:34 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 14:09 upstream fec734e8d564 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 08:46 upstream 083fc6d7fa0d 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 07:34 upstream 083fc6d7fa0d 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/27 02:04 upstream 083fc6d7fa0d 001c9061 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 17:22 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 15:58 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 13:52 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 11:44 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 10:24 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 08:40 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 07:05 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 05:37 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/26 03:53 upstream 4ff71af020ae 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/25 20:05 upstream bf40f4b87761 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/25 17:21 upstream bf40f4b87761 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/25 14:42 upstream bf40f4b87761 0abd0691 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_btree_path_level_init
2025/09/05 04:53 upstream 08b06c30a445 d291dd2d .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_path_level_init
2025/10/09 08:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bf45a62baffc 7e2882b3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in bch2_btree_path_level_init
2025/10/01 06:11 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2213e57a69f0 65a0eece .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in bch2_btree_path_level_init
* Struck through repros no longer work on HEAD.