================================================================== BUG: KASAN: null-ptr-deref in f2fs_issue_flush+0x14c/0x890 fs/f2fs/segment.c:-1 Write of size 4 at addr 0000000000000024 by task syz.1.709/3247 CPU: 1 PID: 3247 Comm: syz.1.709 Tainted: G W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 __kasan_report mm/kasan/report.c:439 [inline] kasan_report+0xd8/0x130 mm/kasan/report.c:452 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 f2fs_issue_flush+0x14c/0x890 fs/f2fs/segment.c:-1 f2fs_do_sync_file+0x1293/0x1cf0 fs/f2fs/file.c:385 f2fs_sync_file+0x103/0x150 fs/f2fs/file.c:401 vfs_fsync_range+0x190/0x1a0 fs/sync.c:202 generic_write_sync include/linux/fs.h:2920 [inline] f2fs_file_write_iter+0x5ef/0x2580 fs/f2fs/file.c:4892 call_write_iter include/linux/fs.h:2066 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0x725/0xd60 fs/read_write.c:605 ksys_pwrite64 fs/read_write.c:712 [inline] __do_sys_pwrite64 fs/read_write.c:722 [inline] __se_sys_pwrite64 fs/read_write.c:719 [inline] __x64_sys_pwrite64+0x191/0x220 fs/read_write.c:719 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f39e60d16c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f39e4b39038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f39e6327fa0 RCX: 00007f39e60d16c9 RDX: 0000000000000001 RSI: 0000200000005c80 RDI: 0000000000000005 RBP: 00007f39e6153f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000c00000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f39e6328038 R14: 00007f39e6327fa0 R15: 00007ffcc7266eb8 ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000024 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 124704067 P4D 124704067 PUD 0 Oops: 0002 [#2] PREEMPT SMP KASAN CPU: 1 PID: 3247 Comm: syz.1.709 Tainted: G B D W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 RIP: 0010:arch_atomic_inc fs/f2fs/segment.c:-1 [inline] RIP: 0010:atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline] RIP: 0010:f2fs_issue_flush+0x15d/0x890 fs/f2fs/segment.c:678 Code: c2 5a ff 4c 89 64 24 28 49 83 c4 24 4c 89 e7 be 04 00 00 00 e8 14 b0 94 ff 81 e3 00 04 00 00 0f 85 52 01 00 00 4c 89 64 24 08 41 ff 04 24 4c 8b 74 24 20 4d 8d ae 6c 0c 00 00 4d 89 ec 49 c1 RSP: 0018:ffffc900013c75c0 EFLAGS: 00010246 RAX: ffff888115748000 RBX: 0000000000000000 RCX: 0000000000000282 RDX: ffffc900018dc000 RSI: 000000000007ffff RDI: 0000000000080000 RBP: ffffc900013c76d0 R08: 0000000000000004 R09: 0000000000000003 R10: fffffbfff0d8ee48 R11: 1ffffffff0d8ee48 R12: 0000000000000024 R13: ffffc900013c7620 R14: 0000000000000000 R15: 1ffff92000278ec0 FS: 00007f39e4b396c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000024 CR3: 000000010d88a000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: f2fs_do_sync_file+0x1293/0x1cf0 fs/f2fs/file.c:385 f2fs_sync_file+0x103/0x150 fs/f2fs/file.c:401 vfs_fsync_range+0x190/0x1a0 fs/sync.c:202 generic_write_sync include/linux/fs.h:2920 [inline] f2fs_file_write_iter+0x5ef/0x2580 fs/f2fs/file.c:4892 call_write_iter include/linux/fs.h:2066 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0x725/0xd60 fs/read_write.c:605 ksys_pwrite64 fs/read_write.c:712 [inline] __do_sys_pwrite64 fs/read_write.c:722 [inline] __se_sys_pwrite64 fs/read_write.c:719 [inline] __x64_sys_pwrite64+0x191/0x220 fs/read_write.c:719 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f39e60d16c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f39e4b39038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f39e6327fa0 RCX: 00007f39e60d16c9 RDX: 0000000000000001 RSI: 0000200000005c80 RDI: 0000000000000005 RBP: 00007f39e6153f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000c00000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f39e6328038 R14: 00007f39e6327fa0 R15: 00007ffcc7266eb8 Modules linked in: CR2: 0000000000000024 ---[ end trace b4f7a94d38c5dd34 ]--- RIP: 0010:arch_atomic_inc fs/f2fs/segment.c:-1 [inline] RIP: 0010:atomic_inc include/asm-generic/atomic-instrumented.h:241 [inline] RIP: 0010:f2fs_issue_flush+0x15d/0x890 fs/f2fs/segment.c:678 Code: c2 5a ff 4c 89 64 24 28 49 83 c4 24 4c 89 e7 be 04 00 00 00 e8 14 b0 94 ff 81 e3 00 04 00 00 0f 85 52 01 00 00 4c 89 64 24 08 41 ff 04 24 4c 8b 74 24 20 4d 8d ae 6c 0c 00 00 4d 89 ec 49 c1 RSP: 0018:ffffc9000141f580 EFLAGS: 00010246 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000282 RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000024 RBP: ffffc9000141f690 R08: 0000000000000000 R09: ffffc9000141f5e0 R10: fffff52000283ec2 R11: 1ffff92000283ebc R12: 0000000000000024 R13: ffffc9000141f5e0 R14: 0000000000000000 R15: 1ffff92000283eb8 FS: 00007f39e4b396c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000024 CR3: 000000010d88a000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: c2 5a ff ret $0xff5a 3: 4c 89 64 24 28 mov %r12,0x28(%rsp) 8: 49 83 c4 24 add $0x24,%r12 c: 4c 89 e7 mov %r12,%rdi f: be 04 00 00 00 mov $0x4,%esi 14: e8 14 b0 94 ff call 0xff94b02d 19: 81 e3 00 04 00 00 and $0x400,%ebx 1f: 0f 85 52 01 00 00 jne 0x177 25: 4c 89 64 24 08 mov %r12,0x8(%rsp) * 2a: f0 41 ff 04 24 lock incl (%r12) <-- trapping instruction 2f: 4c 8b 74 24 20 mov 0x20(%rsp),%r14 34: 4d 8d ae 6c 0c 00 00 lea 0xc6c(%r14),%r13 3b: 4d 89 ec mov %r13,%r12 3e: 49 rex.WB 3f: c1 .byte 0xc1