================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x131b/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88811bc4ed1b by task syz-executor/487 CPU: 1 PID: 487 Comm: syz-executor Not tainted 5.15.176-syzkaller-1078825-gd1a25a6a4b3b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/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_htree_fill_tree+0x131b/0x13e0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:606 [inline] ext4_readdir+0x2f75/0x3960 fs/ext4/dir.c:142 iterate_dir+0x265/0x600 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 x64_sys_call+0x5ae/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 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:0x7fe77d2ea693 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 82 3e f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007fffffceae18 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555588d704e0 RCX: 00007fe77d2ea693 RDX: 0000000000008000 RSI: 0000555588d704e0 RDI: 0000000000000005 RBP: 0000555588d704b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007fe77d47dca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 0000555588d704b0 R15: 0000000000000001 Allocated by task 272: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3250 [inline] kmem_cache_alloc+0xf5/0x250 mm/slub.c:3255 vm_area_dup+0x26/0x230 kernel/fork.c:368 dup_mmap kernel/fork.c:602 [inline] dup_mm kernel/fork.c:1522 [inline] copy_mm+0x9a1/0x13e0 kernel/fork.c:1574 copy_process+0x1149/0x3290 kernel/fork.c:2263 kernel_clone+0x21e/0x9e0 kernel/fork.c:2661 __do_sys_clone kernel/fork.c:2787 [inline] __se_sys_clone kernel/fork.c:2771 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2771 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 Freed by task 272: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3521 [inline] kmem_cache_free+0x115/0x330 mm/slub.c:3539 __free_vm_area_struct+0x1c/0x20 kernel/fork.c:390 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565 __do_softirq kernel/softirq.c:603 [inline] invoke_softirq kernel/softirq.c:425 [inline] __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:652 irq_exit_rcu+0x9/0x10 kernel/softirq.c:664 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline] sysvec_apic_timer_interrupt+0xa9/0xc0 arch/x86/kernel/apic/apic.c:1108 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:676 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu_common kernel/rcu/tree.c:3007 [inline] call_rcu+0x123/0x10b0 kernel/rcu/tree.c:3125 free_vm_area_struct kernel/fork.c:395 [inline] vm_area_free_no_check+0xff/0x130 kernel/fork.c:409 vm_area_free+0x53/0x60 kernel/fork.c:419 remove_vma mm/mmap.c:190 [inline] exit_mmap+0x556/0x990 mm/mmap.c:3242 __mmput+0x95/0x310 kernel/fork.c:1180 mmput+0x5b/0x170 kernel/fork.c:1203 exit_mm kernel/exit.c:554 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:867 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 The buggy address belongs to the object at ffff88811bc4ecb8 which belongs to the cache vm_area_struct of size 232 The buggy address is located 99 bytes inside of 232-byte region [ffff88811bc4ecb8, ffff88811bc4eda0) The buggy address belongs to the page: page:ffffea00046f1380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11bc4e flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100187500 raw: 0000000000000000 00000000000d000d 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 272, ts 20448555688, free_ts 18043315399 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:5780 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3250 [inline] kmem_cache_alloc+0x139/0x250 mm/slub.c:3255 vm_area_dup+0x26/0x230 kernel/fork.c:368 dup_mmap kernel/fork.c:602 [inline] dup_mm kernel/fork.c:1522 [inline] copy_mm+0x9a1/0x13e0 kernel/fork.c:1574 copy_process+0x1149/0x3290 kernel/fork.c:2263 kernel_clone+0x21e/0x9e0 kernel/fork.c:2661 __do_sys_clone kernel/fork.c:2787 [inline] __se_sys_clone kernel/fork.c:2771 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2771 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+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5856 __vunmap+0x7c1/0x940 mm/vmalloc.c:2652 free_work+0x5b/0x80 mm/vmalloc.c:96 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff88811bc4ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ffff88811bc4ec80: fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb >ffff88811bc4ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811bc4ed80: fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb ffff88811bc4ee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop1): __ext4_get_inode_loc:4351: comm syz-executor: Invalid inode table block 14875662660405297151 in block_group 0 EXT4-fs error (device loop1) in ext4_reserve_inode_write:5837: Corrupt filesystem EXT4-fs error (device loop1): ext4_dirty_inode:6041: inode #2: comm syz-executor: mark_inode_dirty error