EXT4-fs (loop5): pa ffff888135d047e0: logic 128, phys. 385, len 8 EXT4-fs error (device loop5): ext4_mb_release_inode_pa:4893: group 0, free 0, pa_free 1 EXT4-fs (loop5): Remounting filesystem read-only ================================================================== BUG: KASAN: use-after-free in ext4_ext_rm_leaf fs/ext4/extents.c:2601 [inline] BUG: KASAN: use-after-free in ext4_ext_remove_space+0x353c/0x4180 fs/ext4/extents.c:2939 Read of size 4 at addr ffff888136d31c18 by task syz.5.624/2711 CPU: 0 PID: 2711 Comm: syz.5.624 Not tainted 5.15.189-syzkaller-android13-5.15.189_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 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+0xf1/0x140 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_rm_leaf fs/ext4/extents.c:2601 [inline] ext4_ext_remove_space+0x353c/0x4180 fs/ext4/extents.c:2939 ext4_ext_truncate+0x1a3/0x250 fs/ext4/extents.c:4473 ext4_truncate+0x9a6/0xfa0 fs/ext4/inode.c:4281 ext4_truncate_failed_write fs/ext4/truncate.h:22 [inline] ext4_write_begin+0xab2/0x1220 fs/ext4/inode.c:1276 ext4_da_write_begin+0x2fa/0xb60 fs/ext4/inode.c:2988 generic_perform_write+0x2ad/0x670 mm/filemap.c:3869 ext4_buffered_write_iter+0x4ed/0x670 fs/ext4/file.c:270 ext4_file_write_iter+0x18c/0x14c0 fs/ext4/file.c:664 call_write_iter include/linux/fs.h:2212 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x802/0xf70 fs/read_write.c:594 ksys_write+0x140/0x240 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 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:0x7fdd2904dbe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdd27ab6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdd29274fa0 RCX: 00007fdd2904dbe9 RDX: 000000000208e24b RSI: 0000200000000040 RDI: 0000000000000004 RBP: 00007fdd290d0e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdd29275038 R14: 00007fdd29274fa0 R15: 00007ffedf153b98 The buggy address belongs to the page: page:ffffea0004db4c40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x136d31 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000100 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 1963, ts 141667898909, free_ts 141855001812 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5795 __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] shmem_alloc_page mm/shmem.c:1591 [inline] shmem_alloc_and_acct_page+0x42b/0x870 mm/shmem.c:1616 shmem_getpage_gfp+0xfe5/0x2310 mm/shmem.c:1912 shmem_getpage mm/shmem.c:156 [inline] shmem_write_begin+0xce/0x1b0 mm/shmem.c:2480 generic_perform_write+0x2ad/0x670 mm/filemap.c:3869 __generic_file_write_iter+0x268/0x480 mm/filemap.c:3997 generic_file_write_iter+0xa9/0x1d0 mm/filemap.c:4029 call_write_iter include/linux/fs.h:2212 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x802/0xf70 fs/read_write.c:594 ksys_write+0x140/0x240 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 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:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534 free_unref_page_list+0x134/0x9d0 mm/page_alloc.c:3671 release_pages+0xfda/0x1030 mm/swap.c:1014 __pagevec_release+0x71/0xe0 mm/swap.c:1034 pagevec_release include/linux/pagevec.h:81 [inline] shmem_undo_range+0x53f/0x13d0 mm/shmem.c:969 shmem_truncate_range mm/shmem.c:1068 [inline] shmem_evict_inode+0x1fd/0x9c0 mm/shmem.c:1150 evict+0x485/0x870 fs/inode.c:650 iput_final fs/inode.c:1779 [inline] iput+0x635/0x7c0 fs/inode.c:1805 dentry_unlink_inode+0x32f/0x3e0 fs/dcache.c:380 __dentry_kill+0x44f/0x650 fs/dcache.c:586 dentry_kill+0xc0/0x2a0 fs/dcache.c:-1 dput+0x47/0x90 fs/dcache.c:893 __fput+0x580/0x8b0 fs/file_table.c:319 ____fput+0x15/0x20 fs/file_table.c:339 task_work_run+0x127/0x190 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xd0/0xe0 kernel/entry/common.c:181 Memory state around the buggy address: ffff888136d31b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888136d31b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888136d31c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888136d31c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888136d31d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================