EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem without journal. Opts: max_batch_time=0x0000000000008001,errors=continue,errors=remount-ro,minixdf,jqfmt=vfsv0,usrjquota=.smackfsfloor=ext4. Quota mode: writeback. ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xee/0x1b0 fs/ext4/namei.c:1544 Read of size 1 at addr ffff888076f7f595 by task syz.0.15/4396 CPU: 0 PID: 4396 Comm: syz.0.15 Not tainted 5.15.167-syzkaller #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+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 ext4_search_dir+0xee/0x1b0 fs/ext4/namei.c:1544 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1704 __ext4_find_entry+0x2b0/0x1b20 fs/ext4/namei.c:1617 ext4_lookup_entry fs/ext4/namei.c:1772 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1840 lookup_one_qstr_excl+0x117/0x240 fs/namei.c:1563 filename_create+0x293/0x530 fs/namei.c:3836 do_mkdirat+0xb3/0x520 fs/namei.c:4080 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103 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:0x7fb005702ef9 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:00007fb004983038 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fb0058baf80 RCX: 00007fb005702ef9 RDX: 0000000000000000 RSI: 00000000200003c0 RDI: 0000000000000007 RBP: 00007fb005775b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb0058baf80 R15: 00007fff7206a0c8 The buggy address belongs to the page: page:ffffea0001dbdfc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76f7f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001eec288 ffffea0001efa688 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 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 4375, ts 92732248257, free_ts 92743598910 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 __get_free_pages mm/page_alloc.c:5460 [inline] get_zeroed_page+0x13/0x30 mm/page_alloc.c:5469 pud_alloc_one include/asm-generic/pgalloc.h:166 [inline] __pud_alloc+0x8b/0x210 mm/memory.c:4903 pud_alloc include/linux/mm.h:2174 [inline] __handle_mm_fault mm/memory.c:4690 [inline] handle_mm_fault+0x3afd/0x5960 mm/memory.c:4853 faultin_page mm/gup.c:976 [inline] __get_user_pages+0x4ed/0x11d0 mm/gup.c:1197 __get_user_pages_locked mm/gup.c:1382 [inline] __get_user_pages_remote+0x1cd/0x750 mm/gup.c:2007 get_arg_page+0x147/0x370 fs/exec.c:221 copy_string_kernel+0x167/0x2a0 fs/exec.c:639 do_execveat_common+0x3bd/0x720 fs/exec.c:1933 do_execve fs/exec.c:2029 [inline] __do_sys_execve fs/exec.c:2105 [inline] __se_sys_execve fs/exec.c:2100 [inline] __x64_sys_execve+0x8e/0xa0 fs/exec.c:2100 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:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 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+0x3cd/0x670 mm/mmap.c:3188 __mmput+0x112/0x3b0 kernel/fork.c:1126 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 __do_sys_exit_group kernel/exit.c:1007 [inline] __se_sys_exit_group kernel/exit.c:1005 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005 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 Memory state around the buggy address: ffff888076f7f480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888076f7f500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888076f7f580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888076f7f600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888076f7f680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================