EXT4-fs error (device loop5): ext4_ext_check_inode:501: inode #17: comm syz-executor: pblk 0 bad header/extent: invalid magic - magic 0, entries 0, max 0(0), depth 0(0) EXT4-fs error (device loop5): ext4_ext_check_inode:501: inode #17: comm syz-executor: pblk 0 bad header/extent: invalid magic - magic 0, entries 0, max 0(0), depth 0(0) ================================================================== BUG: KASAN: use-after-free in ext4_ext_rm_leaf fs/ext4/extents.c:2599 [inline] BUG: KASAN: use-after-free in ext4_ext_remove_space+0x3536/0x4180 fs/ext4/extents.c:2937 Read of size 4 at addr ffff88812a535c94 by task syz-executor/509 CPU: 0 PID: 509 Comm: syz-executor Not tainted 5.15.185-syzkaller-1080761-g5cf73bface18 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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:2599 [inline] ext4_ext_remove_space+0x3536/0x4180 fs/ext4/extents.c:2937 ext4_ext_truncate+0x1a3/0x250 fs/ext4/extents.c:4471 ext4_truncate+0x9a6/0xfa0 fs/ext4/inode.c:4281 ext4_evict_inode+0xcb9/0x1450 fs/ext4/inode.c:290 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 shrink_dentry_list+0x38e/0x500 fs/dcache.c:1181 shrink_dcache_parent+0xa3/0x250 fs/dcache.c:-1 do_one_tree+0x27/0xe0 fs/dcache.c:1662 shrink_dcache_for_umount+0x6a/0x110 fs/dcache.c:1679 generic_shutdown_super+0x66/0x330 fs/super.c:447 kill_block_super+0x7f/0xf0 fs/super.c:1427 deactivate_locked_super+0xa0/0x100 fs/super.c:335 deactivate_super+0xaf/0xe0 fs/super.c:366 cleanup_mnt+0x446/0x500 fs/namespace.c:1139 __cleanup_mnt+0x19/0x20 fs/namespace.c:1146 task_work_run+0x127/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xa76/0x27a0 kernel/exit.c:880 do_group_exit+0x141/0x310 kernel/exit.c:1002 __do_sys_exit_group kernel/exit.c:1013 [inline] __se_sys_exit_group kernel/exit.c:1011 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1011 x64_sys_call+0x832/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 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:0x7f8410888169 Code: Unable to access opcode bytes at RIP 0x7f841088813f. RSP: 002b:00007ffc098f9268 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f84109090b1 RCX: 00007f8410888169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000075 R08: 00007ffc098f7005 R09: 00007ffc098fa520 R10: 000000000000000b R11: 0000000000000246 R12: 00007ffc098fa520 R13: 00007f841090908c R14: 000000000000d824 R15: 00007ffc098fb5f0 The buggy address belongs to the page: page:ffffea0004a94d40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12a535 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004a94d88 ffffea0004a94d08 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 493, ts 53749276207, free_ts 54526830113 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:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] do_cow_fault mm/memory.c:4581 [inline] do_fault mm/memory.c:4699 [inline] handle_pte_fault+0x98a/0x2680 mm/memory.c:4911 __handle_mm_fault mm/memory.c:-1 [inline] do_handle_mm_fault+0x1a6d/0x1d50 mm/memory.c:5333 handle_mm_fault include/linux/mm.h:1836 [inline] do_user_addr_fault+0x841/0x1180 arch/x86/mm/fault.c:1418 handle_page_fault arch/x86/mm/fault.c:1509 [inline] exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1565 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:606 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 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x175/0x300 mm/mmu_gather.c:338 exit_mmap+0x40f/0x860 mm/mmap.c:3236 __mmput+0x93/0x320 kernel/fork.c:1180 mmput+0x50/0x150 kernel/fork.c:1203 exit_mm kernel/exit.c:554 [inline] do_exit+0x9ca/0x27a0 kernel/exit.c:867 do_group_exit+0x141/0x310 kernel/exit.c:1002 __do_sys_exit_group kernel/exit.c:1013 [inline] __se_sys_exit_group kernel/exit.c:1011 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1011 x64_sys_call+0x832/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 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 Memory state around the buggy address: ffff88812a535b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812a535c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88812a535c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812a535d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812a535d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop5): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 0, count = 7