syzbot


BUG: Bad page state (8)
Status: upstream: reported on 2021/02/01 10:07
Reported-by: syzbot+97ef6376738cb5104a71@syzkaller.appspotmail.com
Fix commit: mm-filemap-add-filemap_range_uptodate-fix
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 485d, last: 5h37m
similar bugs (10):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: Bad page state (3) C 3 1601d 1608d 4/22 fixed on 2018/02/02 04:39
upstream BUG: Bad page state (5) C 171 1186d 1200d 0/22 closed as invalid on 2019/02/27 20:53
linux-4.19 BUG: Bad page state 1 188d 188d 0/1 auto-closed as invalid on 2022/03/21 10:57
upstream BUG: Bad page state (7) 3 636d 693d 0/22 auto-closed as invalid on 2020/12/28 02:44
android-49 BUG: Bad page state 3 969d 992d 0/3 auto-closed as invalid on 2020/01/30 18:48
android-54 BUG: Bad page state C 9 789d 820d 0/2 upstream: reported C repro on 2020/02/28 01:20
upstream BUG: Bad page state (2) 1 1644d 1640d 0/22 closed as invalid on 2017/12/06 12:57
upstream BUG: Bad page state (4) 1 1406d 1406d 0/22 closed as invalid on 2018/09/05 12:51
upstream BUG: Bad page state (6) C 2 1185d 1185d 0/22 closed as invalid on 2019/03/01 18:38
upstream BUG: Bad page state C 2 1747d 1747d 3/22 fixed on 2017/10/24 06:54

