panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 27290 42 0 0 0x4000000 0K syz-executor.1 207407 85083 0 0x2 0x480 1 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(fffffd8065717aa8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000afae00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000afae00,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000afae00,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800021b717c0,ffff800021b738d8) 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(fffffd807a897b60,c5005601,ffff800000ac2000,1,fffffd807f7c6a20,ffff800021b738d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca47b58,c5005601,ffff800000ac2000,ffff800021b738d8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800021b738d8,ffff800022bcd898,ffff800022bcd8e0) at sys_ioctl+0x5b9 syscall(ffff800022bcd960) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022bcd960) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x90d1caf7dd0, 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(fffffd8065717aa8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000afae00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000afae00,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000afae00,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800021b717c0,ffff800021b738d8) 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(fffffd807a897b60,c5005601,ffff800000ac2000,1,fffffd807f7c6a20,ffff800021b738d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca47b58,c5005601,ffff800000ac2000,ffff800021b738d8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800021b738d8,ffff800022bcd898,ffff800022bcd8e0) at sys_ioctl+0x5b9 syscall(ffff800022bcd960) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022bcd960) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x90d1caf7dd0, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800022bcd1f0 rbx 0xffff800022bcd2a0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80002155e000 rax 0xffff800000b3f640 r8 0xffffffff81298dcf kprintf+0x16f r9 0x1 r10 0x25 r11 0xc51fe5a2b9773c2 r12 0x3000000008 r13 0xffff800022bcd200 r14 0x100 r15 0x1 rip 0xffffffff81e8ddc8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022bcd1e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=27290 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021b72c80,0xffffffff82648da8 process=0xffff800020adc380 user=0xffff800022bc8000, vmspace=0xfffffd807f007730 estcpu=36, cpticks=84, pctcpu=20.28 user=0, sys=17632, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 42 353273 62168 0 2 0 syz-executor.1 * 42 27290 62168 0 7 0x4000000 syz-executor.1 6155 389115 85083 0 2 0 syz-executor.0 6155 263447 85083 0 2 0x4000000 syz-executor.0 89817 199113 0 0 2 0x14600 acct 62168 98528 44863 0 2 0x482 syz-executor.1 85083 207407 44863 0 7 0x482 syz-executor.0 88185 24504 1 0 3 0x100083 ttyin getty 68534 161239 0 0 3 0x14200 bored sosplice 44863 363261 12639 0 3 0x82 thrsleep syz-fuzzer 44863 496727 12639 0 2 0x4000482 syz-fuzzer 44863 107794 12639 0 3 0x4000082 thrsleep syz-fuzzer 44863 280371 12639 0 2 0x4000482 syz-fuzzer 44863 400379 12639 0 3 0x4000082 thrsleep syz-fuzzer 44863 252321 12639 0 3 0x4000082 thrsleep syz-fuzzer 44863 290523 12639 0 3 0x4000082 thrsleep syz-fuzzer 44863 280906 12639 0 3 0x4000082 kqread syz-fuzzer 44863 301440 12639 0 2 0x4000482 syz-fuzzer 44863 511925 12639 0 3 0x4000082 thrsleep syz-fuzzer 12639 175657 43155 0 3 0x10008a pause ksh 43155 36815 94381 0 3 0x92 select sshd 94381 14262 1 0 3 0x80 select sshd 80075 408919 83584 74 2 0x100492 pflogd 83584 497164 1 0 3 0x80 netio pflogd 29951 428334 28072 73 2 0x100490 syslogd 28072 328006 1 0 3 0x100082 netio syslogd 16766 54487 1 77 3 0x100090 poll dhclient 26009 53744 1 0 3 0x80 poll dhclient 96212 505728 0 0 2 0x14200 zerothread 76623 36110 0 0 3 0x14200 aiodoned aiodoned 73827 72909 0 0 2 0x14200 update 9199 412522 0 0 3 0x14200 cleaner cleaner 18695 39014 0 0 3 0x14200 reaper reaper 84618 77931 0 0 3 0x14200 pgdaemon pagedaemon 45590 172780 0 0 3 0x14200 bored crynlk 15192 54180 0 0 3 0x14200 bored crypto 67045 236983 0 0 3 0x40014200 acpi0 acpi0 14545 343348 0 0 3 0x40014200 idle1 44334 225086 0 0 2 0x14200 softnet 14156 223898 0 0 2 0x14200 systqmp 14440 241617 0 0 3 0x14200 bored systq 78921 112672 0 0 2 0x40014200 softclock 38402 219566 0 0 3 0x40014200 idle0 21213 179028 0 0 2 0x14200 smr 1 176938 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 42 (syz-executor.1) thread 0xffff800021b738d8 (27290) shared rwlock vmmaplk r = 0 (0xfffffd807f007748) #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 (0xffff800000afae18) #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 (0xffff800000671478) #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 (0xffffffff82635090) #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 9599 6640K 8126K 78643K 20669 0 0 pcb 13 9K 9K 78643K 451 0 0 rtable 115 13K 13K 78643K 1518 0 0 ifaddr 215 27K 28K 78643K 641 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1576 0 0 iov 0 0K 24K 78643K 361 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1228 77K 77K 78643K 4086 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 28 0 0 VM map 29 14K 14K 78643K 33 0 0 sem 12 0K 1K 78643K 592 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 1711 0 0 sigio 0 0K 0K 78643K 32 0 0 proc 60 63K 95K 78643K 981 0 0 subproc 32 2K 2K 78643K 187 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 201 0 0 in_multi 120 6K 6K 78643K 348 0 0 ether_multi 1 0K 0K 78643K 24 0 0 mrt 0 0K 0K 78643K 16 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 84 371K 371K 78643K 84 0 0 exec 0 0K 1K 78643K 504 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 161 239K 239K 78643K 7084 0 0 UVM aobj 130 6K 6K 78643K 133 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 403 0 0 NDP 21 0K 0K 78643K 150 0 0 temp 172 3556K 4196K 78643K 65684 0 0 kqueue 0 0K 0K 78643K 31 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 55 0 45 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 197 0 195 1 0 1 1 0 8 0 rtentry 112 238 0 195 2 0 2 2 0 8 0 unpcb 120 1571 0 1557 3 1 2 2 0 8 1 syncache 264 8 0 8 3 3 0 1 0 8 0 sackhl 24 2 0 2 1 1 0 1 0 8 0 tcpqe 32 120 0 120 3 3 0 1 0 8 0 tcpcb 544 701 0 697 4 2 2 2 0 8 1 inpcb 280 2641 0 2633 10 7 3 3 0 8 2 rttmr 72 5 0 5 3 3 0 1 0 8 0 nd6 48 31 0 29 1 0 1 1 0 8 0 pkpcb 40 14 0 14 4 3 1 1 0 8 1 swfcl 56 1 0 0 1 0 1 1 0 8 0 ppxss 1128 58 0 58 6 5 1 1 0 8 1 pffrag 232 53 0 53 9 8 1 1 0 482 1 pffrnode 88 53 0 53 9 8 1 1 0 8 1 pffrent 40 1442 0 1442 9 8 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 166 0 100 1 0 1 1 0 8 0 pfstkey 112 166 0 100 2 0 2 2 0 8 0 pfstate 328 166 0 100 6 0 6 6 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 1032 0 818 20 4 16 16 0 8 0 art_table 32 1034 0 818 3 0 3 3 0 8 0 art_node 16 237 0 196 1 0 1 1 0 8 0 sysvmsgpl 40 70 0 30 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 589 0 579 1 0 1 1 0 8 0 shmpl 112 131 0 3 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3979 0 2573 46 0 46 46 0 8 0 ffsino 272 3979 0 2573 95 0 95 95 0 8 0 nchpl 144 7156 0 5552 61 0 61 61 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 208 5926 0 0 312 0 312 312 0 8 0 namei 1024 24200 0 24200 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 26 0 0 4 0 4 4 0 8 0 vmpool 552 31 0 4 2 0 2 2 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 21680 0 21680 18 14 4 7 0 8 4 plimitpl 152 142 0 134 1 0 1 1 0 8 0 sigapl 432 1883 0 1867 3 1 2 3 0 8 0 futexpl 56 48026 0 48026 1 0 1 1 0 8 1 knotepl 112 659 0 640 3 2 1 3 0 8 0 kqueuepl 104 1590 0 1587 1 0 1 1 0 8 0 pipepl 160 1622 0 1603 6 4 2 2 0 8 1 fdescpl 488 1884 0 1867 3 0 3 3 0 8 0 filepl 152 19019 0 18916 12 5 7 7 0 8 3 lockfpl 104 750 0 749 1 0 1 1 0 8 0 lockfspl 48 199 0 198 1 0 1 1 0 8 0 sessionpl 112 28 0 17 1 0 1 1 0 8 0 pgrppl 48 55 0 44 1 0 1 1 0 8 0 ucredpl 96 1641 0 1632 1 0 1 1 0 8 0 zombiepl 144 1868 0 1868 2 1 1 1 0 8 1 processpl 896 1902 0 1868 4 0 4 4 0 8 0 procpl 632 5797 0 5752 6 1 5 5 0 8 0 srpgc 64 13 0 13 6 6 0 1 0 8 0 sosppl 128 43 0 43 7 6 1 1 0 8 1 sockpl 384 4490 0 4466 15 8 7 7 0 8 4 mcl64k 65536 516 0 0 65 4 61 65 0 8 1 mcl16k 16384 8 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 7 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 176 0 0 20 0 20 20 0 8 0 mtagpl 80 70 0 0 2 0 2 2 0 8 0 mbufpl 256 637 0 0 37 0 37 37 0 8 0 bufpl 256 11379 0 4321 442 0 442 442 0 8 0 anonpl 16 261400 0 227579 169 25 144 153 0 124 7 amapchunkpl 152 14143 0 13203 56 19 37 42 0 158 0 amappl16 192 10447 0 9232 114 51 63 73 0 8 1 amappl15 184 839 0 834 1 0 1 1 0 8 0 amappl14 176 359 0 353 1 0 1 1 0 8 0 amappl13 168 223 0 223 1 1 0 1 0 8 0 amappl12 160 54 0 51 2 1 1 1 0 8 0 amappl11 152 276 0 261 1 0 1 1 0 8 0 amappl10 144 20 0 15 1 0 1 1 0 8 0 amappl9 136 713 0 710 1 0 1 1 0 8 0 amappl8 128 310 0 267 2 0 2 2 0 8 0 amappl7 120 80 0 73 1 0 1 1 0 8 0 amappl6 112 256 0 245 1 0 1 1 0 8 0 amappl5 104 284 0 268 1 0 1 1 0 8 0 amappl4 96 2208 0 2171 1 0 1 1 0 8 0 amappl3 88 195 0 190 1 0 1 1 0 8 0 amappl2 80 14321 0 14240 3 1 2 3 0 8 0 amappl1 72 52369 0 51923 26 16 10 20 0 8 0 amappl 80 6247 0 6178 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 132 0 3 3 0 3 3 0 8 0 uaddrrnd 24 1915 0 1867 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1915 0 1867 1 0 1 1 0 8 0 vmmpekpl 168 20026 0 19987 2 0 2 2 0 8 0 vmmpepl 168 246260 0 243741 213 66 147 153 0 357 36 vmsppl 368 1883 0 1867 2 0 2 2 0 8 0 pdppl 4096 3837 0 3768 10 1 9 9 0 8 0 pvpl 32 673928 0 649054 274 49 225 244 0 265 20 pmappl 232 1914 0 1871 4 1 3 3 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 714 0 16 20 0 20 20 0 8 0