panic: malloc: out of space in kmem_map Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *523325 36216 0 0x2 0 1K syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 malloc(200000,2a,9) at malloc+0xad5 sys/kern/kern_malloc.c:242 kcovioctl(1b1300,80084b01,ffff800020c0f880,3,ffff800020b8b2d8) at kcovioctl+0xe6 kd_init sys/dev/kcov.c:405 [inline] kcovioctl(1b1300,80084b01,ffff800020c0f880,3,ffff800020b8b2d8) at kcovioctl+0xe6 sys/dev/kcov.c:298 VOP_IOCTL(fffffd8071847730,80084b01,ffff800020c0f880,3,fffffd807f7c69c0,ffff800020b8b2d8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8068c05e58,80084b01,ffff800020c0f880,ffff800020b8b2d8) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b8b2d8,ffff800020c0f9c0,ffff800020c0f9b0) at sys_ioctl+0x651 syscall(ffff800020c0fa60) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c0fa60) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,36,7f7fffff5958,36,3,e23a8340890) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff5470, count: 6 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic malloc: out of space in kmem_map ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x174 sys/kern/subr_prf.c:208 malloc(200000,2a,9) at malloc+0xad5 sys/kern/kern_malloc.c:242 kcovioctl(1b1300,80084b01,ffff800020c0f880,3,ffff800020b8b2d8) at kcovioctl+0xe6 kd_init sys/dev/kcov.c:405 [inline] kcovioctl(1b1300,80084b01,ffff800020c0f880,3,ffff800020b8b2d8) at kcovioctl+0xe6 sys/dev/kcov.c:298 VOP_IOCTL(fffffd8071847730,80084b01,ffff800020c0f880,3,fffffd807f7c69c0,ffff800020b8b2d8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8068c05e58,80084b01,ffff800020c0f880,ffff800020b8b2d8) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b8b2d8,ffff800020c0f9c0,ffff800020c0f9b0) at sys_ioctl+0x651 syscall(ffff800020c0fa60) at syscall+0x5b8 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c0fa60) at syscall+0x5b8 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,36,7f7fffff5958,36,3,e23a8340890) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff5470, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff800020c0f4b0 rbx 0xffff800020c0f560 rdx 0xffffffff81f875b8 apollo_pio_rec+0x91e4 rcx 0 rax 0 r8 0xffffffff8106c163 kprintf+0x183 r9 0x1 r10 0x25 r11 0x7d82958893798823 r12 0x3000000008 r13 0xffff800020c0f4c0 r14 0x100 r15 0x1 rip 0xffffffff81ba3af8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c0f4a0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=523325 stat=onproc flags process=2 proc=0 pri=54, usrpri=54, nice=20 forw=0xffffffffffffffff, list=0xffff800020b8a018,0xffffffff823df7d8 process=0xffff800020b7d080 user=0xffff800020c0a000, vmspace=0xfffffd807effe2d0 estcpu=4, cpticks=3, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND *36216 523325 68855 0 7 0x2 syz-executor.0 49307 34689 1 0 3 0x100083 ttyin getty 44360 107492 68855 0 3 0x82 piperd syz-executor.1 25484 307237 0 0 3 0x14200 bored sosplice 68855 341586 9931 0 3 0x82 thrsleep syz-fuzzer 68855 516194 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 336736 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 162578 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 489956 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 330215 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 68996 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 426096 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 456111 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 398317 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 19491 9931 0 3 0x4000082 thrsleep syz-fuzzer 68855 519923 9931 0 3 0x4000082 kqread syz-fuzzer 9931 213011 15978 0 3 0x10008a pause ksh 15978 524181 3016 0 3 0x92 select sshd 3016 16494 1 0 3 0x80 select sshd 92296 422403 74617 74 3 0x100092 bpf pflogd 74617 416361 1 0 3 0x80 netio pflogd 62323 406446 52993 73 3 0x100090 kqread syslogd 52993 369088 1 0 3 0x100082 netio syslogd 68579 90395 1 77 3 0x100090 poll dhclient 24558 9040 1 0 3 0x80 poll dhclient 18372 180977 0 0 3 0x14200 pgzero zerothread 40917 144687 0 0 3 0x14200 aiodoned aiodoned 5147 315705 0 0 3 0x14200 syncer update 43603 468017 0 0 3 0x14200 cleaner cleaner 52404 102049 0 0 3 0x14200 reaper reaper 35222 364862 0 0 3 0x14200 pgdaemon pagedaemon 77840 242253 0 0 3 0x14200 bored crynlk 22227 207548 0 0 3 0x14200 bored crypto 55414 108263 0 0 3 0x40014200 acpi0 acpi0 71274 201145 0 0 3 0x40014200 idle1 58950 22597 0 0 3 0x14200 bored softnet 61227 419023 0 0 3 0x14200 bored systqmp 52428 200961 0 0 3 0x14200 bored systq 67604 500128 0 0 3 0x40014200 bored softclock 72887 380281 0 0 7 0x40014200 idle0 57976 388614 0 0 3 0x14200 bored smr 1 148841 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 36216 (syz-executor.0) thread 0xffff800020b8b2d8 (523325) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff823d7a38) locked @ /syzkaller/managers/multicore/kernel/sys/sys/syscall_mi.h:90 #0 witness_lock+0x594 sys/kern/subr_witness.c:1201 #1 syscall+0x48b mi_syscall sys/sys/syscall_mi.h:91 [inline] #1 syscall+0x48b sys/arch/amd64/amd64/trap.c:574 #2 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9533 71957K 71965K 78643K 11351 0 0 pcb 25 9K 10K 78643K 417 0 0 rtable 85 3K 4K 78643K 3178 0 0 ifaddr 59 14K 15K 78643K 658 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1569 0 0 iov 0 0K 28K 78643K 242 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1206 76K 76K 78643K 3074 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 10 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 123 0 0 dirhash 15 2K 2K 78643K 15 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 4 9K 21K 78643K 1529 0 0 sigio 0 0K 0K 78643K 14 0 0 proc 54 51K 71K 78643K 2270 0 0 subproc 53 55297K 67586K 78643K 3165 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 89 0 0 in_multi 22 1K 2K 78643K 1062 0 0 ether_multi 1 0K 0K 78643K 6 0 0 mrt 0 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 78 344K 344K 78643K 78 0 0 exec 0 0K 1K 78643K 696 0 0 pfkey data 0 0K 0K 78643K 4 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 85 13K 29K 78643K 5823 0 0 UVM aobj 45 2K 2K 78643K 48 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 13 0 0 NDP 13 0K 0K 78643K 300 0 0 temp 173 2379K 2444K 78643K 12272 0 0 kqueue 0 0K 0K 78643K 12 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 94 0 91 1 0 1 1 0 8 0 inpcbpl 280 633 0 626 1 0 1 1 0 8 0 plimitpl 152 129 0 121 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 854 0 823 2 0 2 2 0 8 1 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 11 0 11 1 1 0 1 0 8 0 tcpcb 544 162 0 158 1 0 1 1 0 8 0 nd6 48 184 0 182 1 0 1 1 0 8 0 ppxss 1128 10 0 10 3 3 0 1 0 8 0 pffrent 40 2 0 2 1 1 0 1 0 8 0 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 114 0 92 1 0 1 1 0 8 0 pfstkey 112 114 0 92 1 0 1 1 0 8 0 pfstate 328 114 0 92 3 0 3 3 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 4080 0 3933 12 0 12 12 0 8 2 art_table 32 4081 0 3933 2 0 2 2 0 8 0 art_node 16 850 0 822 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 6 2 1 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 117 0 107 1 0 1 1 0 8 0 shmpl 112 46 0 3 2 0 2 2 0 8 0 dirhash 1024 19 0 0 3 0 3 3 0 8 0 dino1pl 128 3017 0 1233 58 0 58 58 0 8 0 ffsino 272 3017 0 1233 119 0 119 119 0 8 0 nchpl 144 4911 0 2921 74 0 74 74 0 8 0 uvmvnodes 72 4669 0 0 85 0 85 85 0 8 0 vnodes 200 4669 0 0 246 0 246 246 0 8 0 namei 1024 18502 0 18502 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 12298 0 12298 10 9 1 6 0 8 1 sigapl 432 1454 0 1440 2 0 2 2 0 8 0 futexpl 56 8613 0 8613 1 0 1 1 0 8 1 knotepl 112 1836 0 1807 3 2 1 2 0 8 0 kqueuepl 104 192 0 190 1 0 1 1 0 8 0 pipepl 112 1272 0 1253 2 1 1 1 0 8 0 fdescpl 488 1455 0 1440 3 0 3 3 0 8 0 filepl 152 8676 0 8583 12 8 4 6 0 8 0 lockfpl 104 440 0 440 2 1 1 1 0 8 1 lockfspl 32 410 0 410 2 1 1 1 0 8 1 sessionpl 112 110 0 100 1 0 1 1 0 8 0 pgrppl 48 126 0 116 1 0 1 1 0 8 0 ucredpl 96 1144 0 1135 1 0 1 1 0 8 0 zombiepl 144 1440 0 1440 2 1 1 1 0 8 1 processpl 840 1471 0 1440 4 0 4 4 0 8 0 procpl 600 3250 0 3208 5 1 4 5 0 8 0 srpgc 64 538 0 538 3 2 1 1 0 8 1 sosppl 128 17 0 17 6 6 0 1 0 8 0 sockpl 384 986 0 967 3 0 3 3 0 8 1 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 10 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 5 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 116 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 205 0 0 8 0 8 8 0 8 0 bufpl 256 7216 0 1045 386 0 386 386 0 8 0 anonpl 16 143549 0 136494 75 39 36 46 0 125 0 amapchunkpl 152 12147 0 12060 17 12 5 9 0 158 0 amappl16 192 5808 0 5356 70 46 24 36 0 8 0 amappl15 184 109 0 108 1 0 1 1 0 8 0 amappl14 176 309 0 303 1 0 1 1 0 8 0 amappl13 168 404 0 401 1 0 1 1 0 8 0 amappl12 160 281 0 279 2 1 1 1 0 8 0 amappl11 152 776 0 763 1 0 1 1 0 8 0 amappl10 144 118 0 114 1 0 1 1 0 8 0 amappl9 136 829 0 825 1 0 1 1 0 8 0 amappl8 128 761 0 745 1 0 1 1 0 8 0 amappl7 120 346 0 334 1 0 1 1 0 8 0 amappl6 112 316 0 306 1 0 1 1 0 8 0 amappl5 104 387 0 372 1 0 1 1 0 8 0 amappl4 96 466 0 437 2 1 1 2 0 8 0 amappl3 88 367 0 362 1 0 1 1 0 8 0 amappl2 80 8981 0 8936 2 0 2 2 0 8 0 amappl1 72 44916 0 44493 24 14 10 19 0 8 0 amappl 72 4274 0 4241 1 0 1 1 0 75 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 47 0 3 1 0 1 1 0 8 0 uaddrrnd 24 1455 0 1440 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1455 0 1440 1 0 1 1 0 8 0 vmmpekpl 168 14866 0 14845 2 0 2 2 0 8 0 vmmpepl 168 193573 0 192217 154 73 81 95 0 357 13 vmsppl 360 1454 0 1440 2 0 2 2 0 8 0 pdppl 4096 2918 0 2880 6 0 6 6 0 8 0 pvpl 32 495354 0 485164 173 66 107 121 0 265 5 pmappl 224 1454 0 1440 10 9 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 559 0 3 16 0 16 16 0 8 0