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: 0 PID: 5222 Comm: syz-executor.3 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+0x3ad/0x1140 fs/bcachefs/btree_update.c:135 Code: 00 e8 47 29 99 fd 48 6b db 38 4d 8d 64 1c 18 e8 39 29 99 fd 49 8d 7c 24 14 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 7c RSP: 0018:ffffc900034ae568 EFLAGS: 00010203 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc900039e1000 RDX: 0000000000000002 RSI: ffffffff83f4c317 RDI: 0000000000000014 RBP: ffffc900034ae880 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000009 R12: 0000000000000000 R13: 1ffff92000695cbe R14: ffffc900034aebf0 R15: ffffc900034aef48 FS: 00007f40713ff6c0(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f09994c2723 CR3: 000000007c192000 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+0x1219/0x1890 fs/bcachefs/btree_update.c:218 bch2_trans_update_extent.isra.0+0x621/0x10d0 fs/bcachefs/btree_update.c:318 bch2_trans_update+0x395/0x5c0 fs/bcachefs/btree_update.c:514 bch2_extent_update+0x405/0xa40 fs/bcachefs/io_write.c:325 bch2_write_index_default+0x8da/0xb70 fs/bcachefs/io_write.c:374 __bch2_write_index+0x5ee/0xa60 fs/bcachefs/io_write.c:527 __bch2_write+0x2703/0x4c70 fs/bcachefs/io_write.c:1498 bch2_write+0x734/0x14d0 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+0x1dff/0x4310 fs/bcachefs/fs-io-direct.c:652 bch2_write_iter+0x10c/0x31a0 fs/bcachefs/fs-io-buffered.c:1135 call_write_iter include/linux/fs.h:2114 [inline] iter_file_splice_write+0x906/0x10b0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x19b/0x6d0 fs/splice.c:1164 splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x17e/0x250 fs/splice.c:1233 do_sendfile+0xb1e/0xe50 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64 fs/read_write.c:1348 [inline] __x64_sys_sendfile64+0x1da/0x220 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f407187cee9 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:00007f40713ff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f40719abf80 RCX: 00007f407187cee9 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000007 RBP: 00007f40718c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000800000009 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f40719abf80 R15: 00007ffd496e00a8 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:bch2_snapshot_has_children fs/bcachefs/snapshot.h:184 [inline] RIP: 0010:__bch2_insert_snapshot_whiteouts+0x3ad/0x1140 fs/bcachefs/btree_update.c:135 Code: 00 e8 47 29 99 fd 48 6b db 38 4d 8d 64 1c 18 e8 39 29 99 fd 49 8d 7c 24 14 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 7c RSP: 0018:ffffc900034ae568 EFLAGS: 00010203 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc900039e1000 RDX: 0000000000000002 RSI: ffffffff83f4c317 RDI: 0000000000000014 RBP: ffffc900034ae880 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000009 R12: 0000000000000000 R13: 1ffff92000695cbe R14: ffffc900034aebf0 R15: ffffc900034aef48 FS: 00007f40713ff6c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4961fa5ba8 CR3: 000000007c192000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 e8 add %ch,%al 2: 47 29 99 fd 48 6b db rex.RXB sub %r11d,-0x2494b703(%r9) 9: 38 4d 8d cmp %cl,-0x73(%rbp) c: 64 1c 18 fs sbb $0x18,%al f: e8 39 29 99 fd call 0xfd99294d 14: 49 8d 7c 24 14 lea 0x14(%r12),%rdi 19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 20: fc ff df 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx <-- trapping instruction 2e: 48 89 f8 mov %rdi,%rax 31: 83 e0 07 and $0x7,%eax 34: 83 c0 03 add $0x3,%eax 37: 38 d0 cmp %dl,%al 39: 7c 08 jl 0x43 3b: 84 d2 test %dl,%dl 3d: 0f .byte 0xf 3e: 85 .byte 0x85 3f: 7c .byte 0x7c