mmap: syz-executor.1 (6831) uses deprecated remap_file_pages() syscall. See Documentation/mm/remap_file_pages.rst. ================================================================== BUG: KASAN: use-after-free in ptep_get include/linux/pgtable.h:317 [inline] BUG: KASAN: use-after-free in ptep_get_lockless include/linux/pgtable.h:581 [inline] BUG: KASAN: use-after-free in pte_range_none mm/memory.c:4409 [inline] BUG: KASAN: use-after-free in finish_fault+0xf87/0x1460 mm/memory.c:4905 Read of size 8 at addr ffff88806540d000 by task syz-executor.1/6831 CPU: 1 PID: 6831 Comm: syz-executor.1 Not tainted 6.10.0-rc3-next-20240611-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:91 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:117 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 ptep_get include/linux/pgtable.h:317 [inline] ptep_get_lockless include/linux/pgtable.h:581 [inline] pte_range_none mm/memory.c:4409 [inline] finish_fault+0xf87/0x1460 mm/memory.c:4905 do_read_fault mm/memory.c:5052 [inline] do_fault mm/memory.c:5178 [inline] do_pte_missing mm/memory.c:3948 [inline] handle_pte_fault+0x3db5/0x7130 mm/memory.c:5502 __handle_mm_fault mm/memory.c:5645 [inline] handle_mm_fault+0x10df/0x1ba0 mm/memory.c:5810 faultin_page mm/gup.c:1339 [inline] __get_user_pages+0x6ef/0x1590 mm/gup.c:1638 populate_vma_page_range+0x264/0x330 mm/gup.c:2078 __mm_populate+0x27a/0x460 mm/gup.c:2181 mm_populate include/linux/mm.h:3442 [inline] __do_sys_remap_file_pages mm/mmap.c:3177 [inline] __se_sys_remap_file_pages+0x7a1/0x9a0 mm/mmap.c:3103 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4111a7cea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007f41128980c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d8 RAX: ffffffffffffffda RBX: 00007f4111bb3f80 RCX: 00007f4111a7cea9 RDX: 0000000000000000 RSI: 0000000000200000 RDI: 00000000202ec000 RBP: 00007f4111aebff4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4111bb3f80 R15: 00007ffe34c3a3a8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6540d flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xbfffffff(buddy) raw: 00fff00000000000 ffffea0000b608c8 ffffea0001699688 0000000000000000 raw: 0000000000000000 0000000000000000 00000000bfffffff 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 0x540dc0(GFP_USER|__GFP_COMP|__GFP_ZERO|__GFP_ACCOUNT), pid 5114, tgid 5114 (syz-executor.2), ts 160806692986, free_ts 161941740111 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1470 prep_new_page mm/page_alloc.c:1478 [inline] get_page_from_freelist+0x2cbd/0x2d70 mm/page_alloc.c:3457 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4715 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2263 pagetable_alloc_noprof include/linux/mm.h:2881 [inline] pmd_alloc_one_noprof include/asm-generic/pgalloc.h:138 [inline] __pmd_alloc+0x91/0x630 mm/memory.c:6047 pmd_alloc include/linux/mm.h:2844 [inline] copy_pmd_range+0x8049/0x8500 mm/memory.c:1232 copy_pud_range mm/memory.c:1289 [inline] copy_p4d_range mm/memory.c:1313 [inline] copy_page_range+0x99f/0xe90 mm/memory.c:1411 dup_mmap kernel/fork.c:746 [inline] dup_mm kernel/fork.c:1669 [inline] copy_mm+0x11ea/0x1f30 kernel/fork.c:1718 copy_process+0x187a/0x3dc0 kernel/fork.c:2371 kernel_clone+0x226/0x8f0 kernel/fork.c:2778 __do_sys_clone kernel/fork.c:2921 [inline] __se_sys_clone kernel/fork.c:2905 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2905 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6836 tgid 6834 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1089 [inline] free_unref_folios+0x103a/0x1b00 mm/page_alloc.c:2669 folios_put_refs+0x76e/0x860 mm/swap.c:1020 free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:335 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:465 exit_mmap+0x44f/0xc80 mm/mmap.c:3395 __mmput+0x115/0x390 kernel/fork.c:1341 exit_mm+0x220/0x310 kernel/exit.c:565 do_exit+0x9aa/0x28e0 kernel/exit.c:861 do_group_exit+0x207/0x2c0 kernel/exit.c:1023 get_signal+0x16a1/0x1740 kernel/signal.c:2909 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88806540cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806540cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88806540d000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806540d080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806540d100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================