panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *456609 80080 0 0 0x4000000 0 syz-executor.0 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(fffffd8029c6c5a8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000acac00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000acac00,0,7,fffffd803f012aa0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000acac00,0,7,fffffd803f012aa0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015942210,ffff8000ffff3160) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000af7000,ffff8000ffff3160) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000af7000,ffff8000ffff3160) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361aba90,c5005601,ffff800000af7000,1,fffffd803f7c6b40,ffff8000ffff3160) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8029526c48,c5005601,ffff800000af7000,ffff8000ffff3160) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff3160,ffff8000173987f8,ffff800017398840) at sys_ioctl+0x5b9 syscall(ffff8000173988c0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x94ab4b2ed60, 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(fffffd8029c6c5a8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000acac00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000acac00,0,7,fffffd803f012aa0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000acac00,0,7,fffffd803f012aa0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015942210,ffff8000ffff3160) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000af7000,ffff8000ffff3160) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000af7000,ffff8000ffff3160) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361aba90,c5005601,ffff800000af7000,1,fffffd803f7c6b40,ffff8000ffff3160) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8029526c48,c5005601,ffff800000af7000,ffff8000ffff3160) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff3160,ffff8000173987f8,ffff800017398840) at sys_ioctl+0x5b9 syscall(ffff8000173988c0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x94ab4b2ed60, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800017398150 rbx 0xffff800017398200 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800016993000 rax 0xffff800000af9080 r8 0xffff800017398110 r9 0x1 r10 0xffff800000af9080 r11 0xf46785fe092100a7 r12 0x3000000008 r13 0xffff800017398160 r14 0x100 r15 0x1 rip 0xffffffff81a4ef68 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800017398140 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=456609 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff38c8,0xffffffff825ab8a8 process=0xffff8000148a26d8 user=0xffff800017393000, vmspace=0xfffffd803f012aa0 estcpu=36, cpticks=76, pctcpu=20.28 user=0, sys=11391, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 80080 106051 55638 0 2 0 syz-executor.0 *80080 456609 55638 0 7 0x4000000 syz-executor.0 56554 444978 89858 0 2 0x2 syz-executor.1 55638 26848 89858 0 2 0x482 syz-executor.0 13269 157224 0 0 2 0x14600 acct 21226 370889 1 0 3 0x100083 ttyin getty 97246 377102 0 0 3 0x14200 bored sosplice 89858 303692 87190 0 3 0x82 kqread syz-fuzzer 89858 373830 87190 0 2 0x4000482 syz-fuzzer 89858 260455 87190 0 3 0x4000082 thrsleep syz-fuzzer 89858 409708 87190 0 3 0x4000082 thrsleep syz-fuzzer 89858 374867 87190 0 3 0x4000082 thrsleep syz-fuzzer 89858 367194 87190 0 3 0x4000082 thrsleep syz-fuzzer 89858 294042 87190 0 3 0x4000082 thrsleep syz-fuzzer 89858 465812 87190 0 2 0x4000482 syz-fuzzer 87190 129928 44267 0 3 0x10008a pause ksh 44267 395128 45629 0 3 0x92 select sshd 45629 143805 1 0 3 0x80 select sshd 71522 114456 56878 73 2 0x100490 syslogd 56878 384727 1 0 3 0x100082 netio syslogd 59837 350323 1 77 3 0x100090 poll dhclient 21617 436923 1 0 3 0x80 poll dhclient 27137 333410 0 0 2 0x14200 zerothread 2434 210569 0 0 3 0x14200 aiodoned aiodoned 3175 518185 0 0 2 0x14200 update 22692 178151 0 0 3 0x14200 cleaner cleaner 72955 344605 0 0 3 0x14200 reaper reaper 13653 318360 0 0 3 0x14200 pgdaemon pagedaemon 44584 143379 0 0 3 0x14200 bored crynlk 82916 326749 0 0 3 0x14200 bored crypto 53383 250389 0 0 3 0x40014200 acpi0 acpi0 46878 33450 0 0 2 0x14200 softnet 85265 371514 0 0 2 0x14200 systqmp 45318 50681 0 0 3 0x14200 bored systq 97466 242735 0 0 2 0x40014200 softclock 62942 304549 0 0 3 0x40014200 idle0 474 190434 0 0 3 0x14200 bored smr 1 194595 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 9563 6383K 7977K 78643K 16834 0 0 pcb 13 10K 12K 78643K 982 0 0 rtable 121 12K 12K 78643K 2236 0 0 ifaddr 213 26K 27K 78643K 689 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 216 0 0 iov 0 0K 28K 78643K 755 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 77K 78643K 3869 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 73 0 0 VM map 24 6K 6K 78643K 35 0 0 sem 12 0K 0K 78643K 972 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 5 13K 25K 78643K 3105 0 0 sigio 0 0K 0K 78643K 277 0 0 proc 48 38K 54K 78643K 1444 0 0 subproc 32 2K 2K 78643K 391 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 315 0 0 in_multi 63 3K 4K 78643K 453 0 0 ether_multi 1 0K 0K 78643K 22 0 0 mrt 1 0K 0K 78643K 17 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 96 424K 424K 78643K 96 0 0 exec 0 0K 1K 78643K 797 0 0 pfkey data 0 0K 0K 78643K 2 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 163 183K 183K 78643K 8746 0 0 UVM aobj 130 6K 6K 78643K 134 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 773 0 0 NDP 20 0K 1K 78643K 181 0 0 temp 166 3535K 4175K 78643K 85809 0 0 kqueue 0 0K 0K 78643K 37 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 98 0 92 1 0 1 1 0 8 0 rtpcb 80 2516 0 2514 1 0 1 1 0 8 0 rtentry 112 462 0 418 2 0 2 2 0 8 0 unpcb 120 3373 0 3362 11 8 3 3 0 8 2 syncache 264 22 0 22 10 10 0 1 0 8 0 tcpqe 32 78 0 78 4 4 0 1 0 8 0 tcpcb 544 1676 0 1672 17 16 1 14 0 8 0 ipq 40 58 0 58 12 12 0 1 0 8 0 ipqe 40 2182 0 2182 12 12 0 1 0 8 0 inpcb 280 5947 0 5940 26 23 3 9 0 8 2 rttmr 72 5 0 5 5 4 1 1 0 8 1 ip6q 72 3 0 3 2 2 0 1 0 8 0 ip6af 40 8 0 8 2 2 0 1 0 8 0 nd6 48 59 0 55 1 0 1 1 0 8 0 pkpcb 40 25 0 25 9 9 0 1 0 8 0 ppxss 1128 48 0 48 11 11 0 1 0 8 0 art_heap8 4096 12 0 11 9 8 1 3 0 8 0 art_heap4 256 1961 0 1739 25 10 15 17 0 8 0 art_table 32 1973 0 1750 3 1 2 3 0 8 0 art_node 16 461 0 421 1 0 1 1 0 8 0 sysvmsgpl 40 81 0 54 1 0 1 1 0 8 0 semapl 112 970 0 960 1 0 1 1 0 8 0 shmpl 112 132 0 4 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 6601 0 5206 46 0 46 46 0 8 0 ffsino 240 6601 0 5206 83 0 83 83 0 8 0 nchpl 144 11536 0 11084 60 40 20 60 0 8 0 uvmvnodes 72 6398 0 0 117 0 117 117 0 8 0 vnodes 208 6398 0 0 337 0 337 337 0 8 0 namei 1024 39728 0 39728 5 4 1 1 0 8 1 vcpupl 1984 22 0 1 3 0 3 3 0 8 0 vmpool 520 33 0 11 2 0 2 2 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 38209 0 38209 20 18 2 7 0 8 2 plimitpl 152 293 0 286 1 0 1 1 0 8 0 sigapl 432 3213 0 3200 2 0 2 2 0 8 0 futexpl 56 123883 0 123883 4 3 1 1 0 8 1 knotepl 112 658 0 639 2 1 1 2 0 8 0 kqueuepl 104 1010 0 1007 4 3 1 4 0 8 0 pipepl 128 2404 0 2385 10 8 2 2 0 8 1 fdescpl 424 3214 0 3200 2 0 2 2 0 8 0 filepl 120 31967 0 31869 28 21 7 10 0 8 4 lockfpl 104 1190 0 1189 1 0 1 1 0 8 0 lockfspl 48 402 0 401 1 0 1 1 0 8 0 sessionpl 112 39 0 29 1 0 1 1 0 8 0 pgrppl 48 114 0 104 1 0 1 1 0 8 0 ucredpl 96 3694 0 3686 1 0 1 1 0 8 0 zombiepl 144 3200 0 3200 2 1 1 1 0 8 1 processpl 864 3230 0 3200 4 0 4 4 0 8 0 procpl 632 6918 0 6880 5 1 4 5 0 8 0 sosppl 128 44 0 44 8 7 1 1 0 8 1 sockpl 384 11985 0 11964 57 46 11 14 0 8 8 mcl64k 65536 713 0 713 44 43 1 33 0 8 1 mcl16k 16384 60 0 60 10 9 1 1 0 8 1 mcl12k 12288 137 0 137 8 7 1 1 0 8 1 mcl9k 9216 60 0 60 11 10 1 1 0 8 1 mcl8k 8192 213 0 213 4 3 1 1 0 8 1 mcl4k 4096 529 0 529 5 4 1 1 0 8 1 mcl2k2 2112 34 0 34 13 12 1 1 0 8 1 mcl2k 2048 76465 0 76428 25 19 6 11 0 8 1 mtagpl 80 162 0 157 5 4 1 1 0 8 0 mbufpl 256 167481 0 167371 150 134 16 27 0 8 6 bufpl 256 21761 0 15340 402 0 402 402 0 8 0 anonpl 16 461568 0 438821 198 89 109 109 0 62 12 amapchunkpl 152 18608 0 18439 71 50 21 21 0 158 12 amappl16 192 21534 0 20237 182 104 78 78 0 8 11 amappl15 184 65 0 64 1 0 1 1 0 8 0 amappl14 176 466 0 460 1 0 1 1 0 8 0 amappl13 168 372 0 371 2 1 1 1 0 8 0 amappl12 160 298 0 297 2 1 1 1 0 8 0 amappl11 152 432 0 419 1 0 1 1 0 8 0 amappl10 144 1059 0 1058 1 0 1 1 0 8 0 amappl9 136 998 0 993 1 0 1 1 0 8 0 amappl8 128 544 0 483 3 1 2 2 0 8 0 amappl7 120 1165 0 1158 1 0 1 1 0 8 0 amappl6 112 383 0 366 1 0 1 1 0 8 0 amappl5 104 708 0 698 1 0 1 1 0 8 0 amappl4 96 3688 0 3651 2 1 1 2 0 8 0 amappl3 88 410 0 402 1 0 1 1 0 8 0 amappl2 80 23784 0 23710 3 1 2 3 0 8 0 amappl1 72 70277 0 69868 25 16 9 20 0 8 0 amappl 80 7530 0 7474 2 0 2 2 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 18 0 17 1 0 1 1 0 8 0 aobjpl 64 133 0 4 3 0 3 3 0 8 0 uaddrrnd 24 3247 0 3200 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3247 0 3200 1 0 1 1 0 8 0 vmmpekpl 168 24748 0 24710 2 0 2 2 0 8 0 vmmpepl 168 408278 0 405833 289 143 146 153 0 357 29 vmsppl 272 3213 0 3200 3 2 1 2 0 8 0 pdppl 4096 6500 0 6443 10 2 8 8 0 8 0 pvpl 32 1093238 0 1069357 399 158 241 241 0 265 39 pmappl 200 3246 0 3211 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 797 0 256 16 0 16 16 0 8 0