Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 1 PID: 6659 Comm: syz-executor.5 Not tainted 6.9.0-syzkaller-10323-g8f6a15f095a6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 RIP: 0010:bch2_snapshot_has_children fs/bcachefs/snapshot.h:184 [inline] RIP: 0010:__bch2_insert_snapshot_whiteouts+0x306/0x15e0 fs/bcachefs/btree_update.c:135 Code: fb 0f 86 c2 11 00 00 e8 a8 aa 7c fd 49 6b c7 38 49 8d 5c 04 18 48 8d 7b 14 48 89 f8 48 c1 e8 03 49 bc 00 00 00 00 00 fc ff df <42> 0f b6 04 20 84 c0 0f 85 3d 12 00 00 44 8b 7b 14 48 83 c3 18 48 RSP: 0018:ffffc900097f58e0 EFLAGS: 00010213 RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000040000 RDX: ffffc90009d79000 RSI: 000000000002b7b9 RDI: 0000000000000014 RBP: ffffc900097f5c40 R08: ffffffff841986e8 R09: 1ffffffff25f62b0 R10: dffffc0000000000 R11: fffffbfff25f62b1 R12: dffffc0000000000 R13: ffffc900097f5ba0 R14: ffffffff84198604 R15: 00000000ffffffff FS: 00007f4af82c56c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f352aad56c6 CR3: 000000002e7f8000 CR4: 0000000000350ef0 Call Trace: bch2_insert_snapshot_whiteouts fs/bcachefs/btree_update.h:95 [inline] bch2_trans_update_extent_overwrite+0xfd6/0x3710 fs/bcachefs/btree_update.c:218 bch2_trans_update_extent fs/bcachefs/btree_update.c:318 [inline] bch2_trans_update+0x186f/0x2550 fs/bcachefs/btree_update.c:514 bch2_extent_update+0x43c/0xbb0 fs/bcachefs/io_write.c:325 bch2_write_index_default fs/bcachefs/io_write.c:374 [inline] __bch2_write_index+0xee9/0x2190 fs/bcachefs/io_write.c:527 __bch2_write+0x54cc/0x5c40 fs/bcachefs/io_write.c:1498 bch2_write+0x947/0x1670 fs/bcachefs/io_write.c:1623 closure_queue include/linux/closure.h:269 [inline] closure_call include/linux/closure.h:402 [inline] bch2_dio_write_loop fs/bcachefs/fs-io-direct.c:531 [inline] bch2_direct_write+0x1a52/0x3050 fs/bcachefs/fs-io-direct.c:652 bch2_write_iter+0x206/0x2840 fs/bcachefs/fs-io-buffered.c:1135 call_write_iter include/linux/fs.h:2114 [inline] iter_file_splice_write+0xbd9/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x120/0x220 fs/splice.c:1164 splice_direct_to_actor+0x590/0xc90 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x28c/0x3e0 fs/splice.c:1233 do_sendfile+0x56d/0xe10 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4af747cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4af82c50c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f4af75abf80 RCX: 00007f4af747cee9 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000007 RBP: 00007f4af74c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000800000009 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4af75abf80 R15: 00007fffde551848 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:bch2_snapshot_has_children fs/bcachefs/snapshot.h:184 [inline] RIP: 0010:__bch2_insert_snapshot_whiteouts+0x306/0x15e0 fs/bcachefs/btree_update.c:135 Code: fb 0f 86 c2 11 00 00 e8 a8 aa 7c fd 49 6b c7 38 49 8d 5c 04 18 48 8d 7b 14 48 89 f8 48 c1 e8 03 49 bc 00 00 00 00 00 fc ff df <42> 0f b6 04 20 84 c0 0f 85 3d 12 00 00 44 8b 7b 14 48 83 c3 18 48 RSP: 0018:ffffc900097f58e0 EFLAGS: 00010213 RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000040000 RDX: ffffc90009d79000 RSI: 000000000002b7b9 RDI: 0000000000000014 RBP: ffffc900097f5c40 R08: ffffffff841986e8 R09: 1ffffffff25f62b0 R10: dffffc0000000000 R11: fffffbfff25f62b1 R12: dffffc0000000000 R13: ffffc900097f5ba0 R14: ffffffff84198604 R15: 00000000ffffffff FS: 00007f4af82c56c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555595440978 CR3: 000000002e7f8000 CR4: 0000000000350ef0 ---------------- Code disassembly (best guess): 0: fb sti 1: 0f 86 c2 11 00 00 jbe 0x11c9 7: e8 a8 aa 7c fd call 0xfd7caab4 c: 49 6b c7 38 imul $0x38,%r15,%rax 10: 49 8d 5c 04 18 lea 0x18(%r12,%rax,1),%rbx 15: 48 8d 7b 14 lea 0x14(%rbx),%rdi 19: 48 89 f8 mov %rdi,%rax 1c: 48 c1 e8 03 shr $0x3,%rax 20: 49 bc 00 00 00 00 00 movabs $0xdffffc0000000000,%r12 27: fc ff df * 2a: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 3d 12 00 00 jne 0x1274 37: 44 8b 7b 14 mov 0x14(%rbx),%r15d 3b: 48 83 c3 18 add $0x18,%rbx 3f: 48 rex.W