EXT4-fs error (device loop2): ext4_lookup:1828: inode #11: comm syz-executor: iget: bad extra_isize 21852 (inode size 256) EXT4-fs error (device loop2): ext4_lookup:1828: inode #11: comm syz-executor: iget: bad extra_isize 21852 (inode size 256) ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 Read of size 1 at addr ffff888124e8e85f by task syz-executor/286 CPU: 1 PID: 286 Comm: syz-executor Not tainted 5.10.226-syzkaller-00001-g6a01908517df #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1700 __ext4_find_entry+0x2b0/0x1990 fs/ext4/namei.c:1589 ext4_find_entry+0x24f/0x3a0 fs/ext4/namei.c:1723 ext4_rmdir+0x1b8/0xa70 fs/ext4/namei.c:3319 vfs_rmdir+0x2b7/0x3f0 fs/namei.c:3852 incfs_kill_sb+0x108/0x220 fs/incfs/vfs.c:1973 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:189 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc83/0x2a50 kernel/exit.c:863 do_group_exit+0x141/0x310 kernel/exit.c:985 __do_sys_exit_group kernel/exit.c:996 [inline] __se_sys_exit_group kernel/exit.c:994 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:994 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f8aa0a25719 Code: Unable to access opcode bytes at RIP 0x7f8aa0a256ef. RSP: 002b:00007ffe3730fdb8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f8aa0a98621 RCX: 00007f8aa0a25719 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000075 R08: 00007ffe3730db55 R09: 00007ffe37311070 R10: 000000000000000b R11: 0000000000000246 R12: 00007ffe37311070 R13: 00007f8aa0a985fc R14: 000000000000cf40 R15: 00007ffe37312130 The buggy address belongs to the page: page:ffffea000493a380 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x124e8e flags: 0x4000000000000000() raw: 4000000000000000 ffffea00049ef1c8 ffffea000493a3c8 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 0x8100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|0x8000000), pid 1182, ts 53142459220, free_ts 53229642786 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 __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] wp_page_copy+0x201/0x1940 mm/memory.c:3138 do_wp_page+0x71b/0xca0 handle_pte_fault+0x165d/0x3e10 mm/memory.c:4789 ___handle_speculative_fault mm/memory.c:5191 [inline] __handle_speculative_fault+0x1370/0x1e90 mm/memory.c:5240 handle_speculative_fault include/linux/mm.h:1838 [inline] do_user_addr_fault arch/x86/mm/fault.c:1285 [inline] handle_page_fault arch/x86/mm/fault.c:1428 [inline] exc_page_fault+0x234/0x5b0 arch/x86/mm/fault.c:1484 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:571 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+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356 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+0x177/0x320 mm/mmu_gather.c:326 exit_mmap+0x312/0x5c0 mm/mmap.c:3357 __mmput+0x95/0x2d0 kernel/fork.c:1153 mmput+0x59/0x170 kernel/fork.c:1176 exit_mm kernel/exit.c:539 [inline] do_exit+0xbda/0x2a50 kernel/exit.c:850 do_group_exit+0x141/0x310 kernel/exit.c:985 get_signal+0x10a0/0x1410 kernel/signal.c:2790 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xa2/0x1a0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888124e8e700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888124e8e780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888124e8e800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888124e8e880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888124e8e900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================