syzbot


linux-next test error: kernel BUG in folio_add_new_anon_rmap

Status: upstream: reported on 2024/10/08 06:51
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+619c487ed60780dab217@syzkaller.appspotmail.com
Fix commit: mm-add-pageanonnotksm-fix
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm 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-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root 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-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 78d, last: 74d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] linux-next test error: kernel BUG in folio_add_new_anon_rmap 3 (4) 2024/10/11 10:11

Sample crash report:
cfg80211: Loading compiled-in X.509 certificates for regulatory database
Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
clk: Disabling unused clocks
ALSA device list:
  #0: Dummy 1
  #1: Loopback 1
  #2: Virtual MIDI Card 1
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
EXT4-fs (sda1): mounted filesystem b4773fba-1738-4da0-8a90-0fe043d0a496 ro with ordered data mode. Quota mode: none.
VFS: Mounted root (ext4 filesystem) readonly on device 8:1.
devtmpfs: mounted
Freeing unused kernel image (initmem) memory: 26720K
Write protecting the kernel read-only data: 219136k
Freeing unused kernel image (rodata/data gap) memory: 1108K
x86/mm: Checked W+X mappings: passed, no W+X pages found.
x86/mm: Checking user space page tables
x86/mm: Checked W+X mappings: passed, no W+X pages found.
Failed to set sysctl parameter 'max_rcu_stall_to_panic=1': parameter not found
Run /sbin/init as init process
page: refcount:1 mapcount:1 mapping:0000000000000000 index:0x7fffffffe pfn:0x13fe93
memcg:ffff888140adc000
anon flags: 0x17ff00000020008(uptodate|swapbacked|node=0|zone=2|lastcpupid=0x7ff)
raw: 017ff00000020008 0000000000000000 dead000000000122 ffff888030587001
raw: 00000007fffffffe 0000000000000000 0000000100000000 ffff888140adc000
page dumped because: VM_BUG_ON_PAGE(PageAnonNotKsm(page))
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Movable, gfp_mask 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 1, tgid 1 (swapper/0), ts 14891998308, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1537
 prep_new_page mm/page_alloc.c:1545 [inline]
 get_page_from_freelist+0x3129/0x3270 mm/page_alloc.c:3493
 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4769
 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
 folio_alloc_mpol_noprof mm/mempolicy.c:2283 [inline]
 vma_alloc_folio_noprof+0x12e/0x230 mm/mempolicy.c:2314
 folio_prealloc+0x31/0x170
 alloc_anon_folio mm/memory.c:4738 [inline]
 do_anonymous_page mm/memory.c:4795 [inline]
 do_pte_missing mm/memory.c:3971 [inline]
 handle_pte_fault+0x2518/0x6830 mm/memory.c:5778
 __handle_mm_fault mm/memory.c:5921 [inline]
 handle_mm_fault+0x1106/0x1bb0 mm/memory.c:6089
 faultin_page mm/gup.c:1187 [inline]
 __get_user_pages+0x1b16/0x48d0 mm/gup.c:1485
 __get_user_pages_locked mm/gup.c:1751 [inline]
 get_user_pages_remote+0x31e/0xb60 mm/gup.c:2618
 get_arg_page+0x266/0x580 fs/exec.c:225
 copy_string_kernel+0x148/0x1f0 fs/exec.c:684
 kernel_execve+0x5e2/0xa50 fs/exec.c:1999
 try_to_run_init_process init/main.c:1394 [inline]
 kernel_init+0xed/0x2b0 init/main.c:1522
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page_owner free stack trace missing
------------[ cut here ]------------
kernel BUG at include/linux/page-flags.h:1134!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0-rc1-next-20241004-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:SetPageAnonExclusive include/linux/page-flags.h:1134 [inline]
RIP: 0010:folio_add_new_anon_rmap+0x14d3/0x1fe0 mm/rmap.c:1442
Code: ff 0f 00 00 0f 84 9e 02 00 00 e8 28 91 a9 ff e9 fa ec ff ff e8 1e 91 a9 ff 48 8b 3c 24 48 c7 c6 e0 ff 15 8c e8 3e 13 f5 ff 90 <0f> 0b e8 06 91 a9 ff 48 89 ef 48 c7 c6 a0 00 16 8c e8 27 13 f5 ff
RSP: 0000:ffffc90000067348 EFLAGS: 00010246
RAX: 3219d577e7cba600 RBX: 0000000000000001 RCX: ffffc90000066f03
RDX: 0000000000000003 RSI: ffffffff8c0adc40 RDI: ffffffff8c610f60
RBP: 0000000000000000 R08: ffffffff901d2caf R09: 1ffffffff203a595
R10: dffffc0000000000 R11: fffffbfff203a596 R12: 00000007fffffffe
R13: 1ffff1100614ca00 R14: ffff888030587001 R15: ffff888030a65078
FS:  0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000000e734000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 do_anonymous_page mm/memory.c:4841 [inline]
 do_pte_missing mm/memory.c:3971 [inline]
 handle_pte_fault+0x4aec/0x6830 mm/memory.c:5778
 __handle_mm_fault mm/memory.c:5921 [inline]
 handle_mm_fault+0x1106/0x1bb0 mm/memory.c:6089
 faultin_page mm/gup.c:1187 [inline]
 __get_user_pages+0x1b16/0x48d0 mm/gup.c:1485
 __get_user_pages_locked mm/gup.c:1751 [inline]
 get_user_pages_remote+0x31e/0xb60 mm/gup.c:2618
 get_arg_page+0x266/0x580 fs/exec.c:225
 copy_string_kernel+0x148/0x1f0 fs/exec.c:684
 kernel_execve+0x5e2/0xa50 fs/exec.c:1999
 try_to_run_init_process init/main.c:1394 [inline]
 kernel_init+0xed/0x2b0 init/main.c:1522
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:SetPageAnonExclusive include/linux/page-flags.h:1134 [inline]
RIP: 0010:folio_add_new_anon_rmap+0x14d3/0x1fe0 mm/rmap.c:1442
Code: ff 0f 00 00 0f 84 9e 02 00 00 e8 28 91 a9 ff e9 fa ec ff ff e8 1e 91 a9 ff 48 8b 3c 24 48 c7 c6 e0 ff 15 8c e8 3e 13 f5 ff 90 <0f> 0b e8 06 91 a9 ff 48 89 ef 48 c7 c6 a0 00 16 8c e8 27 13 f5 ff
RSP: 0000:ffffc90000067348 EFLAGS: 00010246
RAX: 3219d577e7cba600 RBX: 0000000000000001 RCX: ffffc90000066f03
RDX: 0000000000000003 RSI: ffffffff8c0adc40 RDI: ffffffff8c610f60
RBP: 0000000000000000 R08: ffffffff901d2caf R09: 1ffffffff203a595
R10: dffffc0000000000 R11: fffffbfff203a596 R12: 00000007fffffffe
R13: 1ffff1100614ca00 R14: ffff888030587001 R15: ffff888030a65078
FS:  0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000000e734000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/08 02:37 linux-next 58ca61c1a866 402f1df0 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next test error: kernel BUG in folio_add_new_anon_rmap
2024/10/04 06:41 linux-next 58ca61c1a866 d7906eff .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next test error: kernel BUG in folio_add_new_anon_rmap
* Struck through repros no longer work on HEAD.