BUG: Bad page map in process syz.2.5854 pte:100000000 pmd:1073a5067 addr:0000000020201000 vm_flags:000000fe anon_vma:0000000000000000 mapping:ffff88811023def0 index:201 file:dev/zero fault:shmem_fault mmap:shmem_mmap readpage:0x0 CPU: 0 PID: 23960 Comm: syz.2.5854 Not tainted 5.10.225-syzkaller-00513-g8d23314f588a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 dump_stack+0x15/0x17 lib/dump_stack.c:135 print_bad_pte+0x543/0x560 mm/memory.c:568 zap_pte_range mm/memory.c:1365 [inline] zap_pmd_range mm/memory.c:1435 [inline] zap_pud_range mm/memory.c:1464 [inline] zap_p4d_range mm/memory.c:1485 [inline] unmap_page_range+0x17f2/0x23b0 mm/memory.c:1506 unmap_single_vma mm/memory.c:1551 [inline] unmap_vmas+0x37f/0x4f0 mm/memory.c:1583 exit_mmap+0x2f2/0x5c0 mm/mmap.c:3355 __mmput+0x95/0x2d0 kernel/fork.c:1153 mmput+0x59/0x170 kernel/fork.c:1176 exit_mm kernel/exit.c:539 [inline] do_exit+0xbda/0x2a50 kernel/exit.c:850 do_group_exit+0x141/0x310 kernel/exit.c:985 get_signal+0x10a0/0x1410 kernel/signal.c:2790 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xa2/0x1a0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fb231e9def9 Code: Unable to access opcode bytes at RIP 0x7fb231e9decf. RSP: 002b:00007fb230af60e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fb232056060 RCX: 00007fb231e9def9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fb232056060 RBP: 00007fb232056058 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb232056064 R13: 0000000000000000 R14: 00007fff1e8bf8a0 R15: 00007fff1e8bf988 BUG: Bad page cache in process syz.2.5854 pfn:125dfa page:ffffea0004977e80 refcount:3 mapcount:1 mapping:ffff88811023def0 index:0x201 pfn:0x125dfa aops:shmem_aops ino:12d3 flags: 0x4000000000080017(locked|referenced|uptodate|lru|swapbacked) raw: 4000000000080017 ffffea0004dc6cc8 ffff88810b25f000 ffff88811023def0 raw: 0000000000000201 0000000000000000 0000000300000000 ffff88810b2ba000 page dumped because: still mapped when deleted page->mem_cgroup:ffff88810b2ba000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 23955, ts 1216427921218, free_ts 1216390429478 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] shmem_alloc_page+0x257/0x420 mm/shmem.c:1580 shmem_alloc_and_acct_page+0x395/0x8e0 mm/shmem.c:1605 shmem_getpage_gfp+0x891/0x2480 mm/shmem.c:1918 shmem_fault+0x2d4/0x7b0 mm/shmem.c:2139 __do_fault mm/memory.c:4036 [inline] do_read_fault mm/memory.c:4371 [inline] do_fault mm/memory.c:4499 [inline] handle_pte_fault+0x23a9/0x3e30 mm/memory.c:4763 __handle_mm_fault mm/memory.c:4916 [inline] handle_mm_fault+0x11d6/0x1a10 mm/memory.c:5330 faultin_page mm/gup.c:902 [inline] __get_user_pages+0xb31/0x11b0 mm/gup.c:1121 populate_vma_page_range mm/gup.c:1454 [inline] __mm_populate+0x363/0x520 mm/gup.c:1502 mm_populate include/linux/mm.h:2782 [inline] vm_mmap_pgoff+0x264/0x390 mm/util.c:548 ksys_mmap_pgoff+0xf8/0x1f0 mm/mmap.c:1701 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:95 [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_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 __pagevec_release+0x84/0x100 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x7d1/0x1a60 mm/shmem.c:965 shmem_truncate_range mm/shmem.c:1069 [inline] shmem_evict_inode+0x215/0x9d0 mm/shmem.c:1169 evict+0x526/0x9c0 fs/inode.c:612 iput_final fs/inode.c:1732 [inline] iput+0x632/0x7e0 fs/inode.c:1758 dentry_unlink_inode+0x2ea/0x3d0 fs/dcache.c:378 __dentry_kill+0x447/0x650 fs/dcache.c:583 dentry_kill+0xc0/0x2a0 dput+0x40/0x80 fs/dcache.c:883 __fput+0x52e/0x7b0 fs/file_table.c:294 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x129/0x190 kernel/task_work.c:189 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc83/0x2a50 kernel/exit.c:863 CPU: 0 PID: 23960 Comm: syz.2.5854 Tainted: G B 5.10.225-syzkaller-00513-g8d23314f588a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 dump_stack+0x15/0x17 lib/dump_stack.c:135 unaccount_page_cache_page+0x752/0xa80 mm/filemap.c:185 __delete_from_page_cache+0xd0/0x5d0 mm/filemap.c:243 delete_from_page_cache+0xb6/0xf0 mm/filemap.c:279 truncate_inode_page+0x5d/0x70 mm/truncate.c:225 shmem_undo_range+0x696/0x1a60 mm/shmem.c:960 shmem_truncate_range mm/shmem.c:1069 [inline] shmem_evict_inode+0x215/0x9d0 mm/shmem.c:1169 evict+0x526/0x9c0 fs/inode.c:612 iput_final fs/inode.c:1732 [inline] iput+0x632/0x7e0 fs/inode.c:1758 dentry_unlink_inode+0x2ea/0x3d0 fs/dcache.c:378 __dentry_kill+0x447/0x650 fs/dcache.c:583 dentry_kill+0xc0/0x2a0 dput+0x40/0x80 fs/dcache.c:883 __fput+0x52e/0x7b0 fs/file_table.c:294 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x129/0x190 kernel/task_work.c:189 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc83/0x2a50 kernel/exit.c:863 do_group_exit+0x141/0x310 kernel/exit.c:985 get_signal+0x10a0/0x1410 kernel/signal.c:2790 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xa2/0x1a0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fb231e9def9 Code: Unable to access opcode bytes at RIP 0x7fb231e9decf. RSP: 002b:00007fb230af60e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fb232056060 RCX: 00007fb231e9def9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fb232056060 RBP: 00007fb232056058 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb232056064 R13: 0000000000000000 R14: 00007fff1e8bf8a0 R15: 00007fff1e8bf988