================================================================== BUG: KASAN: use-after-free in __handle_mm_fault mm/memory.c:4881 [inline] BUG: KASAN: use-after-free in do_handle_mm_fault+0x142f/0x2370 mm/memory.c:5141 Read of size 8 at addr ffff888110d8e008 by task syz-executor.0/32766 CPU: 1 PID: 32766 Comm: syz-executor.0 Not tainted 5.15.80-syzkaller-00318-g72d681a01da5 #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:256 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452 kasan_check_range+0x2aa/0x2e0 mm/kasan/generic.c:189 memcpy+0x2d/0x70 mm/kasan/shadow.c:65 __handle_mm_fault mm/memory.c:4881 [inline] do_handle_mm_fault+0x142f/0x2370 mm/memory.c:5141 do_user_addr_fault+0xb5d/0x1220 arch/x86/mm/fault.c:1377 handle_page_fault arch/x86/mm/fault.c:1561 [inline] exc_page_fault+0x68/0x1a0 arch/x86/mm/fault.c:1617 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7f3730861d49 Code: 48 8b 04 24 48 85 c0 74 17 48 8b 54 24 18 48 0f ca 48 89 54 24 18 48 83 f8 01 0f 85 9b 02 00 00 48 8b 44 24 10 48 8b 54 24 18 <48> 89 10 e9 c2 fd ff ff 48 8b 44 24 10 0f b7 10 48 8b 04 24 48 85 RSP: 002b:00007fffac18bbb0 EFLAGS: 00010246 RAX: 00000000200015c0 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000020000080 RSI: 0000000000000000 RDI: 0000555556ea92e8 RBP: 00007fffac18bca8 R08: 0000000000000000 R09: 0000000000000000 R10: 00007f3730436688 R11: 0000000000000246 R12: 00007f37309e205c R13: 00007f3730436680 R14: 00007f37309e2050 R15: 0000000000000001 The buggy address belongs to the page: page:ffffea0004436380 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110d8e flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00041ffe08 ffff8881f713b960 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 32766, ts 635454746262, free_ts 635515414390 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495 prep_new_page mm/page_alloc.c:2501 [inline] get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281 __alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x73/0x1b0 arch/x86/mm/pgtable.c:33 __pte_alloc+0x86/0x350 mm/memory.c:429 do_anonymous_page+0xaa6/0xbf0 mm/memory.c:3879 handle_pte_fault+0x517/0x11d0 mm/memory.c:4736 do_handle_mm_fault+0x2073/0x2370 mm/memory.c:5141 handle_mm_fault include/linux/mm.h:1824 [inline] do_user_addr_fault+0x6ca/0x1220 arch/x86/mm/fault.c:1470 handle_page_fault arch/x86/mm/fault.c:1561 [inline] exc_page_fault+0x68/0x1a0 arch/x86/mm/fault.c:1617 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1364 [inline] free_pcp_prepare+0x448/0x450 mm/page_alloc.c:1435 free_unref_page_prepare mm/page_alloc.c:3433 [inline] free_unref_page_list+0x16a/0xad0 mm/page_alloc.c:3554 release_pages+0xf3e/0xf90 mm/swap.c:1010 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:242 [inline] tlb_flush_mmu+0x860/0xa00 mm/mmu_gather.c:249 tlb_finish_mmu+0xd2/0x1f0 mm/mmu_gather.c:340 unmap_region+0x327/0x370 mm/mmap.c:2679 __do_munmap+0x1468/0x1ad0 mm/mmap.c:2911 do_munmap mm/mmap.c:2922 [inline] munmap_vma_range mm/mmap.c:605 [inline] mmap_region+0x9ec/0x1af0 mm/mmap.c:1755 do_mmap+0x785/0xe40 mm/mmap.c:1584 vm_mmap_pgoff+0x1d4/0x420 mm/util.c:554 ksys_mmap_pgoff+0x15d/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+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888110d8df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888110d8df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888110d8e000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888110d8e080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888110d8e100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================