syzbot


BUG: Bad page state in copy_page_range

Status: upstream: reported on 2025/12/01 15:49
Reported-by: syzbot+67cdf06e16f3eeb0d99d@syzkaller.appspotmail.com
First crash: 51d, last: 17d

Sample crash report:
BUG: Bad page state in process udevd  pfn:2464a
page:ffffea0000919280 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2464a
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfffffdff(table)
raw: 00fff00000000000 ffffea000175b1c8 ffffea0000b5d988 0000000000000000
raw: 0000000000000000 ffff88802e8e06c0 00000000fffffdff 0000000000000000
page dumped because: nonzero mapcount
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x540dc0(GFP_USER|__GFP_COMP|__GFP_ZERO|__GFP_ACCOUNT), pid 5767, tgid 5767 (syz-executor), ts 119605611445, free_ts 119560901069
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 prep_new_page mm/page_alloc.c:1561 [inline]
 get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
 pagetable_alloc include/linux/mm.h:2900 [inline]
 __pte_alloc_one include/asm-generic/pgalloc.h:68 [inline]
 pte_alloc_one+0x89/0x540 arch/x86/mm/pgtable.c:33
 __pte_alloc+0x22/0x2a0 mm/memory.c:438
 copy_pte_range mm/memory.c:1029 [inline]
 copy_pmd_range mm/memory.c:1168 [inline]
 copy_pud_range mm/memory.c:1205 [inline]
 copy_p4d_range mm/memory.c:1229 [inline]
 copy_page_range+0x2d72/0x3600 mm/memory.c:1323
 dup_mmap kernel/fork.c:764 [inline]
 dup_mm kernel/fork.c:1692 [inline]
 copy_mm+0x11a8/0x1ca0 kernel/fork.c:1741
 copy_process+0x16d3/0x3d70 kernel/fork.c:2506
 kernel_clone+0x21b/0x840 kernel/fork.c:2914
 __do_sys_clone kernel/fork.c:3057 [inline]
 __se_sys_clone kernel/fork.c:3041 [inline]
 __x64_sys_clone+0x18c/0x1e0 kernel/fork.c:3041
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1154 [inline]
 free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336
 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2475
 release_pages+0x1fa0/0x2220 mm/swap.c:1022
 __folio_batch_release+0x71/0xe0 mm/swap.c:1042
 folio_batch_release include/linux/pagevec.h:83 [inline]
 truncate_inode_pages_range+0x358/0xf00 mm/truncate.c:396
 evict+0x499/0x870 fs/inode.c:707
 erofs_put_super+0x7b/0x150 fs/erofs/super.c:815
 generic_shutdown_super+0x134/0x2b0 fs/super.c:693
 kill_block_super+0x44/0x90 fs/super.c:1660
 erofs_kill_sb+0x4c/0x140 fs/erofs/super.c:794
 deactivate_locked_super+0x97/0x100 fs/super.c:481
 cleanup_mnt+0x429/0x4c0 fs/namespace.c:1259
 task_work_run+0x1ce/0x250 kernel/task_work.c:239
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xf6/0x180 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
Modules linked in:
CPU: 0 PID: 5781 Comm: udevd Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 bad_page+0x14b/0x170 mm/page_alloc.c:512
 free_page_is_bad mm/page_alloc.c:961 [inline]
 free_pages_prepare mm/page_alloc.c:1146 [inline]
 free_unref_page_prepare+0x887/0x8e0 mm/page_alloc.c:2336
 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2475
 release_pages+0x1fa0/0x2220 mm/swap.c:1022
 folios_put include/linux/mm.h:1548 [inline]
 folio_batch_move_lru+0x5bb/0x6b0 mm/swap.c:216
 lru_add_drain_cpu+0x10e/0x8c0 mm/swap.c:644
 lru_add_drain+0x121/0x3e0 mm/swap.c:744
 __folio_batch_release+0x48/0xe0 mm/swap.c:1039
 folio_batch_release include/linux/pagevec.h:83 [inline]
 shmem_undo_range+0x5d0/0x1a40 mm/shmem.c:1026
 shmem_truncate_range mm/shmem.c:1135 [inline]
 shmem_evict_inode+0x273/0xa70 mm/shmem.c:1264
 evict+0x486/0x870 fs/inode.c:705
 __dentry_kill+0x431/0x650 fs/dcache.c:611
 dentry_kill+0xb8/0x290 fs/dcache.c:-1
 dput+0xfe/0x1e0 fs/dcache.c:918
 do_renameat2+0x8b1/0xc70 fs/namei.c:5035
 __do_sys_rename fs/namei.c:5079 [inline]
 __se_sys_rename fs/namei.c:5077 [inline]
 __x64_sys_rename+0x86/0x90 fs/namei.c:5077
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f5b9ea7acc7
Code: e8 5e a7 09 00 f7 d8 19 c0 5b c3 0f 1f 84 00 00 00 00 00 b8 ff ff ff ff 5b c3 66 0f 1f 84 00 00 00 00 00 b8 52 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 01 61 17 00 f7 d8 64 89 02 b8
RSP: 002b:00007ffdf16169a8 EFLAGS: 00000202 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00005613d1aaca10 RCX: 00007f5b9ea7acc7
RDX: 00005613d1a86010 RSI: 00007ffdf16169c0 RDI: 00007ffdf1616dc0
RBP: 00005613d1a99e20 R08: 00000000000001e0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffdf16169c0
R13: 00007ffdf1616dc0 R14: 0000000000000000 R15: 00005613af7b49dd
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/04 10:29 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan BUG: Bad page state in copy_page_range
2025/12/01 15:48 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan BUG: Bad page state in copy_page_range
* Struck through repros no longer work on HEAD.