Sample crash report:
EXT4-fs (loop1): mounted filesystem without journal. Quota mode: none.
BUG: Bad page state in process syz-executor.1  pfn:36af4
page:ffffea0000dabd00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36af4
flags: 0xfff00000000001(locked|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000001 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Movable, gfp_mask 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 796, tgid 795 (syz-executor.1), ts 814000764852, free_ts 678923938876
 prep_new_page mm/page_alloc.c:2456 [inline]
 get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198
 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426
 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272
 folio_alloc+0x1c/0x70 mm/mempolicy.c:2282
 filemap_alloc_folio+0x8e/0xb0 mm/filemap.c:996
 page_cache_ra_unbounded+0x1af/0x550 mm/readahead.c:240
 do_page_cache_ra mm/readahead.c:291 [inline]
 page_cache_ra_order+0x680/0x940 mm/readahead.c:546
 ondemand_readahead+0x7c5/0x1150 mm/readahead.c:668
 page_cache_sync_ra+0x1c5/0x200 mm/readahead.c:695
 page_cache_sync_readahead include/linux/pagemap.h:1234 [inline]
 filemap_get_pages+0x2bf/0x17c0 mm/filemap.c:2592
 filemap_read+0x325/0xc70 mm/filemap.c:2679
 generic_file_read_iter+0x3b0/0x5a0 mm/filemap.c:2825
 ext4_file_read_iter+0x1d7/0x600 fs/ext4/file.c:132
 __kernel_read+0x4e1/0xa30 fs/read_write.c:440
 integrity_kernel_read+0x7b/0xb0 security/integrity/iint.c:199
 ima_calc_file_hash_tfm+0x2aa/0x3b0 security/integrity/ima/ima_crypto.c:484
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1371 [inline]
 free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421
 free_unref_page_prepare mm/page_alloc.c:3343 [inline]
 free_unref_page_list+0x16f/0xf80 mm/page_alloc.c:3475
 release_pages+0xff1/0x2290 mm/swap.c:980
 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:58
 zap_pte_range mm/memory.c:1518 [inline]
 zap_pmd_range mm/memory.c:1567 [inline]
 zap_pud_range mm/memory.c:1596 [inline]
 zap_p4d_range mm/memory.c:1617 [inline]
 unmap_page_range+0x202b/0x3710 mm/memory.c:1638
 unmap_single_vma+0x196/0x360 mm/memory.c:1686
 unmap_vmas+0x18c/0x310 mm/memory.c:1723
 exit_mmap+0x1c4/0x4a0 mm/mmap.c:3145
 __mmput+0x122/0x4b0 kernel/fork.c:1187
 mmput+0x56/0x60 kernel/fork.c:1208
 exit_mm kernel/exit.c:510 [inline]
 do_exit+0xa12/0x2a00 kernel/exit.c:782
 do_group_exit+0xd2/0x2f0 kernel/exit.c:925
 get_signal+0x22df/0x24c0 kernel/signal.c:2875
 arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:869
 exit_to_user_mode_loop kernel/entry/common.c:166 [inline]
 exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201
 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
 syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294
Modules linked in:
CPU: 1 PID: 796 Comm: syz-executor.1 Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 bad_page.cold+0x9c/0xbd mm/page_alloc.c:642
 check_free_page_bad mm/page_alloc.c:1206 [inline]
 check_free_page mm/page_alloc.c:1216 [inline]
 free_pages_prepare mm/page_alloc.c:1365 [inline]
 free_pcp_prepare+0x6b7/0xd20 mm/page_alloc.c:1421
 free_unref_page_prepare mm/page_alloc.c:3343 [inline]
 free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438
 __put_single_page mm/swap.c:106 [inline]
 __put_page+0x145/0x280 mm/swap.c:129
 folio_put_refs include/linux/mm.h:1220 [inline]
 filemap_free_folio+0x1e8/0x330 mm/filemap.c:237
 read_pages+0x819/0xf20 mm/readahead.c:170
 page_cache_ra_unbounded+0x3f5/0x550 mm/readahead.c:261
 do_page_cache_ra mm/readahead.c:291 [inline]
 page_cache_ra_order+0x680/0x940 mm/readahead.c:546
 ondemand_readahead+0x7c5/0x1150 mm/readahead.c:668
 page_cache_sync_ra+0x1c5/0x200 mm/readahead.c:695
 page_cache_sync_readahead include/linux/pagemap.h:1234 [inline]
 filemap_get_pages+0x2bf/0x17c0 mm/filemap.c:2592
 filemap_read+0x325/0xc70 mm/filemap.c:2679
 generic_file_read_iter+0x3b0/0x5a0 mm/filemap.c:2825
 ext4_file_read_iter+0x1d7/0x600 fs/ext4/file.c:132
 __kernel_read+0x4e1/0xa30 fs/read_write.c:440
 integrity_kernel_read+0x7b/0xb0 security/integrity/iint.c:199
 ima_calc_file_hash_tfm+0x2aa/0x3b0 security/integrity/ima/ima_crypto.c:484
 ima_calc_file_shash security/integrity/ima/ima_crypto.c:515 [inline]
 ima_calc_file_hash+0x191/0x4a0 security/integrity/ima/ima_crypto.c:572
 ima_collect_measurement+0x5ca/0x710 security/integrity/ima/ima_api.c:292
 process_measurement+0xd0d/0x1880 security/integrity/ima/ima_main.c:337
 ima_file_check+0xac/0x100 security/integrity/ima/ima_main.c:517
 do_open fs/namei.c:3479 [inline]
 path_openat+0x161a/0x2910 fs/namei.c:3610
 do_filp_open+0x1aa/0x400 fs/namei.c:3637
 do_sys_openat2+0x16d/0x4c0 fs/open.c:1254
 do_sys_open fs/open.c:1270 [inline]
 __do_sys_openat fs/open.c:1286 [inline]
 __se_sys_openat fs/open.c:1281 [inline]
 __x64_sys_openat+0x13f/0x1f0 fs/open.c:1281
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f3dbc289109
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3dbd450168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f3dbc39bf60 RCX: 00007f3dbc289109
RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000005
RBP: 00007f3dbc2e308d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffd65b8a7f R14: 00007f3dbd450300 R15: 0000000000022000
 </TASK>

Crashes (198):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2022/05/28 18:28 upstream 9d004b2f4fea a46af346 .config log report info BUG: Bad page state
ci-upstream-kasan-gce-root 2022/05/28 13:48 upstream 9d004b2f4fea a46af346 .config log report info BUG: Bad page state
ci-qemu-upstream 2022/05/28 11:31 upstream 9d004b2f4fea a46af346 .config log report info BUG: Bad page state
ci-upstream-kasan-gce-selinux-root 2022/05/28 01:52 upstream 8291eaafed36 a46af346 .config log report info BUG: Bad page state
ci-qemu-upstream 2022/05/27 15:06 upstream 7e284070abe5 116e7a7b .config log report info BUG: Bad page state
ci-upstream-kasan-gce-root 2022/05/27 10:47 upstream 7e284070abe5 116e7a7b .config log report info BUG: Bad page state
ci-upstream-kasan-gce-smack-root 2022/05/26 21:38 upstream babf0bb978e3 3037caa9 .config log report info BUG: Bad page state
ci-upstream-kasan-gce-smack-root 2022/05/26 02:31 upstream 7e062cda7d90 3037caa9 .config log report info BUG: Bad page state
ci-upstream-kasan-gce-smack-root 2022/05/25 14:13 upstream fdaf9a5840ac 647c0e27 .config log report info BUG: Bad page state
ci-upstream-kasan-gce 2022/03/22 09:29 upstream eaa54b1458ca e2d91b1d .config log report info BUG: Bad page state
ci-qemu-upstream-386 2022/05/28 16:12 upstream 9d004b2f4fea a46af346 .config log report info BUG: Bad page state
ci-qemu-upstream-386 2022/05/27 16:26 upstream 7e284070abe5 116e7a7b .config log report info BUG: Bad page state
ci-qemu-upstream-386 2022/05/27 13:03 upstream 7e284070abe5 116e7a7b .config log report info BUG: Bad page state
ci-upstream-kasan-gce-386 2022/05/25 15:40 upstream fdaf9a5840ac 647c0e27 .config log report info BUG: Bad page state
ci-upstream-kasan-gce-386 2022/05/25 13:29 upstream fdaf9a5840ac 647c0e27 .config log report info BUG: Bad page state
ci-upstream-kasan-gce-386 2022/05/25 11:58 upstream fdaf9a5840ac 647c0e27 .config log report info BUG: Bad page state
ci-upstream-bpf-kasan-gce 2022/02/09 04:39 bpf fe68195daf34 0b33604d .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/26 20:09 linux-next b1d84fc09a96 3037caa9 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/24 22:33 linux-next 09ce5091ff97 fcfad4ff .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/24 10:06 linux-next 09ce5091ff97 e7f9308d .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/24 04:26 linux-next cc63e8e92cb8 e7f9308d .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/23 10:02 linux-next 18ecd30af1a8 4c7657cb .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/23 08:29 linux-next 18ecd30af1a8 7268fa62 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/20 19:55 linux-next 18ecd30af1a8 bd37ad7e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/20 17:07 linux-next 18ecd30af1a8 bd37ad7e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/20 03:54 linux-next 3f7bdc402fb0 cb1ac2e7 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/20 01:36 linux-next 3f7bdc402fb0 cb1ac2e7 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/18 17:39 linux-next 3f7bdc402fb0 50c53f39 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/18 16:31 linux-next 3f7bdc402fb0 50c53f39 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/18 07:23 linux-next 3f7bdc402fb0 744a39e2 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/17 00:22 linux-next 3f7bdc402fb0 744a39e2 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/16 10:42 linux-next 1e1b28b936ae 744a39e2 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/15 19:37 linux-next 1e1b28b936ae 744a39e2 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/14 09:06 linux-next 1e1b28b936ae 744a39e2 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/13 20:30 linux-next 1e1b28b936ae 107f6434 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/13 11:44 linux-next 1e1b28b936ae 107f6434 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/13 09:30 linux-next 1e1b28b936ae 9ad6612a .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/12 19:06 linux-next 187b9ac8c348 9ad6612a .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/12 15:30 linux-next 187b9ac8c348 9ad6612a .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/12 11:37 linux-next 187b9ac8c348 beb0b407 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/12 00:36 linux-next 38a288f5941e beb0b407 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/10 23:56 linux-next 38a288f5941e 8d7b3b67 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/10 21:54 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/10 13:18 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/10 11:36 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/10 03:32 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/10 01:53 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/09 18:17 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/09 16:29 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/09 10:14 linux-next 38a288f5941e 8b277b8e .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/09 07:03 linux-next 38a288f5941e e60b1103 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/09 04:18 linux-next 38a288f5941e e60b1103 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2022/05/09 02:55 linux-next 38a288f5941e e60b1103 .config log report info BUG: Bad page state
ci2-upstream-usb 2021/12/21 12:44 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 4daf08a0afa8 a938f0b8 .config log report info BUG: Bad page state
ci-upstream-linux-next-kasan-gce-root 2021/01/28 10:01 linux-next d03154e8bb6a eefc07f2 .config log report info BUG: Bad page state