panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *461776 42007 0 0 0x4000000 0K syz-executor.0 194660 53943 0 0x2 0 1 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(fffffd8065d46008,1f0,fef,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b07600,0,fef000,1f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3729 uvm_share(ffff800000b07600,0,7,fffffd807f00ba10,20200000,80000000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3763 [inline] uvm_share(ffff800000b07600,0,7,fffffd807f00ba10,20200000,80000000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3664 vm_impl_init_vmx(ffff800021b4ba28,ffff800020ab0ee8) 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(fffffd806e46da90,c5005601,ffff800000aba000,1,fffffd807f7c6a20,ffff800020ab0ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80669a5bf8,c5005601,ffff800000aba000,ffff800020ab0ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020ab0ee8,ffff800021f811f8,ffff800021f81240) at sys_ioctl+0x5b9 syscall(ffff800021f812c0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021f812c0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,5062748a0e0) at Xsyscall+0x128 end of kernel end trace frame: 0x508a29769e0, 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(fffffd8065d46008,1f0,fef,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b07600,0,fef000,1f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3729 uvm_share(ffff800000b07600,0,7,fffffd807f00ba10,20200000,80000000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3763 [inline] uvm_share(ffff800000b07600,0,7,fffffd807f00ba10,20200000,80000000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3664 vm_impl_init_vmx(ffff800021b4ba28,ffff800020ab0ee8) 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(fffffd806e46da90,c5005601,ffff800000aba000,1,fffffd807f7c6a20,ffff800020ab0ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80669a5bf8,c5005601,ffff800000aba000,ffff800020ab0ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020ab0ee8,ffff800021f811f8,ffff800021f81240) at sys_ioctl+0x5b9 syscall(ffff800021f812c0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021f812c0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,5062748a0e0) at Xsyscall+0x128 end of kernel end trace frame: 0x508a29769e0, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021f80b50 rbx 0xffff800021f80c00 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021d72000 rax 0xffff800000a81dc0 r8 0xffffffff81186cff kprintf+0x16f r9 0x1 r10 0x25 r11 0xfc895cfbcea22892 r12 0x3000000008 r13 0xffff800021f80b60 r14 0x100 r15 0x1 rip 0xffffffff819807c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021f80b40 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=461776 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab09f8,0xffffffff826330d0 process=0xffff800020adc380 user=0xffff800021f7c000, vmspace=0xfffffd807f00ba10 estcpu=36, cpticks=34, pctcpu=20.28 user=0, sys=18127, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 42007 296627 58905 0 2 0 syz-executor.0 42007 399537 58905 0 3 0x4000080 fsleep syz-executor.0 *42007 461776 58905 0 7 0x4000000 syz-executor.0 53943 194660 42359 0 7 0x2 syz-executor.1 44937 173804 1 0 3 0x100083 ttyin getty 58905 260464 42359 0 2 0x482 syz-executor.0 6632 153126 0 0 2 0x14600 acct 66130 334698 0 0 3 0x14200 bored sosplice 42359 415691 84604 0 3 0x82 thrsleep syz-fuzzer 42359 265408 84604 0 2 0x4000482 syz-fuzzer 42359 100805 84604 0 3 0x4000082 thrsleep syz-fuzzer 42359 154827 84604 0 3 0x4000082 thrsleep syz-fuzzer 42359 248892 84604 0 2 0x4000482 syz-fuzzer 42359 15707 84604 0 3 0x4000082 thrsleep syz-fuzzer 42359 180457 84604 0 3 0x4000082 thrsleep syz-fuzzer 42359 411888 84604 0 3 0x4000082 kqread syz-fuzzer 42359 290603 84604 0 2 0x4000482 syz-fuzzer 42359 409713 84604 0 2 0x4000482 syz-fuzzer 84604 120079 25193 0 3 0x10008a pause ksh 25193 63884 60125 0 3 0x92 select sshd 60125 410098 1 0 3 0x80 select sshd 59615 465386 8430 74 2 0x100492 pflogd 8430 251546 1 0 3 0x80 netio pflogd 22332 261645 21978 73 2 0x100490 syslogd 21978 161357 1 0 3 0x100082 netio syslogd 43132 446938 1 77 3 0x100090 poll dhclient 78708 79390 1 0 3 0x80 poll dhclient 80833 151195 0 0 2 0x14200 zerothread 76683 226845 0 0 3 0x14200 aiodoned aiodoned 41850 258366 0 0 2 0x14200 update 66437 346683 0 0 3 0x14200 cleaner cleaner 89368 128898 0 0 3 0x14200 reaper reaper 59475 363818 0 0 3 0x14200 pgdaemon pagedaemon 15568 446060 0 0 3 0x14200 bored crynlk 60769 520754 0 0 3 0x14200 bored crypto 98402 473511 0 0 3 0x40014200 acpi0 acpi0 15916 5450 0 0 3 0x40014200 idle1 23037 240837 0 0 2 0x14200 softnet 57964 131492 0 0 2 0x14200 systqmp 2224 148178 0 0 3 0x14200 bored systq 28664 177420 0 0 2 0x40014200 softclock 10333 412610 0 0 3 0x40014200 idle0 96274 86650 0 0 3 0x14200 bored smr 1 254910 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 42007 (syz-executor.0) thread 0xffff800020ab0ee8 (461776) 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:5361 [inline] #1 uvm_share+0xcf sys/uvm/uvm_map.c:3623 #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:524 #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 (0xffff800000b07618) #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:5339 #3 uvm_share+0xa7 vm_map_lock_read_ln sys/uvm/uvm_map.c:5360 [inline] #3 uvm_share+0xa7 sys/uvm/uvm_map.c:3623 #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:524 #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:524 #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 (0xffffffff82631ba8) #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 9574 6456K 7104K 78643K 15013 0 0 pcb 13 10K 12K 78643K 451 0 0 rtable 87 12K 15K 78643K 1289 0 0 ifaddr 79 17K 18K 78643K 459 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1686 0 0 iov 0 0K 24K 78643K 390 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1213 76K 77K 78643K 2997 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 30 0 0 VM map 3 1K 1K 78643K 115 0 0 sem 12 0K 0K 78643K 949 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 2114 0 0 sigio 0 0K 0K 78643K 27 0 0 proc 60 63K 95K 78643K 1088 0 0 subproc 32 2K 2K 78643K 204 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 132 0 0 in_multi 13 0K 2K 78643K 232 0 0 ether_multi 1 0K 0K 78643K 17 0 0 mrt 0 0K 0K 78643K 14 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 72 318K 318K 78643K 72 0 0 exec 0 0K 1K 78643K 519 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 108 38K 38K 78643K 9117 0 0 UVM aobj 100 3K 3K 78643K 102 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 474 0 0 NDP 18 0K 0K 78643K 136 0 0 temp 214 3560K 4200K 78643K 49673 0 0 kqueue 0 0K 0K 78643K 30 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 33 0 28 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 161 0 159 1 0 1 1 0 8 0 rtentry 112 184 0 155 2 0 2 2 0 8 0 unpcb 120 753 0 740 2 1 1 2 0 8 0 syncache 264 7 0 7 4 4 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 5297 0 5297 1 1 0 1 0 8 0 tcpcb 544 4398 0 4386 14 12 2 3 0 8 1 inpcb 280 6491 0 6474 25 23 2 13 0 8 0 rttmr 72 5 0 5 5 5 0 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 2 0 2 1 1 0 1 0 8 0 nd6 48 28 0 28 1 0 1 1 0 8 1 pkpcb 40 6 0 6 2 2 0 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 55 0 55 6 6 0 1 0 8 0 pffrag 232 40 0 40 11 11 0 1 0 482 0 pffrnode 88 40 0 40 11 11 0 1 0 8 0 pffrent 40 604 0 604 11 11 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 191 0 159 1 0 1 1 0 8 0 pfstkey 112 191 0 159 2 0 2 2 0 8 0 pfstate 328 191 0 159 5 1 4 5 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 830 0 692 23 11 12 15 0 8 0 art_table 32 831 0 692 2 0 2 2 0 8 0 art_node 16 183 0 156 1 0 1 1 0 8 0 sysvmsgpl 40 21 0 11 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 947 0 937 1 0 1 1 0 8 0 shmpl 112 100 0 2 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4633 0 3241 46 0 46 46 0 8 0 ffsino 272 4633 0 3241 95 0 95 95 0 8 0 nchpl 144 7821 0 7351 61 37 24 61 0 8 0 uvmvnodes 72 5906 0 0 108 0 108 108 0 8 0 vnodes 208 5906 0 0 311 0 311 311 0 8 0 namei 1024 25603 0 25603 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vmpool 552 113 0 112 10 9 1 1 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 24793 0 24793 18 17 1 7 0 8 1 plimitpl 152 192 0 184 1 0 1 1 0 8 0 sigapl 432 2287 0 2272 3 1 2 3 0 8 0 futexpl 56 45419 0 45418 1 0 1 1 0 8 0 knotepl 112 654 0 635 4 3 1 3 0 8 0 kqueuepl 104 559 0 557 2 1 1 2 0 8 0 pipepl 112 1256 0 1237 6 5 1 2 0 8 0 fdescpl 488 2288 0 2272 3 0 3 3 0 8 0 filepl 152 20263 0 20148 29 24 5 14 0 8 0 lockfpl 104 694 0 693 1 0 1 1 0 8 0 lockfspl 48 243 0 242 1 0 1 1 0 8 0 sessionpl 112 31 0 20 1 0 1 1 0 8 0 pgrppl 48 49 0 38 1 0 1 1 0 8 0 ucredpl 96 2160 0 2151 1 0 1 1 0 8 0 zombiepl 144 2272 0 2272 2 1 1 1 0 8 1 processpl 896 2305 0 2272 4 0 4 4 0 8 0 procpl 632 7750 0 7706 5 0 5 5 0 8 0 srpgc 64 18 0 18 9 9 0 1 0 8 0 sosppl 128 36 0 36 12 12 0 1 0 8 0 sockpl 384 7457 0 7427 42 38 4 22 0 8 1 mcl64k 65536 518 0 0 65 27 38 65 0 8 1 mcl16k 16384 7 0 0 1 0 1 1 0 8 0 mcl12k 12288 14 0 0 2 0 2 2 0 8 0 mcl9k 9216 15 0 0 2 0 2 2 0 8 0 mcl8k 8192 11 0 0 2 0 2 2 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 182 0 0 21 3 18 21 0 8 0 mtagpl 80 34 0 0 1 0 1 1 0 8 0 mbufpl 256 689 0 0 38 0 38 38 0 8 0 bufpl 256 13968 0 6920 441 0 441 441 0 8 0 anonpl 16 257375 0 240602 127 54 73 86 0 124 0 amapchunkpl 152 16982 0 16863 38 31 7 13 0 158 0 amappl16 192 11939 0 10979 114 64 50 60 0 8 0 amappl15 184 9 0 9 2 2 0 1 0 8 0 amappl14 176 351 0 349 2 1 1 1 0 8 0 amappl13 168 129 0 129 2 2 0 1 0 8 0 amappl12 160 7 0 5 1 0 1 1 0 8 0 amappl11 152 858 0 841 1 0 1 1 0 8 0 amappl10 144 210 0 203 1 0 1 1 0 8 0 amappl9 136 1297 0 1291 1 0 1 1 0 8 0 amappl8 128 813 0 789 1 0 1 1 0 8 0 amappl7 120 277 0 268 1 0 1 1 0 8 0 amappl6 112 869 0 853 1 0 1 1 0 8 0 amappl5 104 217 0 204 1 0 1 1 0 8 0 amappl4 96 2595 0 2563 1 0 1 1 0 8 0 amappl3 88 459 0 454 1 0 1 1 0 8 0 amappl2 80 16689 0 16616 3 1 2 3 0 8 0 amappl1 72 61158 0 60722 27 16 11 20 0 8 0 amappl 80 8233 0 8191 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 101 0 2 2 0 2 2 0 8 0 uaddrrnd 24 2401 0 2272 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2401 0 2272 1 0 1 1 0 8 0 vmmpekpl 168 22295 0 22258 2 0 2 2 0 8 0 vmmpepl 168 295290 0 293197 314 193 121 133 0 357 22 vmsppl 368 2287 0 2272 2 0 2 2 0 8 0 pdppl 4096 4809 0 4768 7 1 6 6 0 8 0 pvpl 32 707445 0 687432 299 132 167 207 0 265 0 pmappl 232 2400 0 2384 11 9 2 2 0 8 1 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 722 0 58 20 0 20 20 0 8 0