syzbot


BUG: unable to handle kernel paging request in bch2_btree_iter_peek_slot

Status: moderation: reported on 2025/07/18 12:07
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+9b1a141ade7c466cf963@syzkaller.appspotmail.com
First crash: 9d03h, last: 6h25m

Sample crash report:
bcachefs (loop8): initializing freespace
BUG: unable to handle page fault for address: fffffffffffff774
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD df3d067 P4D df3d067 PUD df3f067 PMD 0 
Oops: Oops: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 19446 Comm: syz.8.2823 Not tainted 6.16.0-rc6-next-20250718-syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:bch2_btree_iter_peek_slot+0xb13/0x22f0 fs/bcachefs/btree_iter.c:2867
Code: 85 40 09 00 00 e8 dd c6 97 fd 48 8b 9c 24 f8 00 00 00 48 83 c3 02 48 89 d8 48 c1 e8 03 42 0f b6 04 28 84 c0 0f 85 14 10 00 00 <0f> b6 1b bf 01 00 00 00 89 de e8 ae c9 97 fd 83 fb 01 0f 85 5e 02
RSP: 0018:ffffc9000ad95aa0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: fffffffffffff774 RCX: 0000000000080000
RDX: ffffc9000e081000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc9000ad95d50 R08: ffff88801a56da00 R09: 0000000000000002
R10: 00000000fffffffe R11: 0000000000000002 R12: ffffc9000ad95ee0
R13: dffffc0000000000 R14: fffffffffffff772 R15: 0000000000000000
FS:  00007fb2522296c0(0000) GS:ffff888125be3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffffffffff774 CR3: 0000000062988000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 bch2_btree_iter_peek_max_type fs/bcachefs/btree_iter.h:748 [inline]
 bch2_bucket_alloc_early+0xf56/0x1680 fs/bcachefs/alloc_foreground.c:307
 bch2_bucket_alloc_trans+0x19df/0x1d50 fs/bcachefs/alloc_foreground.c:541
 bch2_bucket_alloc_set_trans+0x51a/0xe90 fs/bcachefs/alloc_foreground.c:725
 __open_bucket_add_buckets+0x145d/0x1e00 fs/bcachefs/alloc_foreground.c:919
 open_bucket_add_buckets+0x2ee/0x440 fs/bcachefs/alloc_foreground.c:951
 bch2_alloc_sectors_start_trans+0xe24/0x1e80 fs/bcachefs/alloc_foreground.c:1266
 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:320 [inline]
 bch2_btree_reserve_get+0x55d/0x15d0 fs/bcachefs/btree_update_interior.c:528
 bch2_btree_update_start+0x14c0/0x1e00 fs/bcachefs/btree_update_interior.c:1254
 bch2_btree_split_leaf+0x14b/0x8e0 fs/bcachefs/btree_update_interior.c:1900
 bch2_trans_commit_error+0x1b7/0x1130 fs/bcachefs/btree_trans_commit.c:917
 __bch2_trans_commit+0x1b63/0x8a70 fs/bcachefs/btree_trans_commit.c:1134
 bch2_trans_commit fs/bcachefs/btree_update.h:270 [inline]
 bch2_dev_freespace_init+0x93a/0x1000 fs/bcachefs/alloc_background.c:2318
 bch2_fs_freespace_init+0xff/0x320 fs/bcachefs/alloc_background.c:2367
 bch2_fs_initialize+0x7d8/0xe60 fs/bcachefs/recovery.c:1217
 bch2_fs_start+0xa00/0xcc0 fs/bcachefs/super.c:1217
 bch2_fs_get_tree+0xb39/0x1540 fs/bcachefs/fs.c:2456
 vfs_get_tree+0x92/0x2b0 fs/super.c:1815
 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:0x7fb25139014a
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:00007fb252228e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fb252228ef0 RCX: 00007fb25139014a
RDX: 0000200000000140 RSI: 0000200000000000 RDI: 00007fb252228eb0
RBP: 0000200000000140 R08: 00007fb252228ef0 R09: 0000000000200414
R10: 0000000000200414 R11: 0000000000000246 R12: 0000200000000000
R13: 00007fb252228eb0 R14: 0000000000005ad0 R15: 0000200000000400
 </TASK>
Modules linked in:
CR2: fffffffffffff774
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_btree_iter_peek_slot+0xb13/0x22f0 fs/bcachefs/btree_iter.c:2867
Code: 85 40 09 00 00 e8 dd c6 97 fd 48 8b 9c 24 f8 00 00 00 48 83 c3 02 48 89 d8 48 c1 e8 03 42 0f b6 04 28 84 c0 0f 85 14 10 00 00 <0f> b6 1b bf 01 00 00 00 89 de e8 ae c9 97 fd 83 fb 01 0f 85 5e 02
RSP: 0018:ffffc9000ad95aa0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: fffffffffffff774 RCX: 0000000000080000
RDX: ffffc9000e081000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc9000ad95d50 R08: ffff88801a56da00 R09: 0000000000000002
R10: 00000000fffffffe R11: 0000000000000002 R12: ffffc9000ad95ee0
R13: dffffc0000000000 R14: fffffffffffff772 R15: 0000000000000000
FS:  00007fb2522296c0(0000) GS:ffff888125be3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffffffffff774 CR3: 0000000062988000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	85 40 09             	test   %eax,0x9(%rax)
   3:	00 00                	add    %al,(%rax)
   5:	e8 dd c6 97 fd       	call   0xfd97c6e7
   a:	48 8b 9c 24 f8 00 00 	mov    0xf8(%rsp),%rbx
  11:	00
  12:	48 83 c3 02          	add    $0x2,%rbx
  16:	48 89 d8             	mov    %rbx,%rax
  19:	48 c1 e8 03          	shr    $0x3,%rax
  1d:	42 0f b6 04 28       	movzbl (%rax,%r13,1),%eax
  22:	84 c0                	test   %al,%al
  24:	0f 85 14 10 00 00    	jne    0x103e
* 2a:	0f b6 1b             	movzbl (%rbx),%ebx <-- trapping instruction
  2d:	bf 01 00 00 00       	mov    $0x1,%edi
  32:	89 de                	mov    %ebx,%esi
  34:	e8 ae c9 97 fd       	call   0xfd97c9e7
  39:	83 fb 01             	cmp    $0x1,%ebx
  3c:	0f                   	.byte 0xf
  3d:	85 5e 02             	test   %ebx,0x2(%rsi)

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/23 08:46 linux-next d086c886ceb9 e1dd4f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in bch2_btree_iter_peek_slot
2025/07/18 21:40 linux-next d086c886ceb9 f550e092 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in bch2_btree_iter_peek_slot
2025/07/15 05:21 linux-next 0be23810e32e 03fcfc4b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in bch2_btree_iter_peek_slot
2025/07/14 12:02 linux-next 0be23810e32e 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in bch2_btree_iter_peek_slot
* Struck through repros no longer work on HEAD.