BUG: Bad page map in process syz-executor.4 pte:fffffd2650120 pmd:7a51c067 page:ffffea0000b66bc0 refcount:1 mapcount:-1 mapping:ffff888081d6b998 index:0x8b8 pfn:0x2d9af memcg:ffff88807d87a000 aops:shmem_aops ino:c82 dentry name:"memfd:syzkaller" flags: 0xfff4000008023c(referenced|uptodate|dirty|lru|workingset|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfffffffe() raw: 00fff4000008023c ffffea0000b66b88 ffffea0000bf2008 ffff888081d6b998 raw: 00000000000008b8 0000000000000000 00000001fffffffe ffff88807d87a000 page dumped because: bad pte page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9616, tgid 9614 (syz-executor.4), ts 1797918984351, free_ts 1795971846979 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 __folio_alloc+0x16/0x40 mm/page_alloc.c:4471 vma_alloc_folio+0x156/0x890 mm/mempolicy.c:2259 shmem_alloc_folio+0xb5/0x170 mm/shmem.c:1658 shmem_alloc_and_acct_folio+0xcb/0x140 mm/shmem.c:1683 shmem_get_folio_gfp+0xbe9/0x1890 mm/shmem.c:2020 shmem_get_folio mm/shmem.c:2143 [inline] shmem_write_begin+0x15c/0x460 mm/shmem.c:2688 generic_perform_write+0x278/0x600 mm/filemap.c:3945 shmem_file_write_iter+0x110/0x140 mm/shmem.c:2865 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x582/0x1040 mm/shmem.c:1022 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x392/0xb50 mm/shmem.c:1243 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8dd/0xfd0 fs/dcache.c:913 __fput+0x536/0xa70 fs/file_table.c:392 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 addr:0000000020002000 vm_flags:080000d0 anon_vma:0000000000000000 mapping:ffff888082263bd0 index:1 file:bus fault:xfs_filemap_fault mmap:xfs_file_mmap read_folio:xfs_vm_read_folio CPU: 0 PID: 9614 Comm: syz-executor.4 Not tainted 6.5.0-syzkaller-11704-g3f86ed6ec0b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106 print_bad_pte+0x501/0x7a0 mm/memory.c:535 zap_pte_range mm/memory.c:1458 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x216a/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e8/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe0a7a7cae9 Code: Unable to access opcode bytes at 0x7fe0a7a7cabf. RSP: 002b:00007ffc790b1e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffdfc RBX: 00000000001b70de RCX: 00007fe0a7a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe0a7b9bf8c RBP: 0000000000000032 R08: 00007fe0a7b9bf8c R09: 00007fe0a7b9bf8c R10: 00007ffc790b1f50 R11: 0000000000000246 R12: 00007fe0a7b9bf8c R13: 00000000001b7110 R14: 00007ffc790b1f70 R15: 00007ffc790b1f50 BUG: Bad page map in process syz-executor.4 pte:fffffd2651120 pmd:7a51c067 page:ffffea0000b66b80 refcount:1 mapcount:-1 mapping:ffff888081d6b998 index:0x8b7 pfn:0x2d9ae memcg:ffff88807d87a000 aops:shmem_aops ino:c82 dentry name:"memfd:syzkaller" flags: 0xfff4000008023c(referenced|uptodate|dirty|lru|workingset|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfffffffe() raw: 00fff4000008023c ffffea0000b66b48 ffffea0000b66bc8 ffff888081d6b998 raw: 00000000000008b7 0000000000000000 00000001fffffffe ffff88807d87a000 page dumped because: bad pte page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9616, tgid 9614 (syz-executor.4), ts 1797918946507, free_ts 1795971867081 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 __folio_alloc+0x16/0x40 mm/page_alloc.c:4471 vma_alloc_folio+0x156/0x890 mm/mempolicy.c:2259 shmem_alloc_folio+0xb5/0x170 mm/shmem.c:1658 shmem_alloc_and_acct_folio+0xcb/0x140 mm/shmem.c:1683 shmem_get_folio_gfp+0xbe9/0x1890 mm/shmem.c:2020 shmem_get_folio mm/shmem.c:2143 [inline] shmem_write_begin+0x15c/0x460 mm/shmem.c:2688 generic_perform_write+0x278/0x600 mm/filemap.c:3945 shmem_file_write_iter+0x110/0x140 mm/shmem.c:2865 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x582/0x1040 mm/shmem.c:1022 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x392/0xb50 mm/shmem.c:1243 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8dd/0xfd0 fs/dcache.c:913 __fput+0x536/0xa70 fs/file_table.c:392 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 addr:0000000020003000 vm_flags:080000d0 anon_vma:0000000000000000 mapping:ffff888082263bd0 index:2 file:bus fault:xfs_filemap_fault mmap:xfs_file_mmap read_folio:xfs_vm_read_folio CPU: 1 PID: 9614 Comm: syz-executor.4 Tainted: G B 6.5.0-syzkaller-11704-g3f86ed6ec0b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106 print_bad_pte+0x501/0x7a0 mm/memory.c:535 zap_pte_range mm/memory.c:1458 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x216a/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e8/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe0a7a7cae9 Code: Unable to access opcode bytes at 0x7fe0a7a7cabf. RSP: 002b:00007ffc790b1e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffdfc RBX: 00000000001b70de RCX: 00007fe0a7a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe0a7b9bf8c RBP: 0000000000000032 R08: 00007fe0a7b9bf8c R09: 00007fe0a7b9bf8c R10: 00007ffc790b1f50 R11: 0000000000000246 R12: 00007fe0a7b9bf8c R13: 00000000001b7110 R14: 00007ffc790b1f70 R15: 00007ffc790b1f50 BUG: Bad page map in process syz-executor.4 pte:fffffd2652120 pmd:7a51c067 page:ffffea0000b66b40 refcount:1 mapcount:-1 mapping:ffff888081d6b998 index:0x8b6 pfn:0x2d9ad memcg:ffff88807d87a000 aops:shmem_aops ino:c82 dentry name:"memfd:syzkaller" flags: 0xfff4000008023c(referenced|uptodate|dirty|lru|workingset|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfffffffe() raw: 00fff4000008023c ffffea0000b66b08 ffffea0000b66b88 ffff888081d6b998 raw: 00000000000008b6 0000000000000000 00000001fffffffe ffff88807d87a000 page dumped because: bad pte page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9616, tgid 9614 (syz-executor.4), ts 1797918908096, free_ts 1795971023294 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 __folio_alloc+0x16/0x40 mm/page_alloc.c:4471 vma_alloc_folio+0x156/0x890 mm/mempolicy.c:2259 shmem_alloc_folio+0xb5/0x170 mm/shmem.c:1658 shmem_alloc_and_acct_folio+0xcb/0x140 mm/shmem.c:1683 shmem_get_folio_gfp+0xbe9/0x1890 mm/shmem.c:2020 shmem_get_folio mm/shmem.c:2143 [inline] shmem_write_begin+0x15c/0x460 mm/shmem.c:2688 generic_perform_write+0x278/0x600 mm/filemap.c:3945 shmem_file_write_iter+0x110/0x140 mm/shmem.c:2865 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x582/0x1040 mm/shmem.c:1022 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x392/0xb50 mm/shmem.c:1243 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8dd/0xfd0 fs/dcache.c:913 __fput+0x536/0xa70 fs/file_table.c:392 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 addr:0000000020004000 vm_flags:080000d0 anon_vma:0000000000000000 mapping:ffff888082263bd0 index:3 file:bus fault:xfs_filemap_fault mmap:xfs_file_mmap read_folio:xfs_vm_read_folio CPU: 0 PID: 9614 Comm: syz-executor.4 Tainted: G B 6.5.0-syzkaller-11704-g3f86ed6ec0b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106 print_bad_pte+0x501/0x7a0 mm/memory.c:535 zap_pte_range mm/memory.c:1458 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x216a/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e8/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe0a7a7cae9 Code: Unable to access opcode bytes at 0x7fe0a7a7cabf. RSP: 002b:00007ffc790b1e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffdfc RBX: 00000000001b70de RCX: 00007fe0a7a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe0a7b9bf8c RBP: 0000000000000032 R08: 00007fe0a7b9bf8c R09: 00007fe0a7b9bf8c R10: 00007ffc790b1f50 R11: 0000000000000246 R12: 00007fe0a7b9bf8c R13: 00000000001b7110 R14: 00007ffc790b1f70 R15: 00007ffc790b1f50 BUG: Bad page state in process syz-executor.4 pfn:2d9ad page:ffffea0000b66b40 refcount:0 mapcount:-1 mapping:ffff888081d6b998 index:0x8b6 pfn:0x2d9ad aops:shmem_aops ino:c82 dentry name:"memfd:syzkaller" flags: 0xfff0000008021c(referenced|uptodate|dirty|workingset|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfffffffe() raw: 00fff0000008021c ffffea0000b66b88 ffffc9000fe97678 ffff888081d6b998 raw: 00000000000008b6 0000000000000000 00000000fffffffe 0000000000000000 page dumped because: non-NULL mapping page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9616, tgid 9614 (syz-executor.4), ts 1797918908096, free_ts 1795971023294 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 __folio_alloc+0x16/0x40 mm/page_alloc.c:4471 vma_alloc_folio+0x156/0x890 mm/mempolicy.c:2259 shmem_alloc_folio+0xb5/0x170 mm/shmem.c:1658 shmem_alloc_and_acct_folio+0xcb/0x140 mm/shmem.c:1683 shmem_get_folio_gfp+0xbe9/0x1890 mm/shmem.c:2020 shmem_get_folio mm/shmem.c:2143 [inline] shmem_write_begin+0x15c/0x460 mm/shmem.c:2688 generic_perform_write+0x278/0x600 mm/filemap.c:3945 shmem_file_write_iter+0x110/0x140 mm/shmem.c:2865 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x582/0x1040 mm/shmem.c:1022 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x392/0xb50 mm/shmem.c:1243 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8dd/0xfd0 fs/dcache.c:913 __fput+0x536/0xa70 fs/file_table.c:392 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 Modules linked in: CPU: 0 PID: 9614 Comm: syz-executor.4 Tainted: G B 6.5.0-syzkaller-11704-g3f86ed6ec0b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106 bad_page+0xb4/0x200 mm/page_alloc.c:513 free_page_is_bad_report mm/page_alloc.c:949 [inline] free_page_is_bad mm/page_alloc.c:959 [inline] free_pages_prepare mm/page_alloc.c:1128 [inline] free_unref_page_prepare+0x4ab/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 zap_pte_range mm/memory.c:1534 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x19b7/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e8/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe0a7a7cae9 Code: Unable to access opcode bytes at 0x7fe0a7a7cabf. RSP: 002b:00007ffc790b1e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffdfc RBX: 00000000001b70de RCX: 00007fe0a7a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe0a7b9bf8c RBP: 0000000000000032 R08: 00007fe0a7b9bf8c R09: 00007fe0a7b9bf8c R10: 00007ffc790b1f50 R11: 0000000000000246 R12: 00007fe0a7b9bf8c R13: 00000000001b7110 R14: 00007ffc790b1f70 R15: 00007ffc790b1f50 BUG: Bad page state in process syz-executor.4 pfn:2d9ae page:ffffea0000b66b80 refcount:0 mapcount:-1 mapping:ffff888081d6b998 index:0x8b7 pfn:0x2d9ae aops:shmem_aops ino:c82 dentry name:"memfd:syzkaller" flags: 0xfff0000008021c(referenced|uptodate|dirty|workingset|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfffffffe() raw: 00fff0000008021c ffffea0000b66bc8 ffffc9000fe97678 ffff888081d6b998 raw: 00000000000008b7 0000000000000000 00000000fffffffe 0000000000000000 page dumped because: non-NULL mapping page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9616, tgid 9614 (syz-executor.4), ts 1797918946507, free_ts 1795971867081 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 __folio_alloc+0x16/0x40 mm/page_alloc.c:4471 vma_alloc_folio+0x156/0x890 mm/mempolicy.c:2259 shmem_alloc_folio+0xb5/0x170 mm/shmem.c:1658 shmem_alloc_and_acct_folio+0xcb/0x140 mm/shmem.c:1683 shmem_get_folio_gfp+0xbe9/0x1890 mm/shmem.c:2020 shmem_get_folio mm/shmem.c:2143 [inline] shmem_write_begin+0x15c/0x460 mm/shmem.c:2688 generic_perform_write+0x278/0x600 mm/filemap.c:3945 shmem_file_write_iter+0x110/0x140 mm/shmem.c:2865 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x582/0x1040 mm/shmem.c:1022 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x392/0xb50 mm/shmem.c:1243 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8dd/0xfd0 fs/dcache.c:913 __fput+0x536/0xa70 fs/file_table.c:392 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 Modules linked in: CPU: 1 PID: 9614 Comm: syz-executor.4 Tainted: G B 6.5.0-syzkaller-11704-g3f86ed6ec0b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106 bad_page+0xb4/0x200 mm/page_alloc.c:513 free_page_is_bad_report mm/page_alloc.c:949 [inline] free_page_is_bad mm/page_alloc.c:959 [inline] free_pages_prepare mm/page_alloc.c:1128 [inline] free_unref_page_prepare+0x4ab/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 zap_pte_range mm/memory.c:1534 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x19b7/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e8/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe0a7a7cae9 Code: Unable to access opcode bytes at 0x7fe0a7a7cabf. RSP: 002b:00007ffc790b1e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffdfc RBX: 00000000001b70de RCX: 00007fe0a7a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe0a7b9bf8c RBP: 0000000000000032 R08: 00007fe0a7b9bf8c R09: 00007fe0a7b9bf8c R10: 00007ffc790b1f50 R11: 0000000000000246 R12: 00007fe0a7b9bf8c R13: 00000000001b7110 R14: 00007ffc790b1f70 R15: 00007ffc790b1f50 BUG: Bad page state in process syz-executor.4 pfn:2d9af page:ffffea0000b66bc0 refcount:0 mapcount:-1 mapping:ffff888081d6b998 index:0x8b8 pfn:0x2d9af aops:shmem_aops ino:c82 dentry name:"memfd:syzkaller" flags: 0xfff0000008021c(referenced|uptodate|dirty|workingset|swapbacked|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfffffffe() raw: 00fff0000008021c ffffea0000c4ecc8 ffffc9000fe97678 ffff888081d6b998 raw: 00000000000008b8 0000000000000000 00000000fffffffe 0000000000000000 page dumped because: non-NULL mapping page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 9616, tgid 9614 (syz-executor.4), ts 1797918984351, free_ts 1795971846979 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3183 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4439 __folio_alloc+0x16/0x40 mm/page_alloc.c:4471 vma_alloc_folio+0x156/0x890 mm/mempolicy.c:2259 shmem_alloc_folio+0xb5/0x170 mm/shmem.c:1658 shmem_alloc_and_acct_folio+0xcb/0x140 mm/shmem.c:1683 shmem_get_folio_gfp+0xbe9/0x1890 mm/shmem.c:2020 shmem_get_folio mm/shmem.c:2143 [inline] shmem_write_begin+0x15c/0x460 mm/shmem.c:2688 generic_perform_write+0x278/0x600 mm/filemap.c:3945 shmem_file_write_iter+0x110/0x140 mm/shmem.c:2865 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/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:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] shmem_undo_range+0x582/0x1040 mm/shmem.c:1022 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x392/0xb50 mm/shmem.c:1243 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:733 [inline] dput+0x8dd/0xfd0 fs/dcache.c:913 __fput+0x536/0xa70 fs/file_table.c:392 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 Modules linked in: CPU: 0 PID: 9614 Comm: syz-executor.4 Tainted: G B 6.5.0-syzkaller-11704-g3f86ed6ec0b3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106 bad_page+0xb4/0x200 mm/page_alloc.c:513 free_page_is_bad_report mm/page_alloc.c:949 [inline] free_page_is_bad mm/page_alloc.c:959 [inline] free_pages_prepare mm/page_alloc.c:1128 [inline] free_unref_page_prepare+0x4ab/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98 zap_pte_range mm/memory.c:1534 [inline] zap_pmd_range mm/memory.c:1573 [inline] zap_pud_range mm/memory.c:1602 [inline] zap_p4d_range mm/memory.c:1623 [inline] unmap_page_range+0x19b7/0x2c10 mm/memory.c:1644 unmap_single_vma+0x194/0x2b0 mm/memory.c:1690 unmap_vmas+0x1e8/0x330 mm/memory.c:1731 exit_mmap+0x1ad/0xa60 mm/mmap.c:3210 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9b4/0x2a20 kernel/exit.c:861 do_group_exit+0xd4/0x2a0 kernel/exit.c:1024 get_signal+0x23d1/0x27b0 kernel/signal.c:2892 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fe0a7a7cae9 Code: Unable to access opcode bytes at 0x7fe0a7a7cabf. RSP: 002b:00007ffc790b1e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffdfc RBX: 00000000001b70de RCX: 00007fe0a7a7cae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fe0a7b9bf8c RBP: 0000000000000032 R08: 00007fe0a7b9bf8c R09: 00007fe0a7b9bf8c R10: 00007ffc790b1f50 R11: 0000000000000246 R12: 00007fe0a7b9bf8c R13: 00000000001b7110 R14: 00007ffc790b1f70 R15: 00007ffc790b1f50 BUG: Bad rss-counter state mm:ffff88808131eb00 type:MM_FILEPAGES val:3 BUG: Bad rss-counter state mm:ffff88808131eb00 type:MM_SHMEMPAGES val:-3