syzbot


netbsd boot error: panic: pmap_get_physpage: out of memory

Status: fixed on 2022/08/06 11:34
Reported-by: syzbot+ca3710b4c40cdd61aa72@syzkaller.appspotmail.com
Fix commit: 1369379d4106 allow KMSAN to work again by restoring the limiting of kva even with NKMEMPAGES_MAX_UNLIMITED. we used to limit kva to 1/8 of physmem but limiting to 1/4 should be enough, and 1/4 still gives the kernel enough kva to map all of the RAM that KMSAN has not stolen.
First crash: 841d, last: 838d

Sample crash report:
[   1.0000000] panic: pmap_get_physpage: out of memory
[   1.0000000] cpu0: Begin traceback...
[   1.0000000] vpanic() at netbsd:vpanic+0xc9d
[   1.0000000] panic() at netbsd:panic+0x1b3 sys/kern/subr_prf.c:210
[   1.0000000] pmap_get_physpage() at netbsd:pmap_get_physpage+0x5a6 sys/arch/x86/x86/pmap.c:5452
[   1.0000000] kmsan_md_shadow_map_page() at netbsd:kmsan_md_shadow_map_page+0x209 sys/arch/amd64/compile/obj/GENERIC_SYZKALLER/./machine/msan.h:156
[   1.0000000] kmsan_shadow_map() at netbsd:kmsan_shadow_map+0xa8 sys/kern/subr_msan.c:488
[   1.0000000] pmap_growkernel() at netbsd:pmap_growkernel+0x59a sys/arch/x86/x86/pmap.c:5612
[   1.0000000] uvm_km_bootstrap() at netbsd:uvm_km_bootstrap+0x8c6 sys/uvm/uvm_km.c:346
[   1.0000000] uvm_init() at netbsd:uvm_init+0x162 sys/uvm/uvm_init.c:131
[   1.0000000] main() at netbsd:main+0x37c sys/kern/init_main.c:317
[   1.0000000] cpu0: End traceback...
[   1.0000000] fatal breakpoint trap in supervisor mode
[   1.0000000] trap type 1 code 0 rip 0xffffffff802228ad cs 0x8 rflags 0x286 cr2 0 ilevel 0x8 rsp 0xffffffff86c69910
[   1.0000000] curlwp 0xffffffff86868f00 pid 0.0 lowest kstack 0xffffffff86c622c0
Stopped in pid 0.0 (system) at  netbsd:breakpoint+0x5:  leave
breakpoint() at netbsd:breakpoint+0x5
vpanic() at netbsd:vpanic+0xc9d
panic() at netbsd:panic+0x1b3 sys/kern/subr_prf.c:210
pmap_get_physpage() at netbsd:pmap_get_physpage+0x5a6 sys/arch/x86/x86/pmap.c:5452
kmsan_md_shadow_map_page() at netbsd:kmsan_md_shadow_map_page+0x209 sys/arch/amd64/compile/obj/GENERIC_SYZKALLER/./machine/msan.h:156
kmsan_shadow_map() at netbsd:kmsan_shadow_map+0xa8 sys/kern/subr_msan.c:488
pmap_growkernel() at netbsd:pmap_growkernel+0x59a sys/arch/x86/x86/pmap.c:5612
uvm_km_bootstrap() at netbsd:uvm_km_bootstrap+0x8c6 sys/uvm/uvm_km.c:346
uvm_init() at netbsd:uvm_init+0x162 sys/uvm/uvm_init.c:131
main() at netbsd:main+0x37c sys/kern/init_main.c:317
ds          d918
es          4cd3
fs          9900
gs          0
rdi         5
rsi         0
rbp         ffffffff86c69910
rbx         0
rdx         1
rcx         1910
rax         ffffffff8688d918    msan_lwp0+0x1918
r8          ffffffff8688d918    msan_lwp0+0x1918
--db_more--

Crashes (51):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/08/06 06:11 netbsd 328ac5551717 e853abd9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/06 03:22 netbsd 57741bed1335 e853abd9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/06 00:32 netbsd 4a8f1768682b e853abd9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 21:05 netbsd 1bfb199dffe9 e853abd9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 21:05 netbsd 1bfb199dffe9 e853abd9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 15:06 netbsd 1bfb199dffe9 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 15:06 netbsd 1bfb199dffe9 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 15:06 netbsd 1bfb199dffe9 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 12:09 netbsd c32cbf493337 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 12:09 netbsd c32cbf493337 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 12:09 netbsd c32cbf493337 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 09:57 netbsd 80c847fb084f a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 09:57 netbsd 80c847fb084f a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 09:57 netbsd 80c847fb084f a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 08:44 netbsd a3cd42a2fe58 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 08:44 netbsd a3cd42a2fe58 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 08:44 netbsd a3cd42a2fe58 a65a7ce9 .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 01:02 netbsd a3cd42a2fe58 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 01:02 netbsd a3cd42a2fe58 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/05 01:02 netbsd a3cd42a2fe58 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 15:53 netbsd 728d91fdb30d 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 15:53 netbsd 728d91fdb30d 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 15:53 netbsd 728d91fdb30d 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 13:08 netbsd bbeae7732bb9 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 13:08 netbsd bbeae7732bb9 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 13:08 netbsd bbeae7732bb9 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 01:32 netbsd b07b55c43e9d 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 01:32 netbsd b07b55c43e9d 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/04 01:32 netbsd b07b55c43e9d 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 23:20 netbsd 5d2f980304d3 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 23:20 netbsd 5d2f980304d3 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 23:20 netbsd 5d2f980304d3 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 16:08 netbsd 6160c84baeee 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 16:08 netbsd 6160c84baeee 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 16:08 netbsd 6160c84baeee 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 13:38 netbsd 5a2ff75e91f2 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 13:38 netbsd 5a2ff75e91f2 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 13:38 netbsd 5a2ff75e91f2 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 10:21 netbsd 5a58ac01bdf1 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 10:21 netbsd 5a58ac01bdf1 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 10:21 netbsd 5a58ac01bdf1 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 08:42 netbsd 5b0ba9719b32 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 08:42 netbsd 5b0ba9719b32 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
2022/08/03 08:42 netbsd 5b0ba9719b32 1c9013ac .config console log report ci2-netbsd-kmsan netbsd boot error: panic: pmap_get_physpage: out of memory
* Struck through repros no longer work on HEAD.