================================================================== BUG: KASAN: use-after-free in ext4_ext_rm_leaf fs/ext4/extents.c:2623 [inline] BUG: KASAN: use-after-free in ext4_ext_remove_space+0x39bd/0x4e50 fs/ext4/extents.c:2961 Read of size 4 at addr ffff88804bff7c18 by task syz-executor/6227 CPU: 1 UID: 0 PID: 6227 Comm: syz-executor Not tainted 6.14.0-rc6-syzkaller-00016-g0fed89a961ea #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 ext4_ext_rm_leaf fs/ext4/extents.c:2623 [inline] ext4_ext_remove_space+0x39bd/0x4e50 fs/ext4/extents.c:2961 ext4_ext_truncate+0x159/0x2b0 fs/ext4/extents.c:4466 ext4_truncate+0xa1b/0x11c0 fs/ext4/inode.c:4217 ext4_evict_inode+0x90f/0xf50 fs/ext4/inode.c:263 evict+0x4e8/0x9a0 fs/inode.c:796 do_unlinkat+0x512/0x830 fs/namei.c:4596 __do_sys_unlink fs/namei.c:4637 [inline] __se_sys_unlink fs/namei.c:4635 [inline] __x64_sys_unlink+0x47/0x50 fs/namei.c:4635 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fbde258c717 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 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:00007fff055d0238 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbde258c717 RDX: 00007fff055d0260 RSI: 00007fff055d02f0 RDI: 00007fff055d02f0 RBP: 00007fff055d02f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000206 R12: 00007fff055d13e0 R13: 00007fbde260e08c R14: 000000000002b53b R15: 00007fff055d24b0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x10 pfn:0x4bff7 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000010 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x141cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_WRITE), pid 8087, tgid 8086 (syz.5.190), ts 175757642737, free_ts 175888146047 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4740 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_frozen_pages_noprof mm/mempolicy.c:2341 [inline] alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2361 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2371 filemap_alloc_folio_noprof+0xe1/0x540 mm/filemap.c:1019 __filemap_get_folio+0x438/0xae0 mm/filemap.c:1970 ext4_write_begin+0x32a/0x1280 fs/ext4/inode.c:1182 ext4_da_write_begin+0x300/0xa60 fs/ext4/inode.c:2925 generic_perform_write+0x346/0x990 mm/filemap.c:4188 ext4_buffered_write_iter+0xc7/0x390 fs/ext4/file.c:299 ext4_file_write_iter+0x88f/0x1ce0 do_iter_readv_writev+0x71a/0x9d0 vfs_writev+0x38b/0xbc0 fs/read_write.c:1050 do_pwritev fs/read_write.c:1146 [inline] __do_sys_pwritev2 fs/read_write.c:1204 [inline] __se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195 page last free pid 6138 tgid 6138 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe2f/0x18a0 mm/page_alloc.c:2707 folios_put_refs+0x76c/0x860 mm/swap.c:994 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x460/0x10e0 mm/truncate.c:330 ext4_evict_inode+0x1cc/0xf50 fs/ext4/inode.c:187 evict+0x4e8/0x9a0 fs/inode.c:796 dispose_list fs/inode.c:845 [inline] evict_inodes+0x6f6/0x790 fs/inode.c:899 generic_shutdown_super+0xa0/0x2d0 fs/super.c:627 kill_block_super+0x44/0x90 fs/super.c:1710 ext4_kill_sb+0x68/0xa0 fs/ext4/super.c:7368 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1413 task_work_run+0x24f/0x310 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x13f/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804bff7b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804bff7b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804bff7c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804bff7c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804bff7d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================