EXT4-fs error (device loop2): 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 loop2): 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+0x3bb4/0x4a60 fs/ext4/extents.c:2937 Read of size 4 at addr ffff888123e1ba50 by task syz-executor/477 CPU: 0 PID: 477 Comm: syz-executor Not tainted 5.15.178-syzkaller-1079394-g760764029c6d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 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+0x3bb4/0x4a60 fs/ext4/extents.c:2937 ext4_ext_truncate+0x19a/0x240 fs/ext4/extents.c:4471 ext4_truncate+0x96c/0xfa0 fs/ext4/inode.c:4280 ext4_evict_inode+0xcee/0x14e0 fs/ext4/inode.c:290 evict+0x529/0x930 fs/inode.c:647 iput_final fs/inode.c:1769 [inline] iput+0x63b/0x7e0 fs/inode.c:1795 dentry_unlink_inode+0x34e/0x430 fs/dcache.c:380 __dentry_kill+0x447/0x660 fs/dcache.c:586 shrink_dentry_list+0x35e/0x4b0 fs/dcache.c:1181 shrink_dcache_parent+0xc9/0x340 fs/dcache.c:-1 do_one_tree+0x27/0xe0 fs/dcache.c:1662 shrink_dcache_for_umount+0x7d/0x120 fs/dcache.c:1679 generic_shutdown_super+0x66/0x330 fs/super.c:447 kill_block_super+0x7e/0xe0 fs/super.c:1427 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1143 __cleanup_mnt+0x19/0x20 fs/namespace.c:1150 task_work_run+0x129/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc48/0x2ca0 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+0x610/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f15f6e3e169 Code: Unable to access opcode bytes at RIP 0x7f15f6e3e13f. RSP: 002b:00007ffeb7c2b8c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f15f6ebf0b1 RCX: 00007f15f6e3e169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000075 R08: 00007ffeb7c29665 R09: 00007ffeb7c2cb80 R10: 000000000000000b R11: 0000000000000246 R12: 00007ffeb7c2cb80 R13: 00007f15f6ebf08c R14: 000000000000d906 R15: 00007ffeb7c2dc50 The buggy address belongs to the page: page:ffffea00048f86c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x123e1b 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 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 293, ts 27426346700, free_ts 32412156017 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5780 __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_anonymous_page mm/memory.c:4066 [inline] handle_pte_fault+0xec8/0x28f0 mm/memory.c:4906 __handle_mm_fault mm/memory.c:-1 [inline] do_handle_mm_fault+0x20bc/0x2400 mm/memory.c:5330 do_user_addr_fault arch/x86/mm/fault.c:1325 [inline] handle_page_fault arch/x86/mm/fault.c:1509 [inline] exc_page_fault+0x26f/0x7f0 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+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3671 release_pages+0x1310/0x1370 mm/swap.c:1009 free_pages_and_swap_cache+0x8a/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+0xd0/0x180 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1525 [inline] zap_pmd_range mm/memory.c:1574 [inline] zap_pud_range mm/memory.c:1603 [inline] zap_p4d_range mm/memory.c:1624 [inline] unmap_page_range+0x1c70/0x1ed0 mm/memory.c:1645 unmap_single_vma mm/memory.c:1690 [inline] unmap_vmas+0x389/0x560 mm/memory.c:1722 exit_mmap+0x458/0x990 mm/mmap.c:3233 __mmput+0x95/0x310 kernel/fork.c:1180 mmput+0x5b/0x170 kernel/fork.c:1203 exit_mm kernel/exit.c:554 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:867 do_group_exit+0x141/0x310 kernel/exit.c:1002 get_signal+0x7a3/0x1630 kernel/signal.c:2907 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214 Memory state around the buggy address: ffff888123e1b900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888123e1b980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888123e1ba00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888123e1ba80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888123e1bb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 0, count = 0 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 0, count = 1 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 1925, count = 0 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 3289944948736, count = 17152 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 3750265490, count = 0 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 0, count = 384 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 243, count = 0 EXT4-fs error (device loop2): ext4_free_blocks:6223: comm syz-executor: Freeing blocks not in datazone - block = 207794812780540, count = 7945