BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 800000010f7b2067 P4D 800000010f7b2067 PUD 10438f067 PMD 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 24 Comm: kworker/1:0 Not tainted 6.9.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: bcachefs_write_ref bch2_do_invalidates_work RIP: 0010:bch2_bkey_buf_realloc fs/bcachefs/bkey_buf.h:16 [inline] RIP: 0010:bch2_bkey_buf_reassemble fs/bcachefs/bkey_buf.h:27 [inline] RIP: 0010:btree_node_iter_and_journal_peek+0xc8/0x5d0 fs/bcachefs/btree_iter.c:898 Code: 00 00 4c 89 74 24 20 4c 89 f7 4c 89 e6 50 53 55 e8 0d 26 00 00 48 83 c4 18 4c 89 e7 e8 01 1f 00 00 49 89 c4 48 89 d5 49 8b 1f <80> 38 0d 72 33 49 8d 47 08 48 39 c3 75 2a 48 8b 44 24 08 48 8d b8 RSP: 0018:ffffc900000d37d8 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffffc900000d3a00 RCX: 578da58a1a59f400 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000000 R08: 000000000000000a R09: ffff88810d7caf10 R10: 0000000000000010 R11: 0000000000000010 R12: 0000000000000000 R13: ffff888106b4c228 R14: ffff888106b4c000 R15: ffffc900000d39f8 FS: 0000000000000000(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000016d1bc000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btree_path_down fs/bcachefs/btree_iter.c:926 [inline] bch2_btree_path_traverse_one+0xb1b/0xdd0 fs/bcachefs/btree_iter.c:1177 bch2_btree_path_traverse fs/bcachefs/btree_iter.h:225 [inline] __bch2_btree_iter_peek fs/bcachefs/btree_iter.c:2059 [inline] bch2_btree_iter_peek_upto+0x35a/0xf40 fs/bcachefs/btree_iter.c:2158 bch2_btree_iter_peek_upto_type fs/bcachefs/btree_iter.h:633 [inline] bch2_do_invalidates_work+0x30d/0xe80 fs/bcachefs/alloc_background.c:2014 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0x2a3/0x5b0 kernel/workqueue.c:3335 worker_thread+0x23e/0x300 kernel/workqueue.c:3416 kthread+0xea/0x100 kernel/kthread.c:388 ret_from_fork+0x32/0x40 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Modules linked in: CR2: 0000000000000000 ---[ end trace 0000000000000000 ]--- RIP: 0010:bch2_bkey_buf_realloc fs/bcachefs/bkey_buf.h:16 [inline] RIP: 0010:bch2_bkey_buf_reassemble fs/bcachefs/bkey_buf.h:27 [inline] RIP: 0010:btree_node_iter_and_journal_peek+0xc8/0x5d0 fs/bcachefs/btree_iter.c:898 Code: 00 00 4c 89 74 24 20 4c 89 f7 4c 89 e6 50 53 55 e8 0d 26 00 00 48 83 c4 18 4c 89 e7 e8 01 1f 00 00 49 89 c4 48 89 d5 49 8b 1f <80> 38 0d 72 33 49 8d 47 08 48 39 c3 75 2a 48 8b 44 24 08 48 8d b8 RSP: 0018:ffffc900000d37d8 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffffc900000d3a00 RCX: 578da58a1a59f400 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000000 R08: 000000000000000a R09: ffff88810d7caf10 R10: 0000000000000010 R11: 0000000000000010 R12: 0000000000000000 R13: ffff888106b4c228 R14: ffff888106b4c000 R15: ffffc900000d39f8 FS: 0000000000000000(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000016d1bc000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 4c 89 74 24 20 mov %r14,0x20(%rsp) 7: 4c 89 f7 mov %r14,%rdi a: 4c 89 e6 mov %r12,%rsi d: 50 push %rax e: 53 push %rbx f: 55 push %rbp 10: e8 0d 26 00 00 call 0x2622 15: 48 83 c4 18 add $0x18,%rsp 19: 4c 89 e7 mov %r12,%rdi 1c: e8 01 1f 00 00 call 0x1f22 21: 49 89 c4 mov %rax,%r12 24: 48 89 d5 mov %rdx,%rbp 27: 49 8b 1f mov (%r15),%rbx * 2a: 80 38 0d cmpb $0xd,(%rax) <-- trapping instruction 2d: 72 33 jb 0x62 2f: 49 8d 47 08 lea 0x8(%r15),%rax 33: 48 39 c3 cmp %rax,%rbx 36: 75 2a jne 0x62 38: 48 8b 44 24 08 mov 0x8(%rsp),%rax 3d: 48 rex.W 3e: 8d .byte 0x8d 3f: b8 .byte 0xb8