RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000007c0ad480 RBP: 00007fdb1f2331d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000002 R13: 00007ffddc47e1af R14: 00007fdb1f233300 R15: 0000000000022000 ================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3517 [inline] BUG: KASAN: double-free or invalid-free in kfree+0xc8/0x210 mm/slub.c:4577 CPU: 0 PID: 28202 Comm: syz-executor.4 Not tainted 5.15.91-syzkaller-02991-g7e0097918ff8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3d0 mm/kasan/report.c:248 kasan_report_invalid_free+0x72/0xa0 mm/kasan/report.c:370 ____kasan_slab_free+0x13e/0x160 __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+0xc9/0x1a0 mm/slub.c:1749 slab_free mm/slub.c:3517 [inline] kfree+0xc8/0x210 mm/slub.c:4577 anon_vma_name_free+0x15/0x20 mm/madvise.c:90 kref_put include/linux/kref.h:65 [inline] anon_vma_name_put include/linux/mm_inline.h:365 [inline] free_anon_vma_name include/linux/mm_inline.h:396 [inline] vm_area_free_no_check+0xaa/0x150 kernel/fork.c:405 vm_area_free kernel/fork.c:418 [inline] dup_mmap+0xc40/0xf10 kernel/fork.c:680 dup_mm+0x8e/0x2e0 kernel/fork.c:1513 copy_mm+0x108/0x1b0 kernel/fork.c:1565 copy_process+0x1295/0x3250 kernel/fork.c:2256 kernel_clone+0x21d/0x9c0 kernel/fork.c:2659 __do_sys_clone kernel/fork.c:2785 [inline] __se_sys_clone kernel/fork.c:2769 [inline] __x64_sys_clone+0x289/0x310 kernel/fork.c:2769 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fdb204c00c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb1f233118 EFLAGS: 00000202 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007fdb205dff80 RCX: 00007fdb204c00c9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000007c0ad480 RBP: 00007fdb1f2331d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000002 R13: 00007ffddc47e1af R14: 00007fdb1f233300 R15: 0000000000022000 Allocated by task 27291: 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+0xb2/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook mm/slab.h:550 [inline] slab_alloc_node mm/slub.c:3238 [inline] slab_alloc mm/slub.c:3246 [inline] kmem_cache_alloc+0x189/0x2f0 mm/slub.c:3251 vm_area_dup+0x26/0x220 kernel/fork.c:367 dup_mmap+0x6c8/0xf10 kernel/fork.c:600 dup_mm+0x8e/0x2e0 kernel/fork.c:1513 copy_mm+0x108/0x1b0 kernel/fork.c:1565 copy_process+0x1295/0x3250 kernel/fork.c:2256 kernel_clone+0x21d/0x9c0 kernel/fork.c:2659 __do_sys_clone kernel/fork.c:2785 [inline] __se_sys_clone kernel/fork.c:2769 [inline] __x64_sys_clone+0x289/0x310 kernel/fork.c:2769 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb 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 kernel/rcu/tree.c:2993 [inline] call_rcu+0x140/0x1400 kernel/rcu/tree.c:3073 free_vm_area_struct kernel/fork.c:394 [inline] vm_area_free_no_check+0x119/0x150 kernel/fork.c:408 vm_area_free+0x53/0x60 kernel/fork.c:418 remove_vma mm/mmap.c:190 [inline] exit_mmap+0x52d/0x700 mm/mmap.c:3217 __mmput+0x95/0x300 kernel/fork.c:1171 mmput+0x52/0x140 kernel/fork.c:1194 exit_mm+0x54b/0x7a0 kernel/exit.c:551 do_exit+0x63c/0x24d0 kernel/exit.c:862 do_group_exit+0x13a/0x300 kernel/exit.c:997 get_signal+0x77e/0x1600 kernel/signal.c:2891 arch_do_signal_or_restart+0x9f/0x670 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xd4/0x110 kernel/entry/common.c:172 exit_to_user_mode_prepare+0x3b/0x40 kernel/entry/common.c:207 irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:313 irqentry_exit+0x12/0x40 kernel/entry/common.c:404 exc_page_fault+0x75/0x1a0 arch/x86/mm/fault.c:1607 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 Second to 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 kernel/rcu/tree.c:2993 [inline] call_rcu+0x140/0x1400 kernel/rcu/tree.c:3073 free_vm_area_struct kernel/fork.c:394 [inline] vm_area_free_no_check+0x119/0x150 kernel/fork.c:408 vm_area_free+0x53/0x60 kernel/fork.c:418 remove_vma mm/mmap.c:190 [inline] exit_mmap+0x52d/0x700 mm/mmap.c:3217 __mmput+0x95/0x300 kernel/fork.c:1171 mmput+0x52/0x140 kernel/fork.c:1194 exit_mm+0x54b/0x7a0 kernel/exit.c:551 do_exit+0x63c/0x24d0 kernel/exit.c:862 do_group_exit+0x13a/0x300 kernel/exit.c:997 get_signal+0x77e/0x1600 kernel/signal.c:2891 arch_do_signal_or_restart+0x9f/0x670 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xd4/0x110 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:207 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x79/0xc0 kernel/entry/common.c:300 do_syscall_64+0x50/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88812f59d818 which belongs to the cache vm_area_struct of size 232 The buggy address is located 88 bytes inside of 232-byte region [ffff88812f59d818, ffff88812f59d900) The buggy address belongs to the page: page:ffffea0004bd6740 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12f59d flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea0004ab3e80 0000000500000002 ffff8881001b5c80 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 813, ts 513667705815, free_ts 513200048688 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2502 prep_new_page mm/page_alloc.c:2508 [inline] get_page_from_freelist+0x3e5/0x460 mm/page_alloc.c:4291 __alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5569 allocate_slab+0x62/0x580 mm/slub.c:1930 new_slab mm/slub.c:1993 [inline] ___slab_alloc+0x2e2/0x6f0 mm/slub.c:3026 __slab_alloc+0x4a/0x90 mm/slub.c:3113 slab_alloc_node mm/slub.c:3204 [inline] slab_alloc mm/slub.c:3246 [inline] kmem_cache_alloc+0x205/0x2f0 mm/slub.c:3251 vm_area_dup+0x26/0x220 kernel/fork.c:367 dup_mmap+0x6c8/0xf10 kernel/fork.c:600 dup_mm+0x8e/0x2e0 kernel/fork.c:1513 copy_mm+0x108/0x1b0 kernel/fork.c:1565 copy_process+0x1295/0x3250 kernel/fork.c:2256 kernel_clone+0x21d/0x9c0 kernel/fork.c:2659 __do_sys_clone kernel/fork.c:2785 [inline] __se_sys_clone kernel/fork.c:2769 [inline] __x64_sys_clone+0x289/0x310 kernel/fork.c:2769 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1370 [inline] free_pcp_prepare+0x448/0x450 mm/page_alloc.c:1442 free_unref_page_prepare mm/page_alloc.c:3441 [inline] free_unref_page_list+0x16a/0xad0 mm/page_alloc.c:3562 release_pages+0x135f/0x13b0 mm/swap.c:1009 free_pages_and_swap_cache+0x97/0xb0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu+0x860/0xa00 mm/mmu_gather.c:247 tlb_finish_mmu+0xd2/0x1f0 mm/mmu_gather.c:338 exit_mmap+0x3f6/0x700 mm/mmap.c:3211 __mmput+0x95/0x300 kernel/fork.c:1171 mmput+0x52/0x140 kernel/fork.c:1194 exit_mm+0x54b/0x7a0 kernel/exit.c:551 do_exit+0x63c/0x24d0 kernel/exit.c:862 do_group_exit+0x13a/0x300 kernel/exit.c:997 get_signal+0x77e/0x1600 kernel/signal.c:2891 arch_do_signal_or_restart+0x9f/0x670 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xd4/0x110 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:207 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x79/0xc0 kernel/entry/common.c:300 Memory state around the buggy address: ffff88812f59d700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812f59d780: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc >ffff88812f59d800: fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88812f59d880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812f59d900: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================