================================================================== BUG: KASAN: slab-use-after-free in handle_mm_fault+0x14f0/0x19a0 mm/memory.c:5835 Read of size 8 at addr ffff888076fbecb8 by task syz.0.2412/17526 CPU: 0 UID: 0 PID: 17526 Comm: syz.0.2412 Not tainted 6.10.0-next-20240716-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 handle_mm_fault+0x14f0/0x19a0 mm/memory.c:5835 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 RIP: 0033:0x7f45b2f3d52b Code: fa 10 73 2d 83 fa 08 73 46 83 fa 04 73 16 83 fa 01 7c 10 8a 0e 74 0a 0f b7 74 16 fe 66 89 74 17 fe 88 0f c3 8b 4c 16 fc 8b 36 <89> 4c 17 fc 89 37 c3 c5 fa 6f 06 c5 fa 6f 4c 16 f0 c5 fa 7f 07 c5 RSP: 002b:00007f45b3ce3038 EFLAGS: 00010246 RAX: 0000000020400000 RBX: 00007f45b3104038 RCX: 0000000000000000 RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000020400000 RBP: 00007f45b2fe4e49 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000020400000 R11: 0000000020000040 R12: 0000000000000000 R13: 000000000000006e R14: 00007f45b3104038 R15: 00007ffc32ac7a58 Allocated by task 17523: 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:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 vm_area_alloc+0x24/0x1d0 kernel/fork.c:472 mmap_region+0xc3d/0x2090 mm/mmap.c:2944 do_mmap+0x8f9/0x1010 mm/mmap.c:1468 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 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 Freed by task 17521: 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:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4548 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2843 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3106 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3210 vma_complete+0x98a/0xb60 mm/mmap.c:609 vma_merge+0x1d9b/0x2690 mm/mmap.c:1079 vma_modify+0xb8/0x350 mm/mmap.c:2565 vma_modify_flags_uffd include/linux/mm.h:3352 [inline] userfaultfd_release+0x413/0x900 fs/userfaultfd.c:907 __fput+0x24a/0x8a0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:222 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888076fbec98 which belongs to the cache vm_area_struct of size 184 The buggy address is located 32 bytes inside of freed 184-byte region [ffff888076fbec98, ffff888076fbed50) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76fbe memcg:ffff888021d46701 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888015eefb40 ffffea0000a6e340 000000000000000b raw: 0000000000000000 0000000000100010 00000001fdffffff ffff888021d46701 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 17257, tgid 17257 (rm), ts 881247847968, free_ts 881245397806 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2ccb/0x2d80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4732 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4044 vm_area_dup+0x27/0x290 kernel/fork.c:487 __split_vma+0x1a9/0xc30 mm/mmap.c:2465 do_vmi_align_munmap+0x388/0x18c0 mm/mmap.c:2663 do_vmi_munmap+0x261/0x2f0 mm/mmap.c:2830 __vm_munmap+0x1fc/0x400 mm/mmap.c:3109 elf_map fs/binfmt_elf.c:383 [inline] elf_load+0x2d8/0x6f0 fs/binfmt_elf.c:408 load_elf_interp+0x443/0xac0 fs/binfmt_elf.c:675 load_elf_binary+0x1a47/0x2680 fs/binfmt_elf.c:1235 page last free pid 17257 tgid 17257 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_folios+0x103a/0x1b00 mm/page_alloc.c:2692 folios_put_refs+0x76e/0x860 mm/swap.c:1039 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 exit_mmap+0x44f/0xc80 mm/mmap.c:3425 __mmput+0x115/0x390 kernel/fork.c:1347 exec_mmap+0x680/0x710 fs/exec.c:1089 begin_new_exec+0x125f/0x1f50 fs/exec.c:1355 load_elf_binary+0x969/0x2680 fs/binfmt_elf.c:996 search_binary_handler fs/exec.c:1821 [inline] exec_binprm fs/exec.c:1863 [inline] bprm_execve+0xaf8/0x1770 fs/exec.c:1914 do_execveat_common+0x55f/0x6f0 fs/exec.c:2021 do_execve fs/exec.c:2095 [inline] __do_sys_execve fs/exec.c:2171 [inline] __se_sys_execve fs/exec.c:2166 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2166 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: ffff888076fbeb80: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ffff888076fbec00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc >ffff888076fbec80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888076fbed00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff888076fbed80: fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================