RSP: 002b:00007fb7e73de028 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fb7e7816090 RCX: 00007fb7e759aeb9 RDX: 0000000000000006 RSI: 000000000014927e RDI: 00002000000000c0 RBP: 00007fb7e7608c1f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb7e7816128 R14: 00007fb7e7816090 R15: 00007ffd730746a8 ================================================================== BUG: KASAN: use-after-free in f2fs_truncate_data_blocks_range+0x714/0xef0 fs/f2fs/file.c:677 Read of size 4 at addr ffff88811e064000 by task syz.2.17/489 CPU: 1 PID: 489 Comm: syz.2.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 f2fs_truncate_data_blocks_range+0x714/0xef0 fs/f2fs/file.c:677 f2fs_truncate_data_blocks+0xf3/0x130 fs/f2fs/file.c:708 truncate_dnode fs/f2fs/node.c:967 [inline] f2fs_truncate_inode_blocks+0x85b/0xff0 fs/f2fs/node.c:1186 f2fs_do_truncate_blocks+0x6b3/0xcc0 fs/f2fs/file.c:798 f2fs_truncate_blocks+0x10b/0x310 fs/f2fs/file.c:826 f2fs_truncate+0x1d6/0x3d0 fs/f2fs/file.c:876 f2fs_setattr+0xcab/0x1320 fs/f2fs/file.c:1098 notify_change+0xd33/0x1030 fs/attr.c:499 do_truncate+0x1ac/0x240 fs/open.c:66 handle_truncate fs/namei.c:3292 [inline] do_open fs/namei.c:3637 [inline] path_openat+0x2881/0x2f30 fs/namei.c:3790 do_filp_open+0x1ee/0x420 fs/namei.c:3817 do_sys_openat2+0x15e/0x820 fs/open.c:1343 do_sys_open fs/open.c:1359 [inline] __do_sys_open fs/open.c:1367 [inline] __se_sys_open fs/open.c:1363 [inline] __x64_sys_open+0x11c/0x140 fs/open.c:1363 x64_sys_call+0x97b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:3 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fb7e759aeb9 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:00007fb7e73de028 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fb7e7816090 RCX: 00007fb7e759aeb9 RDX: 0000000000000006 RSI: 000000000014927e RDI: 00002000000000c0 RBP: 00007fb7e7608c1f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb7e7816128 R14: 00007fb7e7816090 R15: 00007ffd730746a8 The buggy address belongs to the physical page: page:ffffea0004781900 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11e064 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea000476e848 ffffea0004781948 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 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 470, tgid 470 (syz-executor), ts 42653989638, free_ts 42769253652 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2673 prep_new_page+0x1c/0x110 mm/page_alloc.c:2680 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4587 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5931 vm_area_alloc_pages mm/vmalloc.c:-1 [inline] __vmalloc_area_node mm/vmalloc.c:3084 [inline] __vmalloc_node_range+0x8ca/0x1440 mm/vmalloc.c:3256 vmalloc_user+0x73/0x80 mm/vmalloc.c:3410 kcov_ioctl+0x57/0x610 kernel/kcov.c:713 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0x12f/0x1b0 fs/ioctl.c:856 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856 x64_sys_call+0x58b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1581 [inline] free_pcp_prepare mm/page_alloc.c:1655 [inline] free_unref_page_prepare+0x81b/0x820 mm/page_alloc.c:3622 free_unref_page+0x93/0x530 mm/page_alloc.c:3720 free_the_page mm/page_alloc.c:863 [inline] __free_pages+0x67/0x100 mm/page_alloc.c:6021 __vunmap+0xa3c/0xc00 mm/vmalloc.c:2739 __vfree mm/vmalloc.c:2788 [inline] vfree+0x61/0x90 mm/vmalloc.c:2819 kcov_put kernel/kcov.c:437 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:533 __fput+0x1fd/0x8f0 fs/file_table.c:320 ____fput+0x15/0x20 fs/file_table.c:348 task_work_run+0x1e1/0x250 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0xb0d/0x29f0 kernel/exit.c:896 do_group_exit+0x21b/0x2e0 kernel/exit.c:1040 get_signal+0x167c/0x1700 kernel/signal.c:2904 arch_do_signal_or_restart+0xd1/0x11c0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x7a/0xb0 kernel/entry/common.c:174 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:303 Memory state around the buggy address: ffff88811e063f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811e063f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811e064000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811e064080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811e064100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== F2FS-fs (loop2): dec_valid_node_count: inconsistent i_blocks, ino:7, iblocks:0