EXT4-fs warning (device loop0): dx_probe:833: inode #2: comm syz.0.21: Unrecognised inode hash code 4 EXT4-fs warning (device loop0): dx_probe:966: inode #2: comm syz.0.21: Corrupt directory, running e2fsck is recommended ================================================================== BUG: KASAN: slab-use-after-free in __ext4_check_dir_entry+0x6fd/0x880 fs/ext4/dir.c:85 Read of size 2 at addr ffff88803255a003 by task syz.0.21/6074 CPU: 1 UID: 0 PID: 6074 Comm: syz.0.21 Not tainted 6.13.0-rc5-syzkaller-00163-gab75170520d4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 __ext4_check_dir_entry+0x6fd/0x880 fs/ext4/dir.c:85 ext4_readdir+0x1436/0x3a60 fs/ext4/dir.c:259 iterate_dir+0x571/0x800 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0x1e2/0x4b0 fs/readdir.c:389 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:0x7fa747585d29 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:00007fa74835c038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fa747775fa0 RCX: 00007fa747585d29 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 00007fa747601b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa747775fa0 R15: 00007ffc3f7c0108 Allocated by task 6033: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_noprof+0x1d9/0x380 mm/slub.c:4175 vma_lock_alloc kernel/fork.c:446 [inline] vm_area_alloc+0x10e/0x1d0 kernel/fork.c:477 __mmap_new_vma mm/vma.c:2340 [inline] __mmap_region+0x1961/0x2d30 mm/vma.c:2456 mmap_region+0x1d0/0x2c0 mm/mmap.c:1348 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:580 elf_map fs/binfmt_elf.c:387 [inline] elf_load+0x151/0x700 fs/binfmt_elf.c:414 load_elf_binary+0x100c/0x2770 fs/binfmt_elf.c:1173 search_binary_handler fs/exec.c:1748 [inline] exec_binprm fs/exec.c:1790 [inline] bprm_execve+0xaf5/0x17a0 fs/exec.c:1842 kernel_execve+0x931/0xa50 fs/exec.c:2009 call_usermodehelper_exec_async+0x237/0x380 kernel/umh.c:109 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 16: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x195/0x410 mm/slub.c:4715 vma_lock_free kernel/fork.c:458 [inline] __vm_area_free+0xe3/0x110 kernel/fork.c:514 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88803255a000 which belongs to the cache vma_lock of size 152 The buggy address is located 3 bytes inside of freed 152-byte region [ffff88803255a000, ffff88803255a098) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3255a memcg:ffff88807eb43301 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801bafec80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000120012 00000001f5000000 ffff88807eb43301 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 6033, tgid 6033 (modprobe), ts 76372160927, free_ts 76372082485 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269 alloc_slab_page+0x6a/0x110 mm/slub.c:2423 allocate_slab+0x5a/0x2b0 mm/slub.c:2589 new_slab mm/slub.c:2642 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3830 __slab_alloc+0x58/0xa0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] kmem_cache_alloc_noprof+0x268/0x380 mm/slub.c:4175 vma_lock_alloc kernel/fork.c:446 [inline] vm_area_alloc+0x10e/0x1d0 kernel/fork.c:477 __mmap_new_vma mm/vma.c:2340 [inline] __mmap_region+0x1961/0x2d30 mm/vma.c:2456 mmap_region+0x1d0/0x2c0 mm/mmap.c:1348 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:580 elf_map fs/binfmt_elf.c:387 [inline] elf_load+0x151/0x700 fs/binfmt_elf.c:414 load_elf_binary+0x100c/0x2770 fs/binfmt_elf.c:1173 page last free pid 6033 tgid 6033 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe23/0x1890 mm/page_alloc.c:2706 folios_put_refs+0x76c/0x860 mm/swap.c:962 free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:335 __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 relocate_vma_down+0x504/0x600 mm/mmap.c:2125 setup_arg_pages+0x668/0xc10 fs/exec.c:810 load_elf_binary+0xb62/0x2770 fs/binfmt_elf.c:1020 search_binary_handler fs/exec.c:1748 [inline] exec_binprm fs/exec.c:1790 [inline] bprm_execve+0xaf5/0x17a0 fs/exec.c:1842 kernel_execve+0x931/0xa50 fs/exec.c:2009 call_usermodehelper_exec_async+0x237/0x380 kernel/umh.c:109 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888032559f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888032559f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88803255a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803255a080: fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb ffff88803255a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ==================================================================