================================================================== BUG: KASAN: use-after-free in __vma_shareable_flags_pmd mm/hugetlb.c:6818 [inline] BUG: KASAN: use-after-free in hugetlb_vma_lock_read mm/hugetlb.c:6824 [inline] BUG: KASAN: use-after-free in hugetlb_handle_userfault+0x238/0x250 mm/hugetlb.c:5519 Read of size 8 at addr ffff88807d798458 by task syz-executor.0/14668 CPU: 1 PID: 14668 Comm: syz-executor.0 Not tainted 6.0.0-rc6-next-20220923-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 __vma_shareable_flags_pmd mm/hugetlb.c:6818 [inline] hugetlb_vma_lock_read mm/hugetlb.c:6824 [inline] hugetlb_handle_userfault+0x238/0x250 mm/hugetlb.c:5519 hugetlb_no_page mm/hugetlb.c:5565 [inline] hugetlb_fault+0x1606/0x1e60 mm/hugetlb.c:5796 handle_mm_fault+0x640/0x780 mm/memory.c:5204 do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x94/0x170 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fa840a2a02b Code: 48 85 c0 74 1b 48 83 f8 01 0f 85 5a 03 00 00 0f b7 44 24 18 66 c1 c0 08 0f b7 c0 48 89 44 24 18 48 8b 44 24 10 0f b7 54 24 18 <66> 89 10 e9 70 fe ff ff 48 83 7c 24 08 08 0f 85 09 03 00 00 48 8b RSP: 002b:00007ffcbfecd190 EFLAGS: 00010246 RAX: 000000002057eff8 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000555556ca02e8 RBP: 00007ffcbfecd288 R08: 0000000000000000 R09: 0000000000000000 R10: 00007fa841bc4700 R11: 0000000000000246 R12: 00007fa840bac2cc R13: 00007fa840bb7a28 R14: 00007fa840bac2c0 R15: 0000000000000004 Allocated by task 14670: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7e/0x80 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:754 [inline] slab_alloc_node mm/slub.c:3336 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x2b7/0x3d0 mm/slub.c:3360 vm_area_alloc+0x1c/0xf0 kernel/fork.c:458 mmap_region+0x448/0x1bf0 mm/mmap.c:2604 do_mmap+0x825/0xf50 mm/mmap.c:1411 vm_mmap_pgoff+0x1ab/0x270 mm/util.c:520 ksys_mmap_pgoff+0x1c3/0x5a0 mm/mmap.c:1457 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+0x63/0xcd Freed by task 14670: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1669 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1695 slab_free mm/slub.c:3599 [inline] kmem_cache_free+0xea/0x5b0 mm/slub.c:3621 remove_mt mm/mmap.c:2166 [inline] do_mas_align_munmap+0x983/0xee0 mm/mmap.c:2446 do_mas_munmap+0x26a/0x2b0 mm/mmap.c:2501 mmap_region+0x219/0x1bf0 mm/mmap.c:2549 do_mmap+0x825/0xf50 mm/mmap.c:1411 vm_mmap_pgoff+0x1ab/0x270 mm/util.c:520 ksys_mmap_pgoff+0x1c3/0x5a0 mm/mmap.c:1457 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+0x63/0xcd The buggy address belongs to the object at ffff88807d798438 which belongs to the cache vm_area_struct of size 152 The buggy address is located 32 bytes inside of 152-byte region [ffff88807d798438, ffff88807d7984d0) The buggy address belongs to the physical page: page:ffffea0001f5e600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffffea0000745f80 pfn:0x7d798 memcg:ffff8880262f5c01 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff8880119d3b40 dead000000120012 0000000000000000 raw: ffffea0000745f80 dead000000000008 00000001ffffffff ffff8880262f5c01 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 3899, tgid 3899 (dhcpcd-run-hook), ts 304207959546, free_ts 304205924661 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x1092/0x2d20 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5546 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1739 [inline] allocate_slab+0x213/0x300 mm/slub.c:1884 new_slab mm/slub.c:1937 [inline] ___slab_alloc+0xac1/0x1430 mm/slub.c:3119 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3217 slab_alloc_node mm/slub.c:3302 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x31c/0x3d0 mm/slub.c:3360 vm_area_dup+0x81/0x380 kernel/fork.c:466 dup_mmap+0x655/0x10b0 kernel/fork.c:643 dup_mm+0x91/0x370 kernel/fork.c:1529 copy_mm kernel/fork.c:1578 [inline] copy_process+0x3bc6/0x71b0 kernel/fork.c:2256 kernel_clone+0xe7/0x980 kernel/fork.c:2676 __do_sys_clone+0xba/0x100 kernel/fork.c:2817 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+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page_list+0x172/0xc40 mm/page_alloc.c:3528 release_pages+0xc8c/0x1360 mm/swap.c:1055 tlb_batch_pages_flush+0xa8/0x1a0 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+0x147/0x7e0 mm/mmu_gather.c:353 exit_mmap+0x1fe/0x7a0 mm/mmap.c:3101 __mmput+0x128/0x4c0 kernel/fork.c:1188 mmput+0x5c/0x70 kernel/fork.c:1210 exit_mm kernel/exit.c:516 [inline] do_exit+0xa39/0x2a20 kernel/exit.c:807 do_group_exit+0xd0/0x2a0 kernel/exit.c:950 __do_sys_exit_group kernel/exit.c:961 [inline] __se_sys_exit_group kernel/exit.c:959 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:959 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+0x63/0xcd Memory state around the buggy address: ffff88807d798300: fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb ffff88807d798380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc >ffff88807d798400: fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb ^ ffff88807d798480: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff88807d798500: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================