================================================================== BUG: KASAN: use-after-free in __vma_shareable_flags_pmd mm/hugetlb.c:6809 [inline] BUG: KASAN: use-after-free in hugetlb_vma_lock_read mm/hugetlb.c:6815 [inline] BUG: KASAN: use-after-free in hugetlb_handle_userfault+0x236/0x250 mm/hugetlb.c:5564 Read of size 8 at addr ffff888026659cc8 by task syz-executor.0/16453 CPU: 1 PID: 16453 Comm: syz-executor.0 Not tainted 6.0.0-rc3-next-20220901-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/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:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __vma_shareable_flags_pmd mm/hugetlb.c:6809 [inline] hugetlb_vma_lock_read mm/hugetlb.c:6815 [inline] hugetlb_handle_userfault+0x236/0x250 mm/hugetlb.c:5564 hugetlb_no_page mm/hugetlb.c:5611 [inline] hugetlb_fault+0x152d/0x1e00 mm/hugetlb.c:5852 handle_mm_fault+0x640/0x780 mm/memory.c:5188 do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1407 handle_page_fault arch/x86/mm/fault.c:1498 [inline] exc_page_fault+0x94/0x170 arch/x86/mm/fault.c:1554 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7f195282cfbd Code: 0f 18 00 20 91 02 00 48 89 8c 24 72 04 00 00 48 8b 8c 24 70 04 00 00 4c 8d b4 24 80 04 00 00 48 01 df 0f 11 84 24 50 04 00 00 <48> 89 4f 20 66 44 89 ac 24 7a 04 00 00 8b 8c 24 78 04 00 00 41 bd RSP: 002b:00007f1953aba5e0 EFLAGS: 00010206 RAX: 0002912000180f80 RBX: 00000000207a2000 RCX: 0018001000180000 RDX: 00180f8000180f80 RSI: 0000000000000000 RDI: 00000000207a5e00 RBP: 00000000207a3000 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000207a2000 R11: 00007f1953abaad0 R12: 00000000207a3800 R13: 0000000000000008 R14: 00007f1953abaa60 R15: 0000000000000000 Allocated by task 16453: 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:437 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3317 [inline] slab_alloc mm/slub.c:3325 [inline] __kmem_cache_alloc_lru mm/slub.c:3332 [inline] kmem_cache_alloc+0x2b7/0x3d0 mm/slub.c:3341 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 16468: 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:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1651 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1677 slab_free mm/slub.c:3580 [inline] kmem_cache_free+0xe7/0x5b0 mm/slub.c:3602 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 ffff888026659ca8 which belongs to the cache vm_area_struct of size 152 The buggy address is located 32 bytes inside of 152-byte region [ffff888026659ca8, ffff888026659d40) The buggy address belongs to the physical page: page:ffffea0000999640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26659 memcg:ffff88801fd75f01 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001f85d40 dead000000000003 ffff888140006b40 raw: 0000000000000000 0000000000120012 00000001ffffffff ffff88801fd75f01 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 13709, tgid 13709 (modprobe), ts 3109705288525, free_ts 3109691757501 prep_new_page mm/page_alloc.c:2534 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4284 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5542 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1721 [inline] allocate_slab+0x228/0x370 mm/slub.c:1866 new_slab mm/slub.c:1919 [inline] ___slab_alloc+0xad0/0x1440 mm/slub.c:3100 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3198 slab_alloc_node mm/slub.c:3283 [inline] slab_alloc mm/slub.c:3325 [inline] __kmem_cache_alloc_lru mm/slub.c:3332 [inline] kmem_cache_alloc+0x31c/0x3d0 mm/slub.c:3341 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+0x41b/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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1451 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1501 free_unref_page_prepare mm/page_alloc.c:3382 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3478 tlb_batch_list_free mm/mmu_gather.c:74 [inline] tlb_finish_mmu+0x1a3/0x7e0 mm/mmu_gather.c:356 exit_mmap+0x1fe/0x720 mm/mmap.c:3102 __mmput+0x128/0x4c0 kernel/fork.c:1187 mmput+0x5c/0x70 kernel/fork.c:1209 exit_mm kernel/exit.c:515 [inline] do_exit+0xb4c/0x2b60 kernel/exit.c:805 do_group_exit+0xd0/0x2a0 kernel/exit.c:948 get_signal+0x238c/0x2610 kernel/signal.c:2858 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888026659b80: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb ffff888026659c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc >ffff888026659c80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ^ ffff888026659d00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888026659d80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================