panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *457656 17122 0 0 0x4000000 0K syz-executor.0 102423 1619 0 0x2 0x480 1 syz-fuzzer 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(fffffd806593b5f8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b5d200,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b5d200,0,7,fffffd807f00ba10,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b5d200,0,7,fffffd807f00ba10,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b437d0,ffff800020ace2a0) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create() at vm_create+0x1a0 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create() at vm_create+0x1a0 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8074d578f0,c5005601,ffff800000b00000,1,fffffd807f7c67e0,ffff800020ace2a0) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd807e3abab8,c5005601,ffff800000b00000,ffff800020ace2a0) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ace2a0,ffff800023b7ef48,ffff800023b7ef90) at sys_ioctl+0x5b9 syscall(ffff800023b7f010) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023b7f010) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,771ec6c0010) at Xsyscall+0x128 end of kernel end trace frame: 0x774735a1e80, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic amap_pp_adjref: negative reference count ddb{0}> 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(fffffd806593b5f8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b5d200,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b5d200,0,7,fffffd807f00ba10,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b5d200,0,7,fffffd807f00ba10,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b437d0,ffff800020ace2a0) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create() at vm_create+0x1a0 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create() at vm_create+0x1a0 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8074d578f0,c5005601,ffff800000b00000,1,fffffd807f7c67e0,ffff800020ace2a0) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd807e3abab8,c5005601,ffff800000b00000,ffff800020ace2a0) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ace2a0,ffff800023b7ef48,ffff800023b7ef90) at sys_ioctl+0x5b9 syscall(ffff800023b7f010) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023b7f010) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,771ec6c0010) at Xsyscall+0x128 end of kernel end trace frame: 0x774735a1e80, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023b7e8a0 rbx 0xffff800023b7e950 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800023bc2000 rax 0xffff800000af8b00 r8 0xffffffff819d4e5f kprintf+0x16f r9 0x1 r10 0x25 r11 0x73d34866415d8c0a r12 0x3000000008 r13 0xffff800023b7e8b0 r14 0x100 r15 0x1 rip 0xffffffff81b2bfb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023b7e890 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=457656 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020acf3e8,0xffffffff82642758 process=0xffff800020adce00 user=0xffff800023b7a000, vmspace=0xfffffd807f00ba10 estcpu=36, cpticks=48, pctcpu=20.28 user=0, sys=17257, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 17122 357126 54452 0 2 0 syz-executor.0 *17122 457656 54452 0 7 0x4000000 syz-executor.0 54452 476227 1619 0 2 0x482 syz-executor.0 33990 505022 1 0 3 0x100083 ttyin getty 59181 502427 1619 0 2 0x482 syz-executor.1 68734 108245 0 0 2 0x14600 acct 87173 474307 0 0 3 0x14200 bored sosplice 1619 102423 839 0 7 0x482 syz-fuzzer 1619 111975 839 0 2 0x4000482 syz-fuzzer 1619 168094 839 0 3 0x4000082 thrsleep syz-fuzzer 1619 244447 839 0 3 0x4000082 thrsleep syz-fuzzer 1619 349024 839 0 2 0x4000482 syz-fuzzer 1619 384692 839 0 3 0x4000082 kqread syz-fuzzer 1619 355774 839 0 3 0x4000082 thrsleep syz-fuzzer 1619 66804 839 0 2 0x4000482 syz-fuzzer 1619 84274 839 0 3 0x4000082 thrsleep syz-fuzzer 1619 128128 839 0 3 0x4000082 thrsleep syz-fuzzer 1619 263916 839 0 3 0x4000082 thrsleep syz-fuzzer 839 470610 24793 0 3 0x10008a pause ksh 24793 274340 14384 0 3 0x92 select sshd 14384 132909 1 0 3 0x80 select sshd 80999 408567 75275 74 2 0x100492 pflogd 75275 121150 1 0 3 0x80 netio pflogd 75479 416716 18634 73 2 0x100490 syslogd 18634 413726 1 0 3 0x100082 netio syslogd 8853 313468 1 77 3 0x100090 poll dhclient 80560 267837 1 0 3 0x80 poll dhclient 84524 194026 0 0 3 0x14200 pgzero zerothread 19840 103226 0 0 3 0x14200 aiodoned aiodoned 58095 92671 0 0 2 0x14200 update 30674 488064 0 0 3 0x14200 cleaner cleaner 71850 87375 0 0 3 0x14200 reaper reaper 20378 101271 0 0 3 0x14200 pgdaemon pagedaemon 83543 275620 0 0 3 0x14200 bored crynlk 27957 135125 0 0 3 0x14200 bored crypto 89600 179467 0 0 3 0x40014200 acpi0 acpi0 12651 487349 0 0 3 0x40014200 idle1 9312 277289 0 0 2 0x14200 softnet 8305 510317 0 0 2 0x14200 systqmp 82851 127524 0 0 2 0x14200 systq 56114 65978 0 0 2 0x40014200 softclock 84658 243026 0 0 3 0x40014200 idle0 40369 426613 0 0 2 0x14200 smr 1 453164 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 17122 (syz-executor.0) thread 0xffff800020ace2a0 (457656) shared rwlock vmmaplk r = 0 (0xfffffd807f00ba28) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 uvm_share+0xcf vm_map_lock_read_ln sys/uvm/uvm_map.c:5365 [inline] #1 uvm_share+0xcf sys/uvm/uvm_map.c:3627 #2 vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 #3 vm_create+0x1a0 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] #3 vm_create+0x1a0 sys/arch/amd64/amd64/vmm.c:1174 #4 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 #5 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 #6 sys_ioctl+0x5b9 #7 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #7 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #8 Xsyscall+0x128 exclusive rwlock vmmaplk r = 0 (0xffff800000b5d218) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x447 sys/kern/kern_rwlock.c:306 #2 vm_map_lock_ln+0x10d sys/uvm/uvm_map.c:5343 #3 uvm_share+0xa7 vm_map_lock_read_ln sys/uvm/uvm_map.c:5364 [inline] #3 uvm_share+0xa7 sys/uvm/uvm_map.c:3627 #4 vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 #5 vm_create+0x1a0 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] #5 vm_create+0x1a0 sys/arch/amd64/amd64/vmm.c:1174 #6 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 #7 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 #8 sys_ioctl+0x5b9 #9 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #9 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #10 Xsyscall+0x128 exclusive rwlock vmlistlock r = 0 (0xffff80000066e478) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 vm_create+0x130 vm_impl_init sys/arch/amd64/amd64/vmm.c:1383 [inline] #1 vm_create+0x130 sys/arch/amd64/amd64/vmm.c:1174 #2 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 #3 vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 #4 sys_ioctl+0x5b9 #5 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #5 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #6 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8264bbd8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 syscall+0x400 mi_syscall sys/sys/syscall_mi.h:83 [inline] #1 syscall+0x400 sys/arch/amd64/amd64/trap.c:555 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9609 7246K 8712K 78643K 25170 0 0 pcb 13 8K 9K 78643K 1490 0 0 rtable 123 13K 14K 78643K 4304 0 0 ifaddr 356 40K 44K 78643K 1388 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1814 0 0 iov 0 0K 32K 78643K 2337 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 78K 78643K 7044 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 64 0 0 VM map 46 23K 23K 78643K 72 0 0 sem 12 0K 0K 78643K 1586 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 6237 0 0 sigio 0 0K 0K 78643K 115 0 0 proc 62 63K 95K 78643K 3023 0 0 subproc 32 2K 2K 78643K 850 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 535 0 0 in_multi 29 1K 2K 78643K 945 0 0 ether_multi 1 0K 0K 78643K 81 0 0 mrt 1 0K 0K 78643K 39 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 90 397K 397K 78643K 90 0 0 exec 0 0K 1K 78643K 1550 0 0 pfkey data 0 0K 4K 78643K 5 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 232 364K 364K 78643K 23334 0 0 UVM aobj 130 4K 4K 78643K 135 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 1456 0 0 NDP 24 0K 1K 78643K 377 0 0 temp 184 3556K 4196K 78643K 207488 0 0 kqueue 0 0K 0K 78643K 66 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 167 0 161 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 601 0 599 1 0 1 1 0 8 0 rtentry 112 806 0 762 2 0 2 2 0 8 0 unpcb 120 4926 0 4910 7 6 1 2 0 8 0 syncache 264 47 0 47 15 14 1 1 0 8 1 tcpqe 32 14 0 14 8 8 0 1 0 8 0 tcpcb 544 6370 0 6364 30 28 2 4 0 8 1 inpcb 280 17700 0 17689 46 43 3 5 0 8 2 rttmr 72 14 0 13 3 2 1 1 0 8 0 nd6 48 116 0 113 5 4 1 1 0 8 0 pkpcb 40 43 0 43 11 11 0 1 0 8 0 ppxss 1128 134 0 134 18 17 1 1 0 8 1 pffrag 232 213 0 213 12 11 1 1 0 482 1 pffrnode 88 213 0 213 12 11 1 1 0 8 1 pffrent 40 7594 0 7594 12 11 1 1 0 8 1 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 582 0 502 1 0 1 1 0 8 0 pfstkey 112 584 0 504 3 0 3 3 0 8 0 pfstate 328 584 0 504 11 2 9 9 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 21 0 20 13 12 1 3 0 8 0 art_heap4 256 3339 0 3080 43 26 17 19 0 8 0 art_table 32 3360 0 3100 3 0 3 3 0 8 0 art_node 16 805 0 764 1 0 1 1 0 8 0 sysvmsgpl 40 93 0 69 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 1584 0 1574 1 0 1 1 0 8 0 shmpl 112 133 0 5 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 10671 0 9239 47 0 47 47 0 8 0 ffsino 272 10671 0 9239 96 0 96 96 0 8 0 nchpl 144 20278 0 19805 61 42 19 61 0 8 0 uvmvnodes 72 6139 0 0 112 0 112 112 0 8 0 vnodes 208 6139 0 0 324 0 324 324 0 8 0 namei 1024 71893 0 71893 5 4 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 43 0 0 6 0 6 6 0 8 0 vmpool 552 70 0 26 4 0 4 4 0 8 0 scsiplug 64 10 0 10 8 8 0 1 0 8 0 scxspl 192 66228 0 66228 44 42 2 6 0 8 2 plimitpl 152 536 0 528 1 0 1 1 0 8 0 sigapl 432 6298 0 6283 5 3 2 3 0 8 0 futexpl 56 182550 0 182550 3 2 1 1 0 8 1 knotepl 112 1577 0 1558 5 4 1 3 0 8 0 kqueuepl 104 2255 0 2252 2 1 1 2 0 8 0 pipepl 160 16076 0 16057 12 10 2 3 0 8 1 fdescpl 488 6299 0 6283 3 0 3 3 0 8 0 filepl 152 72893 0 72787 43 37 6 10 0 8 1 lockfpl 104 2325 0 2324 1 0 1 1 0 8 0 lockfspl 48 754 0 753 1 0 1 1 0 8 0 sessionpl 112 73 0 62 1 0 1 1 0 8 0 pgrppl 48 136 0 125 1 0 1 1 0 8 0 ucredpl 96 6398 0 6389 1 0 1 1 0 8 0 zombiepl 144 6284 0 6283 2 1 1 1 0 8 0 processpl 896 6317 0 6283 5 1 4 5 0 8 0 procpl 632 19969 0 19924 6 1 5 5 0 8 0 srpgc 64 72 0 72 20 20 0 1 0 8 0 sosppl 128 243 0 243 18 18 0 1 0 8 0 sockpl 384 23455 0 23426 69 62 7 11 0 8 4 mcl64k 65536 442 0 0 45 26 19 34 0 8 0 mcl16k 16384 33 0 0 4 1 3 3 0 8 0 mcl12k 12288 34 0 0 2 0 2 2 0 8 0 mcl9k 9216 16 0 0 2 0 2 2 0 8 0 mcl8k 8192 20 0 0 3 1 2 3 0 8 0 mcl4k 4096 42 0 0 5 2 3 3 0 8 0 mcl2k2 2112 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 221 0 0 22 5 17 22 0 8 0 mtagpl 80 134 0 0 2 0 2 2 0 8 0 mbufpl 256 1034 0 0 48 1 47 47 0 8 0 bufpl 256 24442 0 17384 442 0 442 442 0 8 0 anonpl 16 811839 0 792509 235 126 109 110 0 124 13 amapchunkpl 152 47433 0 47255 81 71 10 15 0 158 1 amappl16 192 34374 0 33057 246 169 77 77 0 8 7 amappl15 184 392 0 392 5 5 0 1 0 8 0 amappl14 176 1349 0 1338 1 0 1 1 0 8 0 amappl13 168 399 0 399 6 6 0 1 0 8 0 amappl12 160 1225 0 1222 2 1 1 1 0 8 0 amappl11 152 374 0 359 1 0 1 1 0 8 0 amappl10 144 1035 0 1028 1 0 1 1 0 8 0 amappl9 136 2185 0 2180 1 0 1 1 0 8 0 amappl8 128 1796 0 1718 3 0 3 3 0 8 0 amappl7 120 1175 0 1166 1 0 1 1 0 8 0 amappl6 112 291 0 272 1 0 1 1 0 8 0 amappl5 104 1968 0 1955 1 0 1 1 0 8 0 amappl4 96 6095 0 6063 1 0 1 1 0 8 0 amappl3 88 2292 0 2281 1 0 1 1 0 8 0 amappl2 80 46900 0 46821 3 1 2 3 0 8 0 amappl1 72 154386 0 153954 25 15 10 20 0 8 0 amappl 80 21143 0 21074 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 17 0 17 1 1 0 1 0 8 0 aobjpl 64 134 0 5 3 0 3 3 0 8 0 uaddrrnd 24 6369 0 6283 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 6369 0 6283 1 0 1 1 0 8 0 vmmpekpl 168 79060 0 79017 4 1 3 3 0 8 0 vmmpepl 168 829640 0 826990 350 182 168 168 0 357 44 vmsppl 368 6298 0 6283 2 0 2 2 0 8 0 pdppl 4096 12745 0 12661 13 2 11 11 0 8 0 pvpl 32 2100167 0 2078828 474 230 244 245 0 265 34 pmappl 232 6368 0 6309 5 1 4 4 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 778 0 111 20 0 20 20 0 8 0