panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *490239 51334 0 0 0x4000000 0 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 amap_pp_adjref(fffffd803d396470,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000c00400,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000c00400,0,7,fffffd803f013440,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000c00400,0,7,fffffd803f013440,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017bce060,ffff8000ffff2780) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000b4a000,ffff8000ffff2780) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000b4a000,ffff8000ffff2780) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8036157820,c5005601,ffff800000b4a000,1,fffffd803f7c69c0,ffff8000ffff2780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8022c46800,c5005601,ffff800000b4a000,ffff8000ffff2780) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2780,ffff800017c17898,ffff800017c178e0) at sys_ioctl+0x5b9 syscall(ffff800017c17960) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x255666de970, count: 3 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic amap_pp_adjref: negative reference count ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 amap_pp_adjref(fffffd803d396470,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000c00400,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000c00400,0,7,fffffd803f013440,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000c00400,0,7,fffffd803f013440,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017bce060,ffff8000ffff2780) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000b4a000,ffff8000ffff2780) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000b4a000,ffff8000ffff2780) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8036157820,c5005601,ffff800000b4a000,1,fffffd803f7c69c0,ffff8000ffff2780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8022c46800,c5005601,ffff800000b4a000,ffff8000ffff2780) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2780,ffff800017c17898,ffff800017c178e0) at sys_ioctl+0x5b9 syscall(ffff800017c17960) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x255666de970, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800017c171f0 rbx 0xffff800017c172a0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800017374000 rax 0xffff800000b82500 r8 0xffff800017c171b0 r9 0x1 r10 0xffff800000b82500 r11 0x33557ea0632fa704 r12 0x3000000008 r13 0xffff800017c17200 r14 0x100 r15 0x1 rip 0xffffffff814c7838 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800017c171e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=490239 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3650,0xffffffff82573530 process=0xffff8000ffff6370 user=0xffff800017c12000, vmspace=0xfffffd803f013440 estcpu=36, cpticks=97, pctcpu=20.28 user=0, sys=11361, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 51334 269684 83419 0 2 0 syz-executor.1 *51334 490239 83419 0 7 0x4000000 syz-executor.1 44218 273033 12682 0 2 0x2 syz-executor.0 83419 206788 12682 0 2 0x482 syz-executor.1 84342 338690 0 0 3 0x14200 bored sosplice 12682 126161 81499 0 3 0x82 thrsleep syz-fuzzer 12682 163802 81499 0 2 0x4000482 syz-fuzzer 12682 217621 81499 0 2 0x4000482 syz-fuzzer 12682 6371 81499 0 3 0x4000082 thrsleep syz-fuzzer 12682 394587 81499 0 3 0x4000082 kqread syz-fuzzer 12682 311558 81499 0 3 0x4000082 thrsleep syz-fuzzer 12682 355050 81499 0 3 0x4000082 thrsleep syz-fuzzer 12682 8028 81499 0 3 0x4000082 thrsleep syz-fuzzer 12682 370125 81499 0 3 0x4000082 thrsleep syz-fuzzer 81499 64348 41919 0 3 0x10008a pause ksh 41919 29273 1671 0 3 0x92 select sshd 48933 21026 1 0 3 0x100083 ttyin getty 1671 471288 1 0 3 0x80 select sshd 8015 58163 86277 73 2 0x100490 syslogd 86277 165677 1 0 3 0x100082 netio syslogd 43079 303655 0 0 2 0x14200 zerothread 808 119641 0 0 3 0x14200 aiodoned aiodoned 7025 59713 0 0 2 0x14200 update 19272 169821 0 0 3 0x14200 cleaner cleaner 19182 197628 0 0 3 0x14200 reaper reaper 77754 450946 0 0 3 0x14200 pgdaemon pagedaemon 65171 406104 0 0 3 0x14200 bored crynlk 62416 201887 0 0 3 0x14200 bored crypto 75260 427277 0 0 3 0x40014200 acpi0 acpi0 16895 256037 0 0 2 0x14200 softnet 27629 309098 0 0 2 0x14200 systqmp 14287 219391 0 0 3 0x14200 bored systq 20613 174191 0 0 2 0x40014200 softclock 92195 149477 0 0 3 0x40014200 idle0 60647 154298 0 0 3 0x14200 bored smr 1 195333 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9577 6350K 8597K 78643K 52102 0 0 pcb 13 11K 12K 78643K 2839 0 0 rtable 117 12K 14K 78643K 6848 0 0 ifaddr 500 52K 52K 78643K 2343 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 668 0 0 iov 0 0K 32K 78643K 4811 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1225 77K 78K 78643K 16593 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 199 0 0 VM map 127 31K 31K 78643K 162 0 0 sem 12 0K 1K 78643K 8217 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 5 13K 25K 78643K 14378 0 0 sigio 0 0K 0K 78643K 1002 0 0 proc 45 30K 63K 78643K 4382 0 0 subproc 32 2K 2K 78643K 1294 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 1109 0 0 in_multi 173 10K 10K 78643K 1774 0 0 ether_multi 1 0K 0K 78643K 126 0 0 mrt 2 0K 0K 78643K 87 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 150 662K 662K 78643K 150 0 0 exec 0 0K 1K 78643K 2500 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 321 832K 832K 78643K 36086 0 0 UVM aobj 130 4K 4K 78643K 140 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 2795 0 0 NDP 23 0K 1K 78643K 614 0 0 temp 178 3536K 4176K 78643K 276706 0 0 kqueue 0 0K 0K 78643K 344 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 219 0 212 1 0 1 1 0 8 0 rtpcb 80 1329 0 1329 4 4 0 1 0 8 0 rtentry 112 1360 0 1319 2 0 2 2 0 8 0 unpcb 120 14668 0 14653 9 8 1 2 0 8 0 syncache 264 74 0 74 35 35 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 102 0 102 22 22 0 1 0 8 0 tcpcb 544 6351 0 6347 116 115 1 15 0 8 0 ipq 40 214 0 214 66 65 1 1 0 8 1 ipqe 40 7123 0 7123 66 65 1 1 0 8 1 inpcb 280 28367 0 28361 161 159 2 9 0 8 1 rttmr 72 26 0 26 15 15 0 1 0 8 0 ip6q 72 5 0 5 3 3 0 1 0 8 0 ip6af 40 14 0 14 3 3 0 1 0 8 0 nd6 48 221 0 219 5 4 1 1 0 8 0 pkpcb 40 79 0 79 28 28 0 1 0 8 0 swfcl 56 6 0 0 1 0 1 1 0 8 0 ppxss 1128 201 0 201 62 62 0 1 0 8 0 art_heap8 4096 45 0 44 21 20 1 3 0 8 0 art_heap4 256 6479 0 6264 82 67 15 20 0 8 0 art_table 32 6524 0 6308 5 2 3 3 0 8 0 art_node 16 1359 0 1320 1 0 1 1 0 8 0 sysvmsgpl 40 43 0 39 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 8215 0 8205 1 0 1 1 0 8 0 shmpl 112 138 0 10 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 27525 0 26090 50 3 47 47 0 8 0 ffsino 240 27525 0 26090 85 0 85 85 0 8 0 nchpl 144 54978 0 54492 60 40 20 60 0 8 0 uvmvnodes 72 9506 0 0 173 0 173 173 0 8 0 vnodes 208 9506 0 0 501 0 501 501 0 8 0 namei 1024 185143 0 185143 9 8 1 1 0 8 1 vcpupl 1984 127 0 3 16 0 16 16 0 8 0 vmpool 520 160 0 35 13 4 9 9 0 8 0 scsiplug 64 9 0 9 5 5 0 1 0 8 0 scxspl 192 167936 0 167936 82 81 1 7 0 8 1 plimitpl 152 1059 0 1053 1 0 1 1 0 8 0 sigapl 432 14326 0 14315 2 0 2 2 0 8 0 futexpl 56 565131 0 565131 11 10 1 1 0 8 1 knotepl 112 7720 0 7701 28 27 1 4 0 8 0 kqueuepl 104 11356 0 11353 25 24 1 4 0 8 0 pipepl 128 20792 0 20773 64 63 1 2 0 8 0 fdescpl 424 14327 0 14315 2 0 2 2 0 8 0 filepl 120 168174 0 168088 136 132 4 11 0 8 1 lockfpl 104 4851 0 4851 3 2 1 1 0 8 1 lockfspl 48 1375 0 1375 3 2 1 1 0 8 1 sessionpl 112 91 0 83 1 0 1 1 0 8 0 pgrppl 48 275 0 267 1 0 1 1 0 8 0 ucredpl 96 13641 0 13634 1 0 1 1 0 8 0 zombiepl 144 14327 0 14327 1 0 1 1 0 8 1 processpl 864 14354 0 14327 4 0 4 4 0 8 0 procpl 632 31338 0 31302 13 9 4 5 0 8 0 sosppl 128 215 0 215 53 53 0 1 0 8 0 sockpl 384 44977 0 44952 221 217 4 15 0 8 0 mcl64k 65536 4164 0 4164 170 169 1 33 0 8 1 mcl16k 16384 145 0 145 67 67 0 1 0 8 0 mcl12k 12288 442 0 442 59 59 0 1 0 8 0 mcl9k 9216 207 0 207 75 74 1 1 0 8 1 mcl8k 8192 2376 0 2376 25 24 1 1 0 8 1 mcl4k 4096 1345 0 1345 27 26 1 1 0 8 1 mcl2k2 2112 90 0 90 48 48 0 1 0 8 0 mcl2k 2048 102577 0 102535 28 22 6 13 0 8 0 mtagpl 80 667 0 633 23 22 1 1 0 8 0 mbufpl 256 337100 0 336915 738 717 21 35 0 8 8 bufpl 256 59751 0 49838 620 0 620 620 0 8 0 anonpl 16 2608443 0 2573232 587 430 157 157 0 62 6 amapchunkpl 152 80684 0 79853 389 354 35 35 0 158 0 amappl16 192 137396 0 135908 600 516 84 90 0 8 8 amappl15 184 3100 0 3100 11 11 0 1 0 8 0 amappl14 176 2643 0 2637 1 0 1 1 0 8 0 amappl13 168 1952 0 1952 12 12 0 1 0 8 0 amappl12 160 1231 0 1230 16 15 1 1 0 8 0 amappl11 152 2226 0 2221 1 0 1 1 0 8 0 amappl10 144 1013 0 1011 1 0 1 1 0 8 0 amappl9 136 3448 0 3445 1 0 1 1 0 8 0 amappl8 128 2972 0 2893 4 1 3 3 0 8 0 amappl7 120 1333 0 1325 1 0 1 1 0 8 0 amappl6 112 2043 0 2026 1 0 1 1 0 8 0 amappl5 104 2042 0 2035 1 0 1 1 0 8 0 amappl4 96 14257 0 14227 1 0 1 1 0 8 0 amappl3 88 2736 0 2725 1 0 1 1 0 8 0 amappl2 80 111618 0 111539 4 2 2 3 0 8 0 amappl1 72 268305 0 267930 27 18 9 20 0 8 0 amappl 80 32958 0 32852 3 0 3 3 0 84 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 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 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 139 0 10 3 0 3 3 0 8 0 uaddrrnd 24 14487 0 14315 2 0 2 2 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 14487 0 14315 2 0 2 2 0 8 0 vmmpekpl 168 105024 0 104972 4 1 3 3 0 8 0 vmmpepl 168 1791386 0 1788436 1240 1092 148 187 0 357 7 vmsppl 272 14326 0 14315 13 12 1 2 0 8 0 pdppl 4096 28980 0 28824 28 8 20 20 0 8 0 pvpl 32 6621579 0 6597389 1418 1179 239 352 0 265 27 pmappl 200 14486 0 14350 10 2 8 8 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 2034 0 1257 26 3 23 23 0 8 0