================================================================== 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+0x3a3e/0x4ed0 fs/ext4/extents.c:2961 Read of size 4 at addr ffff888057bb2c18 by task syz-executor/13758 CPU: 1 UID: 0 PID: 13758 Comm: syz-executor Not tainted 6.14.0-syzkaller-03576-g1e1ba8d23dae #0 PREEMPT(full) 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+0x3a3e/0x4ed0 fs/ext4/extents.c:2961 ext4_ext_truncate+0x15a/0x2b0 fs/ext4/extents.c:4466 ext4_truncate+0xa25/0x1220 fs/ext4/inode.c:4221 ext4_evict_inode+0x945/0xfc0 fs/ext4/inode.c:263 evict+0x4f9/0x9b0 fs/inode.c:810 __dentry_kill+0x20d/0x630 fs/dcache.c:643 dput+0x19f/0x2b0 fs/dcache.c:885 ovl_stack_put+0x61/0xa0 fs/overlayfs/util.c:137 ovl_destroy_inode+0xb3/0x160 fs/overlayfs/super.c:200 destroy_inode fs/inode.c:396 [inline] evict+0x7b5/0x9b0 fs/inode.c:834 __dentry_kill+0x20d/0x630 fs/dcache.c:643 shrink_kill+0xa9/0x2c0 fs/dcache.c:1088 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1115 shrink_dcache_parent+0xcd/0x3c0 fs/dcache.c:-1 do_one_tree+0x23/0xe0 fs/dcache.c:1578 shrink_dcache_for_umount+0xb4/0x180 fs/dcache.c:1595 generic_shutdown_super+0x6a/0x2d0 fs/super.c:620 kill_anon_super+0x3b/0x70 fs/super.c:1237 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x422/0x4c0 fs/namespace.c:1435 task_work_run+0x251/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/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f18b618e497 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffd65dc9dc8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f18b618e497 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd65dc9e80 RBP: 00007ffd65dc9e80 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffd65dcaf70 R13: 00007f18b620e08c R14: 0000000000076cd1 R15: 00007ffd65dcc040 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x136d pfn:0x57bb2 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 000000000000136d 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 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 14622, tgid 14620 (syz.5.813), ts 477550204947, free_ts 480326594373 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+0x368a/0x37d0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x2c5/0x7b0 mm/page_alloc.c:4740 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 folio_alloc_mpol_noprof+0x36/0x70 mm/mempolicy.c:2320 shmem_alloc_folio mm/shmem.c:1863 [inline] shmem_alloc_and_add_folio+0x490/0x1070 mm/shmem.c:1902 shmem_get_folio_gfp+0x655/0x1800 mm/shmem.c:2545 shmem_get_folio mm/shmem.c:2651 [inline] shmem_write_begin+0x17e/0x3a0 mm/shmem.c:3301 generic_perform_write+0x329/0xa10 mm/filemap.c:4102 shmem_file_write_iter+0xf9/0x120 mm/shmem.c:3477 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x70f/0xd10 fs/read_write.c:684 ksys_write+0x19d/0x2d0 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 13821 tgid 13821 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe5b/0x18d0 mm/page_alloc.c:2707 folios_put_refs+0x779/0x880 mm/swap.c:994 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x595/0x1820 mm/shmem.c:1112 shmem_truncate_range mm/shmem.c:1224 [inline] shmem_evict_inode+0x29d/0xa80 mm/shmem.c:1352 evict+0x4f9/0x9b0 fs/inode.c:810 __dentry_kill+0x20d/0x630 fs/dcache.c:643 dput+0x19f/0x2b0 fs/dcache.c:885 __fput+0x60b/0x9f0 fs/file_table.c:473 task_work_run+0x251/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/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888057bb2b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888057bb2b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888057bb2c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888057bb2c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888057bb2d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================