RBP: 00007fbf563a83c0 R08: 0000000000000000 R09: 0000000000003336 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbf563a83cc R13: 00007fbf562de210 R14: 0000000000000002 R15: 00007fbf5637501d ================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3519 [inline] BUG: KASAN: double-free or invalid-free in kfree+0xc8/0x220 mm/slub.c:4579 CPU: 1 PID: 339 Comm: syz-executor212 Not tainted 5.15.137-syzkaller-01792-g61cfd264993d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/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/0x3b0 mm/kasan/report.c:248 kasan_report_invalid_free+0x6b/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+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kfree+0xc8/0x220 mm/slub.c:4579 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+0xa6/0x130 kernel/fork.c:405 vm_area_free kernel/fork.c:418 [inline] dup_mmap kernel/fork.c:681 [inline] dup_mm kernel/fork.c:1521 [inline] copy_mm+0xefb/0x13e0 kernel/fork.c:1573 copy_process+0x12bc/0x3260 kernel/fork.c:2264 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone kernel/fork.c:2788 [inline] __se_sys_clone kernel/fork.c:2772 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2772 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fbf5631e169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 1a 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fbf562de208 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007fbf563a83c8 RCX: 00007fbf5631e169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fbf563a83c0 R08: 0000000000000000 R09: 0000000000003336 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbf563a83cc R13: 00007fbf562de210 R14: 0000000000000002 R15: 00007fbf5637501d Allocated by task 291: 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:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 vm_area_dup+0x26/0x230 kernel/fork.c:367 dup_mmap kernel/fork.c:601 [inline] dup_mm kernel/fork.c:1521 [inline] copy_mm+0x9a1/0x13e0 kernel/fork.c:1573 copy_process+0x12bc/0x3260 kernel/fork.c:2264 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone kernel/fork.c:2788 [inline] __se_sys_clone kernel/fork.c:2772 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2772 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88811e35d000 which belongs to the cache vm_area_struct of size 232 The buggy address is located 88 bytes inside of 232-byte region [ffff88811e35d000, ffff88811e35d0e8) The buggy address belongs to the page: page:ffffea000478d740 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11e35d flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881001bc900 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 291, ts 19862350252, free_ts 19861496020 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2602 prep_new_page+0x1b/0x110 mm/page_alloc.c:2608 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4482 __alloc_pages+0x206/0x5e0 mm/page_alloc.c:5773 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:3248 [inline] kmem_cache_alloc+0x134/0x200 mm/slub.c:3253 vm_area_alloc+0x24/0x130 kernel/fork.c:359 mmap_region+0xb5d/0x1b60 mm/mmap.c:1780 do_mmap+0x776/0xe50 mm/mmap.c:1584 vm_mmap_pgoff+0x1dd/0x450 mm/util.c:555 ksys_mmap_pgoff+0xed/0x1e0 mm/mmap.c:1633 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0x103/0x120 arch/x86/kernel/sys_x86_64.c:86 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 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:1469 [inline] free_pcp_prepare mm/page_alloc.c:1541 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3531 free_unref_page+0xe6/0x730 mm/page_alloc.c:3613 free_the_page mm/page_alloc.c:802 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5849 free_pages+0x7c/0x90 mm/page_alloc.c:5860 do_proc_readlink fs/proc/base.c:1786 [inline] proc_pid_readlink+0x1d7/0x230 fs/proc/base.c:1804 vfs_readlink+0x3a8/0x400 fs/namei.c:4976 do_readlinkat+0x27f/0x3a0 fs/stat.c:454 __do_sys_readlink fs/stat.c:475 [inline] __se_sys_readlink fs/stat.c:472 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:472 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88811e35cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811e35cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811e35d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88811e35d080: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff88811e35d100: fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 ==================================================================