================================================================== BUG: KASAN: use-after-free in exit_mmap+0x517/0x590 mm/mmap.c:3269 Read of size 8 at addr ffff88801b4b3530 by task syz-executor.0/4089 CPU: 1 PID: 4089 Comm: syz-executor.0 Not tainted 5.19.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 exit_mmap+0x517/0x590 mm/mmap.c:3269 __mmput+0xf3/0x440 kernel/fork.c:1180 exit_mm kernel/exit.c:510 [inline] do_exit+0x8ef/0x2480 kernel/exit.c:782 do_group_exit+0xb2/0x2a0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f5da1089209 Code: Unable to access opcode bytes at RIP 0x7f5da10891df. RSP: 002b:00007ffe9bec6bb8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000001e RCX: 00007f5da1089209 RDX: 00007f5da103be4b RSI: ffffffffffffffb8 RDI: 0000000000000000 RBP: 0000000000000000 R08: 00007f5da11a02e0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffe9bec6ca0 Allocated by task 4070: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3268 vm_area_dup+0x7c/0x310 kernel/fork.c:466 dup_mmap+0x525/0xdf0 kernel/fork.c:640 dup_mm+0x83/0x340 kernel/fork.c:1520 copy_mm kernel/fork.c:1569 [inline] copy_process+0x3482/0x6670 kernel/fork.c:2233 kernel_clone+0xb8/0x7f0 kernel/fork.c:2648 __do_sys_clone+0xa1/0xe0 kernel/fork.c:2782 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 4089: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kmem_cache_free+0xdd/0x5a0 mm/slub.c:3553 exit_mmap+0x22e/0x590 mm/mmap.c:3271 __mmput+0xf3/0x440 kernel/fork.c:1180 exit_mm kernel/exit.c:510 [inline] do_exit+0x8ef/0x2480 kernel/exit.c:782 do_group_exit+0xb2/0x2a0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88801b4b3510 which belongs to the cache vm_area_struct of size 152 The buggy address is located 32 bytes inside of 152-byte region [ffff88801b4b3510, ffff88801b4b35a8) The buggy address belongs to the physical page: page:ffffea00006d2cc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1b4b3 memcg:ffff888020199901 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001cd4700 dead000000000002 ffff888140006b40 raw: 0000000000000000 0000000000120012 00000001ffffffff ffff888020199901 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3813, tgid 3813 (dhcpcd-run-hook), ts 54517551010, free_ts 54491234758 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x19d2/0x3b30 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5415 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x9bc/0xe10 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3268 vm_area_dup+0x7c/0x310 kernel/fork.c:466 dup_mmap+0x525/0xdf0 kernel/fork.c:640 dup_mm+0x83/0x340 kernel/fork.c:1520 copy_mm kernel/fork.c:1569 [inline] copy_process+0x3482/0x6670 kernel/fork.c:2233 kernel_clone+0xb8/0x7f0 kernel/fork.c:2648 __do_sys_clone+0xa1/0xe0 kernel/fork.c:2782 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page_list+0x16f/0xf80 mm/page_alloc.c:3475 release_pages+0x6f1/0x1780 mm/swap.c:980 tlb_batch_pages_flush+0x85/0x160 mm/mmu_gather.c:58 tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu mm/mmu_gather.c:262 [inline] tlb_finish_mmu+0x110/0x6c0 mm/mmu_gather.c:353 exit_mmap+0x1d0/0x590 mm/mmap.c:3261 __mmput+0xf3/0x440 kernel/fork.c:1180 exit_mm kernel/exit.c:510 [inline] do_exit+0x8ef/0x2480 kernel/exit.c:782 do_group_exit+0xb2/0x2a0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff88801b4b3400: fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 ffff88801b4b3480: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff88801b4b3500: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801b4b3580: fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb ffff88801b4b3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================