Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 1 PID: 5568 Comm: syz-executor.4 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 48 f7 7f 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:ffffc900050658e0 EFLAGS: 00010203 RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000040000 RDX: ffffc9000540a000 RSI: 000000000003ffff RDI: 0000000000000014 RBP: ffffc90005065c40 R08: ffffffff84163958 R09: 1ffffffff25ef4b0 R10: dffffc0000000000 R11: fffffbfff25ef4b1 R12: dffffc0000000000 R13: ffffc90005065ba0 R14: ffffffff84163874 R15: 00000000ffffffff FS: 00007f12a9fff6c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002002f000 CR3: 000000001e7c6000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 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+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11e/0x220 fs/splice.c:1164 splice_direct_to_actor+0x58e/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:0x7f12aa47cee9 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:00007f12a9fff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f12aa5abf80 RCX: 00007f12aa47cee9 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000007 RBP: 00007f12aa4c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000800000009 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f12aa5abf80 R15: 00007ffda9986398 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 48 f7 7f 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:ffffc900050658e0 EFLAGS: 00010203 RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000040000 RDX: ffffc9000540a000 RSI: 000000000003ffff RDI: 0000000000000014 RBP: ffffc90005065c40 R08: ffffffff84163958 R09: 1ffffffff25ef4b0 R10: dffffc0000000000 R11: fffffbfff25ef4b1 R12: dffffc0000000000 R13: ffffc90005065ba0 R14: ffffffff84163874 R15: 00000000ffffffff FS: 00007f12a9fff6c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b3273c000 CR3: 000000001e7c6000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: fb sti 1: 0f 86 c2 11 00 00 jbe 0x11c9 7: e8 48 f7 7f fd call 0xfd7ff754 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