================================================================== BUG: KASAN: use-after-free in ext4_ext_rm_leaf fs/ext4/extents.c:2596 [inline] BUG: KASAN: use-after-free in ext4_ext_remove_space+0x3a6a/0x4920 fs/ext4/extents.c:2934 Read of size 4 at addr ffff888178596c18 by task syz-executor/12437 CPU: 1 PID: 12437 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_rm_leaf fs/ext4/extents.c:2596 [inline] ext4_ext_remove_space+0x3a6a/0x4920 fs/ext4/extents.c:2934 ext4_ext_truncate+0x169/0x1f0 fs/ext4/extents.c:4467 ext4_truncate+0xaea/0x1290 fs/ext4/inode.c:4367 ext4_evict_inode+0xf4f/0x1760 fs/ext4/inode.c:290 evict+0x478/0x910 fs/inode.c:612 iput_final fs/inode.c:1736 [inline] iput+0x638/0x7c0 fs/inode.c:1762 do_unlinkat+0x33f/0x670 fs/namei.c:4042 __do_sys_unlink fs/namei.c:4082 [inline] __se_sys_unlink fs/namei.c:4080 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4080 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fa08f39e197 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:00007ffc2642b588 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa08f39e197 RDX: 00007ffc2642b5b0 RSI: 00007ffc2642b640 RDI: 00007ffc2642b640 RBP: 00007ffc2642b640 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000206 R12: 00007ffc2642c730 R13: 00007fa08f421c05 R14: 0000000000078625 R15: 00007ffc2642d800 The buggy address belongs to the page: page:ffffea0005e16580 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x178596 flags: 0x4000000000000000() raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000001 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 0x100cca(GFP_HIGHUSER_MOVABLE), pid 9036, ts 327582817991, free_ts 328212313803 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5370 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] shmem_alloc_page+0x1b1/0x300 mm/shmem.c:1584 shmem_alloc_and_acct_page+0x36f/0x7b0 mm/shmem.c:1609 shmem_getpage_gfp+0x625/0x2110 mm/shmem.c:1922 shmem_getpage mm/shmem.c:165 [inline] shmem_fallocate+0x817/0xc20 mm/shmem.c:2824 vfs_fallocate+0x4b4/0x590 fs/open.c:310 ksys_fallocate fs/open.c:333 [inline] __do_sys_fallocate fs/open.c:341 [inline] __se_sys_fallocate fs/open.c:339 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:339 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2b7/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x12e/0x9b0 mm/page_alloc.c:3443 release_pages+0xe38/0xe80 mm/swap.c:1103 __pagevec_release+0x71/0xe0 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x6e1/0x1760 mm/shmem.c:969 shmem_truncate_range mm/shmem.c:1073 [inline] shmem_evict_inode+0x1fd/0x9c0 mm/shmem.c:1173 evict+0x478/0x910 fs/inode.c:612 iput_final fs/inode.c:1736 [inline] iput+0x638/0x7c0 fs/inode.c:1762 do_unlinkat+0x33f/0x670 fs/namei.c:4042 __do_sys_unlink fs/namei.c:4082 [inline] __se_sys_unlink fs/namei.c:4080 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4080 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888178596b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888178596b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888178596c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888178596c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888178596d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================