RAX: ffffffffffffffda RBX: 00007f8bf6341fa0 RCX: 00007f8bf6106379 RDX: 0000000000000040 RSI: 0000000000141242 RDI: 0000200000000140 RBP: 00007f8bf6199d68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8bf6342038 R14: 00007f8bf6341fa0 R15: 00007ffc2395b158 ================================================================== BUG: KASAN: use-after-free in f2fs_truncate_data_blocks_range+0x800/0xeb0 fs/f2fs/file.c:640 Read of size 4 at addr ffff888112bd7000 by task syz.2.17/479 CPU: 0 PID: 479 Comm: syz.2.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x10f/0x150 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 f2fs_truncate_data_blocks_range+0x800/0xeb0 fs/f2fs/file.c:640 f2fs_truncate_data_blocks+0xf3/0x130 fs/f2fs/file.c:697 truncate_dnode fs/f2fs/node.c:950 [inline] f2fs_truncate_inode_blocks+0x644/0xfa0 fs/f2fs/node.c:1169 f2fs_do_truncate_blocks+0x84c/0xba0 fs/f2fs/file.c:786 f2fs_truncate_blocks+0x10b/0x310 fs/f2fs/file.c:814 f2fs_truncate+0x1d6/0x3d0 fs/f2fs/file.c:866 f2fs_setattr+0xaeb/0x11c0 fs/f2fs/file.c:1044 notify_change+0xc30/0xf40 fs/attr.c:505 do_truncate+0x1ac/0x240 fs/open.c:66 handle_truncate fs/namei.c:3273 [inline] do_open fs/namei.c:3620 [inline] path_openat+0x28ce/0x2f80 fs/namei.c:3750 do_filp_open+0x1df/0x400 fs/namei.c:3777 do_sys_openat2+0x15e/0x7f0 fs/open.c:1236 do_sys_open fs/open.c:1252 [inline] __do_sys_open fs/open.c:1260 [inline] __se_sys_open fs/open.c:1256 [inline] __x64_sys_open+0x11c/0x140 fs/open.c:1256 x64_sys_call+0x3fc/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:3 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f8bf6106379 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8bf5f6b028 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f8bf6341fa0 RCX: 00007f8bf6106379 RDX: 0000000000000040 RSI: 0000000000141242 RDI: 0000200000000140 RBP: 00007f8bf6199d68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8bf6342038 R14: 00007f8bf6341fa0 R15: 00007ffc2395b158 The buggy address belongs to the page: page:ffffea00044af5c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x112bd7 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00044afd08 ffffea000469a0c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x101c40(GFP_NOFS|__GFP_HARDWALL|__GFP_WRITE), pid 479, ts 40778275182, free_ts 40779119389 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2607 prep_new_page+0x1c/0x110 mm/page_alloc.c:2613 get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4487 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5824 __alloc_pages_node include/linux/gfp.h:595 [inline] alloc_pages_node include/linux/gfp.h:609 [inline] alloc_pages include/linux/gfp.h:622 [inline] __page_cache_alloc include/linux/pagemap.h:305 [inline] pagecache_get_page+0xacc/0xdd0 mm/filemap.c:1955 f2fs_pagecache_get_page fs/f2fs/f2fs.h:2764 [inline] f2fs_write_begin+0x300/0x2300 fs/f2fs/data.c:3574 generic_perform_write+0x2b7/0x690 mm/filemap.c:3887 f2fs_buffered_write_iter fs/f2fs/file.c:4577 [inline] f2fs_file_write_iter+0xeb5/0x29f0 fs/f2fs/file.c:4802 do_iter_readv_writev+0x477/0x5f0 fs/read_write.c:-1 do_iter_write+0x207/0x7b0 fs/read_write.c:855 vfs_writev+0x2df/0x570 fs/read_write.c:928 do_writev+0x14e/0x2c0 fs/read_write.c:971 __do_sys_writev fs/read_write.c:1044 [inline] __se_sys_writev fs/read_write.c:1041 [inline] __x64_sys_writev+0x7d/0x90 fs/read_write.c:1041 x64_sys_call+0x974/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:21 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1474 [inline] free_pcp_prepare mm/page_alloc.c:1546 [inline] free_unref_page_prepare+0x5fa/0x600 mm/page_alloc.c:3536 free_unref_page_list+0x138/0x9e0 mm/page_alloc.c:3673 release_pages+0x1264/0x12c0 mm/swap.c:1015 __pagevec_release+0x71/0xe0 mm/swap.c:1035 pagevec_release include/linux/pagevec.h:81 [inline] truncate_inode_pages_range+0x358/0xe50 mm/truncate.c:332 truncate_inode_pages mm/truncate.c:428 [inline] truncate_pagecache mm/truncate.c:743 [inline] truncate_setsize+0xbd/0xe0 mm/truncate.c:768 f2fs_setattr+0xaa9/0x11c0 fs/f2fs/file.c:1041 notify_change+0xc30/0xf40 fs/attr.c:505 do_truncate+0x1ac/0x240 fs/open.c:66 handle_truncate fs/namei.c:3273 [inline] do_open fs/namei.c:3620 [inline] path_openat+0x28ce/0x2f80 fs/namei.c:3750 do_filp_open+0x1df/0x400 fs/namei.c:3777 do_sys_openat2+0x15e/0x7f0 fs/open.c:1236 do_sys_open fs/open.c:1252 [inline] __do_sys_open fs/open.c:1260 [inline] __se_sys_open fs/open.c:1256 [inline] __x64_sys_open+0x11c/0x140 fs/open.c:1256 x64_sys_call+0x3fc/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:3 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff888112bd6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888112bd6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888112bd7000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888112bd7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888112bd7100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== F2FS-fs (loop2): Inconsistent i_blocks, ino:7, iblocks:0, sectors:8 F2FS-fs (loop2): dec_valid_node_count: inconsistent i_blocks, ino:7, iblocks:0