attempt to access beyond end of device loop4: rw=2049, want=53256, limit=40427 attempt to access beyond end of device loop4: rw=2049, want=53304, limit=40427 general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 2087 Comm: syz.4.457 Tainted: G W 5.10.240-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2914 [inline] RIP: 0010:update_sit_entry+0x58e/0xf50 fs/f2fs/segment.c:2339 Code: 00 00 49 8d 5d 18 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 20 17 94 ff 48 8b 1b 48 03 5d a8 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 ab 08 00 00 44 0f b6 33 44 89 f0 44 8b RSP: 0018:ffffc90000ba6630 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000002 RDX: ffff888111b762c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000ba66b0 R08: ffff888111b762c0 R09: 0000000000000003 R10: 00000000ffffffff R11: 0000000000000002 R12: dffffc0000000000 R13: ffff88810e4f7078 R14: ffff888112e880c0 R15: ffff888112e88000 FS: 00007f9d85c496c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000110c2ae052 CR3: 000000011146d000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: f2fs_allocate_data_block+0x156b/0x3a10 fs/f2fs/segment.c:3481 do_write_page+0x2bb/0x810 fs/f2fs/segment.c:3569 f2fs_outplace_write_data+0xf6/0x240 fs/f2fs/segment.c:3635 f2fs_do_write_data_page+0xad4/0x11d0 fs/f2fs/data.c:2710 f2fs_write_single_data_page+0xde2/0x1650 fs/f2fs/data.c:2833 f2fs_write_cache_pages fs/f2fs/data.c:3084 [inline] __f2fs_write_data_pages fs/f2fs/data.c:3234 [inline] f2fs_write_data_pages+0x193c/0x28f0 fs/f2fs/data.c:3261 do_writepages+0x12a/0x270 mm/page-writeback.c:2380 __filemap_fdatawrite_range+0x2bc/0x360 mm/filemap.c:427 file_write_and_wait_range+0x8c/0x110 mm/filemap.c:766 f2fs_do_sync_file+0x3c7/0x1cf0 fs/f2fs/file.c:284 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 do_iter_readv_writev+0x491/0x600 fs/read_write.c:-1 do_iter_write+0x189/0x630 fs/read_write.c:866 vfs_writev+0x293/0x4f0 fs/read_write.c:939 do_pwritev fs/read_write.c:1036 [inline] __do_sys_pwritev2 fs/read_write.c:1095 [inline] __se_sys_pwritev2+0x1a9/0x2b0 fs/read_write.c:1086 __x64_sys_pwritev2+0xbf/0xd0 fs/read_write.c:1086 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f9d871e0be9 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:00007f9d85c49038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f9d87407fa0 RCX: 00007f9d871e0be9 RDX: 0000000000000001 RSI: 0000200000000100 RDI: 000000000000000a RBP: 00007f9d87263e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000005405 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9d87408038 R14: 00007f9d87407fa0 R15: 00007fff894cf078 Modules linked in: ---[ end trace 1e78f5011346fc60 ]--- RIP: 0010:f2fs_test_and_set_bit fs/f2fs/f2fs.h:2914 [inline] RIP: 0010:update_sit_entry+0x58e/0xf50 fs/f2fs/segment.c:2339 Code: 00 00 49 8d 5d 18 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 20 17 94 ff 48 8b 1b 48 03 5d a8 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 ab 08 00 00 44 0f b6 33 44 89 f0 44 8b RSP: 0018:ffffc90000ba6630 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000002 RDX: ffff888111b762c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000ba66b0 R08: ffff888111b762c0 R09: 0000000000000003 R10: 00000000ffffffff R11: 0000000000000002 R12: dffffc0000000000 R13: ffff88810e4f7078 R14: ffff888112e880c0 R15: ffff888112e88000 FS: 00007f9d85c496c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe38aa65198 CR3: 000000011146d000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 49 8d 5d 18 lea 0x18(%r13),%rbx 6: 48 89 d8 mov %rbx,%rax 9: 48 c1 e8 03 shr $0x3,%rax d: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) 12: 74 08 je 0x1c 14: 48 89 df mov %rbx,%rdi 17: e8 20 17 94 ff call 0xff94173c 1c: 48 8b 1b mov (%rbx),%rbx 1f: 48 03 5d a8 add -0x58(%rbp),%rbx 23: 48 89 d8 mov %rbx,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 ab 08 00 00 jne 0x8e2 37: 44 0f b6 33 movzbl (%rbx),%r14d 3b: 44 89 f0 mov %r14d,%eax 3e: 44 rex.R 3f: 8b .byte 0x8b