EXT4-fs error (device loop5): ext4_lookup:1856: inode #11: comm syz-executor: iget: bad extra_isize 62855 (inode size 256) ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1544 Read of size 1 at addr ffff88812efd9900 by task syz-executor/520 CPU: 0 PID: 520 Comm: syz-executor Not tainted 5.15.167-syzkaller-android13-5.15.167_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 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_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1544 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1718 __ext4_find_entry+0x2b0/0x1af0 fs/ext4/namei.c:1617 ext4_find_entry+0x24f/0x3a0 fs/ext4/namei.c:1751 ext4_rmdir+0x1b8/0xa80 fs/ext4/namei.c:3207 vfs_rmdir+0x324/0x470 fs/namei.c:4149 incfs_kill_sb+0x113/0x230 fs/incfs/vfs.c:1989 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:0x7fd0a26d7719 Code: Unable to access opcode bytes at RIP 0x7fd0a26d76ef. RSP: 002b:00007ffd71b8b758 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007fd0a274a261 RCX: 00007fd0a26d7719 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000075 R08: 00007ffd71b894f5 R09: 00007ffd71b8ca10 R10: 000000000000000b R11: 0000000000000246 R12: 00007ffd71b8ca10 R13: 00007fd0a274a23c R14: 00000000000247ab R15: 00007ffd71b8dad0 The buggy address belongs to the page: page:ffffea0004bbf640 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x12efd9 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00044bab48 ffffea00049bf848 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 290, ts 145012543970, free_ts 146485038272 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:5779 __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] __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x73/0x1b0 arch/x86/mm/pgtable.c:33 __pte_alloc+0x86/0x350 mm/memory.c:502 copy_pte_range mm/memory.c:1084 [inline] copy_pmd_range mm/memory.c:1219 [inline] copy_pud_range mm/memory.c:1256 [inline] copy_p4d_range mm/memory.c:1280 [inline] copy_page_range+0x28a8/0x2f90 mm/memory.c:1353 dup_mmap kernel/fork.c:659 [inline] dup_mm kernel/fork.c:1521 [inline] copy_mm+0xc7e/0x13e0 kernel/fork.c:1573 copy_process+0x1149/0x3290 kernel/fork.c:2264 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone kernel/fork.c:2788 [inline] __se_sys_clone kernel/fork.c:2772 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2772 x64_sys_call+0x1b0/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57 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 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 mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x40d/0x940 mm/mmap.c:3218 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 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:2904 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 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff88812efd9800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812efd9880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88812efd9900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812efd9980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812efd9a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================