Oops: general protection fault, probably for non-canonical address 0xdffffc0000000013: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000098-0x000000000000009f] CPU: 0 UID: 0 PID: 1141 Comm: kworker/u8:6 Not tainted 6.13.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Workqueue: writeback wb_workfn (flush-bcachefs-25) RIP: 0010:btree_path_lock_root fs/bcachefs/btree_iter.c:732 [inline] RIP: 0010:bch2_btree_path_traverse_one+0x94a/0x2940 fs/bcachefs/btree_iter.c:1183 Code: 89 44 24 60 42 80 3c 20 00 74 08 4c 89 ef e8 2d 40 e8 fd 49 8b 45 00 48 89 44 24 48 48 8d 90 98 00 00 00 48 89 d0 48 c1 e8 03 <42> 0f b6 04 20 84 c0 48 89 94 24 80 00 00 00 0f 85 ee 10 00 00 4c RSP: 0018:ffffc900040b5060 EFLAGS: 00010202 RAX: 0000000000000013 RBX: 0000000000000000 RCX: ffff8880278a3c00 RDX: 0000000000000098 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900040b5350 R08: ffffffff841b0610 R09: ffffffff841ae689 R10: 0000000000000002 R11: ffff8880278a3c00 R12: dffffc0000000000 R13: ffff888070c014d8 R14: ffff88801e78c2f8 R15: 000000000000110b FS: 0000000000000000(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005555679165c8 CR3: 00000000667e6000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_btree_path_traverse fs/bcachefs/btree_iter.h:247 [inline] __bch2_btree_iter_peek fs/bcachefs/btree_iter.c:2210 [inline] bch2_btree_iter_peek_upto+0xb58/0x70e0 fs/bcachefs/btree_iter.c:2310 bch2_btree_iter_peek_upto_type fs/bcachefs/btree_iter.h:685 [inline] bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:495 [inline] bch2_bucket_alloc_trans+0x1122/0x3a50 fs/bcachefs/alloc_foreground.c:648 bch2_bucket_alloc_set_trans+0x517/0xd30 fs/bcachefs/alloc_foreground.c:808 __open_bucket_add_buckets+0x13d0/0x1ec0 fs/bcachefs/alloc_foreground.c:1057 open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1101 bch2_alloc_sectors_start_trans+0xc55/0x2030 fs/bcachefs/alloc_foreground.c:1424 __bch2_write+0x72b/0x5dd0 fs/bcachefs/io_write.c:1437 bch2_write+0x9b5/0x1760 fs/bcachefs/io_write.c:1631 closure_queue include/linux/closure.h:270 [inline] closure_call include/linux/closure.h:432 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:449 [inline] bch2_writepages+0x284/0x390 fs/bcachefs/fs-io-buffered.c:641 do_writepages+0x35f/0x880 mm/page-writeback.c:2708 __writeback_single_inode+0x14f/0x10d0 fs/fs-writeback.c:1680 writeback_sb_inodes+0x820/0x1360 fs/fs-writeback.c:1976 wb_writeback+0x413/0xb80 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x410/0x1080 fs/fs-writeback.c:2343 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317 worker_thread+0x870/0xd30 kernel/workqueue.c:3398 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:btree_path_lock_root fs/bcachefs/btree_iter.c:732 [inline] RIP: 0010:bch2_btree_path_traverse_one+0x94a/0x2940 fs/bcachefs/btree_iter.c:1183 Code: 89 44 24 60 42 80 3c 20 00 74 08 4c 89 ef e8 2d 40 e8 fd 49 8b 45 00 48 89 44 24 48 48 8d 90 98 00 00 00 48 89 d0 48 c1 e8 03 <42> 0f b6 04 20 84 c0 48 89 94 24 80 00 00 00 0f 85 ee 10 00 00 4c RSP: 0018:ffffc900040b5060 EFLAGS: 00010202 RAX: 0000000000000013 RBX: 0000000000000000 RCX: ffff8880278a3c00 RDX: 0000000000000098 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900040b5350 R08: ffffffff841b0610 R09: ffffffff841ae689 R10: 0000000000000002 R11: ffff8880278a3c00 R12: dffffc0000000000 R13: ffff888070c014d8 R14: ffff88801e78c2f8 R15: 000000000000110b FS: 0000000000000000(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000056215f225950 CR3: 00000000313ec000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 89 44 24 60 mov %eax,0x60(%rsp) 4: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) 9: 74 08 je 0x13 b: 4c 89 ef mov %r13,%rdi e: e8 2d 40 e8 fd call 0xfde84040 13: 49 8b 45 00 mov 0x0(%r13),%rax 17: 48 89 44 24 48 mov %rax,0x48(%rsp) 1c: 48 8d 90 98 00 00 00 lea 0x98(%rax),%rdx 23: 48 89 d0 mov %rdx,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 48 89 94 24 80 00 00 mov %rdx,0x80(%rsp) 38: 00 39: 0f 85 ee 10 00 00 jne 0x112d 3f: 4c rex.WR