loop1: detected capacity change from 1024 to 1023 ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf2/0x1c0 fs/ext4/namei.c:1500 Read of size 1 at addr ffff88805e582a0b by task syz.1.284/8198 CPU: 1 UID: 0 PID: 8198 Comm: syz.1.284 Not tainted 6.11.0-rc6-syzkaller-00308-gb31c44928842 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 ext4_search_dir+0xf2/0x1c0 fs/ext4/namei.c:1500 ext4_find_inline_entry+0x4be/0x5e0 fs/ext4/inline.c:1697 __ext4_find_entry+0x2b4/0x1b30 fs/ext4/namei.c:1573 ext4_lookup_entry fs/ext4/namei.c:1727 [inline] ext4_lookup+0x15f/0x750 fs/ext4/namei.c:1795 lookup_one_qstr_excl+0x11f/0x260 fs/namei.c:1633 filename_create+0x297/0x540 fs/namei.c:3980 do_mkdirat+0xbd/0x3a0 fs/namei.c:4225 __do_sys_mkdirat fs/namei.c:4248 [inline] __se_sys_mkdirat fs/namei.c:4246 [inline] __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4246 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe802f7cef9 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:00007fe803cf1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fe803135f80 RCX: 00007fe802f7cef9 RDX: 0000000000000000 RSI: 0000000020000280 RDI: ffffffffffffff9c RBP: 00007fe802fef046 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe803135f80 R15: 00007ffd225af7f8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7fde373d3 pfn:0x5e582 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 00000007fde373d3 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 7915, tgid 7914 (syz.2.249), ts 255351446701, free_ts 256569859345 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4702 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2263 folio_alloc_mpol_noprof mm/mempolicy.c:2281 [inline] vma_alloc_folio_noprof+0x12e/0x230 mm/mempolicy.c:2312 folio_prealloc+0x31/0x170 alloc_anon_folio mm/memory.c:4498 [inline] do_anonymous_page mm/memory.c:4555 [inline] do_pte_missing mm/memory.c:3945 [inline] handle_pte_fault+0x255e/0x6fc0 mm/memory.c:5521 __handle_mm_fault mm/memory.c:5664 [inline] handle_mm_fault+0x1056/0x1ad0 mm/memory.c:5832 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 7915 tgid 7914 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_folios+0x100f/0x1ac0 mm/page_alloc.c:2667 folios_put_refs+0x76e/0x860 mm/swap.c:1039 free_pages_and_swap_cache+0x2ea/0x690 mm/swap_state.c:332 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:465 unmap_region+0x2df/0x350 mm/mmap.c:2441 do_vmi_align_munmap+0x1122/0x18c0 mm/mmap.c:2754 do_vmi_munmap+0x261/0x2f0 mm/mmap.c:2830 __vm_munmap+0x1fc/0x400 mm/mmap.c:3109 __do_sys_munmap mm/mmap.c:3126 [inline] __se_sys_munmap mm/mmap.c:3123 [inline] __x64_sys_munmap+0x68/0x80 mm/mmap.c:3123 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805e582900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805e582980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805e582a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805e582a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805e582b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================