panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *429687 73034 0 0 0x4000000 0K syz-executor.1 205765 89525 0 0x2 0x4000480 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(fffffd80751d3c88,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ace000,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ace000,0,7,fffffd807f007000,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ace000,0,7,fffffd807f007000,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800023badc10,ffff800020ace518) 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(fffffd806e1999c0,c5005601,ffff800000ae0000,1,fffffd807f7c6780,ffff800020ace518) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806fc0c5f0,c5005601,ffff800000ae0000,ffff800020ace518) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ace518,ffff800021b5cee8,ffff800021b5cf30) at sys_ioctl+0x5b9 syscall(ffff800021b5cfb0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b5cfb0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe50171d7a80, 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(fffffd80751d3c88,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ace000,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ace000,0,7,fffffd807f007000,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ace000,0,7,fffffd807f007000,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800023badc10,ffff800020ace518) 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(fffffd806e1999c0,c5005601,ffff800000ae0000,1,fffffd807f7c6780,ffff800020ace518) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806fc0c5f0,c5005601,ffff800000ae0000,ffff800020ace518) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ace518,ffff800021b5cee8,ffff800021b5cf30) at sys_ioctl+0x5b9 syscall(ffff800021b5cfb0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b5cfb0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe50171d7a80, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021b5c840 rbx 0xffff800021b5c8f0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021b66000 rax 0xffff800000a4a500 r8 0xffffffff81298dcf kprintf+0x16f r9 0x1 r10 0x25 r11 0x5b51b381c0f1f063 r12 0x3000000008 r13 0xffff800021b5c850 r14 0x100 r15 0x1 rip 0xffffffff81e8ddc8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021b5c830 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=429687 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ace790,0xffffffff82648da8 process=0xffff800020add880 user=0xffff800021b58000, vmspace=0xfffffd807f007000 estcpu=36, cpticks=62, pctcpu=20.28 user=0, sys=17875, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 73034 364944 48916 0 2 0 syz-executor.1 *73034 429687 48916 0 7 0x4000000 syz-executor.1 65831 181427 89525 0 2 0x482 syz-executor.0 15896 17263 0 0 3 0x14200 bored sosplice 48916 483151 89525 0 2 0x482 syz-executor.1 89525 112547 98533 0 3 0x82 thrsleep syz-fuzzer 89525 205765 98533 0 7 0x4000482 syz-fuzzer 89525 275798 98533 0 3 0x4000082 thrsleep syz-fuzzer 89525 246237 98533 0 3 0x4000082 thrsleep syz-fuzzer 89525 306172 98533 0 2 0x4000482 syz-fuzzer 89525 247731 98533 0 3 0x4000082 thrsleep syz-fuzzer 89525 326384 98533 0 3 0x4000082 kqread syz-fuzzer 89525 234786 98533 0 3 0x4000082 thrsleep syz-fuzzer 89525 157090 98533 0 2 0x4000482 syz-fuzzer 89525 112077 98533 0 3 0x4000082 thrsleep syz-fuzzer 98533 28412 13433 0 3 0x10008a pause ksh 13433 16345 27113 0 3 0x92 select sshd 91243 335204 1 0 3 0x100083 ttyin getty 27113 224498 1 0 3 0x80 select sshd 22990 413784 9431 74 2 0x100492 pflogd 9431 211371 1 0 3 0x80 netio pflogd 35036 118900 8741 73 2 0x100490 syslogd 8741 268931 1 0 3 0x100082 netio syslogd 35032 413023 1 77 3 0x100090 poll dhclient 76027 276264 1 0 3 0x80 poll dhclient 6934 291566 0 0 3 0x14200 pgzero zerothread 48804 251075 0 0 3 0x14200 aiodoned aiodoned 15413 96440 0 0 2 0x14200 update 93832 362013 0 0 3 0x14200 cleaner cleaner 74357 494304 0 0 3 0x14200 reaper reaper 57394 485598 0 0 3 0x14200 pgdaemon pagedaemon 8771 311587 0 0 3 0x14200 bored crynlk 8693 186575 0 0 3 0x14200 bored crypto 40525 308139 0 0 3 0x40014200 acpi0 acpi0 8187 37260 0 0 3 0x40014200 idle1 74942 473294 0 0 2 0x14200 softnet 49777 297177 0 0 2 0x14200 systqmp 4436 368494 0 0 3 0x14200 bored systq 60248 242536 0 0 2 0x40014200 softclock 70811 408253 0 0 3 0x40014200 idle0 51799 93687 0 0 3 0x14200 bored smr 1 112848 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 73034 (syz-executor.1) thread 0xffff800020ace518 (429687) shared rwlock vmmaplk r = 0 (0xfffffd807f007018) #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 (0xffff800000ace018) #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 9532 6431K 7248K 78643K 11423 0 0 pcb 13 8K 8K 78643K 118 0 0 rtable 87 3K 4K 78643K 385 0 0 ifaddr 84 14K 15K 78643K 137 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1489 0 0 iov 0 0K 16K 78643K 73 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1228 77K 77K 78643K 1523 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 7 0 0 VM map 17 8K 8K 78643K 17 0 0 sem 12 1K 1K 78643K 91 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 5 13K 25K 78643K 348 0 0 sigio 1 0K 0K 78643K 4 0 0 proc 60 63K 95K 78643K 515 0 0 subproc 32 2K 2K 78643K 55 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 24 0 0 in_multi 43 2K 3K 78643K 85 0 0 ether_multi 1 0K 0K 78643K 6 0 0 mrt 0 0K 0K 78643K 3 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 243 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 134 87K 87K 78643K 2183 0 0 UVM aobj 46 4K 4K 78643K 49 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 68 0 0 NDP 13 0K 0K 78643K 31 0 0 temp 139 3551K 3617K 78643K 11011 0 0 kqueue 0 0K 0K 78643K 6 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 11 0 7 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 49 0 47 1 0 1 1 0 8 0 rtentry 112 73 0 41 2 0 2 2 0 8 0 unpcb 120 135 0 125 1 0 1 1 0 8 0 syncache 264 6 0 6 2 2 0 1 0 8 0 tcpqe 32 135 0 135 2 2 0 1 0 8 0 tcpcb 544 159 0 155 1 0 1 1 0 8 0 inpcb 280 574 0 567 3 2 1 3 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 8 0 7 1 0 1 1 0 8 0 ppxss 1128 7 0 7 2 2 0 1 0 8 0 pffrag 232 5 0 5 2 2 0 1 0 482 0 pffrnode 88 5 0 5 2 2 0 1 0 8 0 pffrent 40 95 0 95 2 2 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 48 0 9 1 0 1 1 0 8 0 pfstkey 112 48 0 9 2 0 2 2 0 8 0 pfstate 328 48 0 9 4 0 4 4 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 332 0 179 15 2 13 14 0 8 0 art_table 32 333 0 179 2 0 2 2 0 8 0 art_node 16 72 0 42 1 0 1 1 0 8 0 sysvmsgpl 40 38 0 22 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 89 0 79 1 0 1 1 0 8 0 shmpl 112 47 0 3 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1947 0 541 46 0 46 46 0 8 0 ffsino 272 1947 0 541 94 0 94 94 0 8 0 nchpl 144 2826 0 2394 61 41 20 61 0 8 0 uvmvnodes 72 2196 0 0 40 0 40 40 0 8 0 vnodes 208 2196 0 0 116 0 116 116 0 8 0 namei 1024 8157 0 8157 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 14 0 0 2 0 2 2 0 8 0 vmpool 552 15 0 0 2 0 2 2 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 7426 0 7426 8 7 1 7 0 8 1 plimitpl 152 29 0 21 1 0 1 1 0 8 0 sigapl 432 543 0 528 3 1 2 3 0 8 0 futexpl 56 7937 0 7937 1 0 1 1 0 8 1 knotepl 112 120 0 101 1 0 1 1 0 8 0 kqueuepl 104 91 0 88 1 0 1 1 0 8 0 pipepl 160 476 0 457 2 1 1 2 0 8 0 fdescpl 488 544 0 528 3 0 3 3 0 8 0 filepl 152 4388 0 4286 7 2 5 6 0 8 1 lockfpl 104 124 0 123 1 0 1 1 0 8 0 lockfspl 48 51 0 50 1 0 1 1 0 8 0 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 27 0 16 1 0 1 1 0 8 0 ucredpl 96 470 0 461 1 0 1 1 0 8 0 zombiepl 144 528 0 527 1 0 1 1 0 8 0 processpl 896 560 0 527 4 0 4 4 0 8 0 procpl 632 1326 0 1283 6 1 5 5 0 8 0 srpgc 64 2 0 2 1 1 0 1 0 8 0 sosppl 128 31 0 31 1 1 0 1 0 8 0 sockpl 384 775 0 756 8 5 3 6 0 8 1 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 6 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 12 0 0 2 0 2 2 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 150 0 0 18 0 18 18 0 8 0 mtagpl 80 25 0 0 1 0 1 1 0 8 0 mbufpl 256 319 0 0 19 0 19 19 0 8 0 bufpl 256 7013 0 1313 357 0 357 357 0 8 0 anonpl 16 118727 0 90002 129 1 128 128 0 124 4 amapchunkpl 152 4626 0 4010 28 3 25 25 0 158 0 amappl16 192 4459 0 3272 68 0 68 68 0 8 8 amappl14 176 90 0 84 1 0 1 1 0 8 0 amappl12 160 9 0 7 2 1 1 1 0 8 0 amappl11 152 221 0 203 1 0 1 1 0 8 0 amappl10 144 15 0 8 1 0 1 1 0 8 0 amappl9 136 730 0 726 1 0 1 1 0 8 0 amappl8 128 297 0 269 1 0 1 1 0 8 0 amappl7 120 44 0 39 1 0 1 1 0 8 0 amappl6 112 218 0 207 1 0 1 1 0 8 0 amappl5 104 147 0 131 1 0 1 1 0 8 0 amappl4 96 812 0 780 2 1 1 2 0 8 0 amappl3 88 130 0 124 1 0 1 1 0 8 0 amappl2 80 3329 0 3256 3 0 3 3 0 8 0 amappl1 72 21989 0 21556 26 15 11 20 0 8 0 amappl 80 1631 0 1572 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 48 0 3 1 0 1 1 0 8 0 uaddrrnd 24 559 0 528 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 559 0 528 1 0 1 1 0 8 0 vmmpekpl 168 8708 0 8674 2 0 2 2 0 8 0 vmmpepl 168 76572 0 74220 151 28 123 144 0 357 10 vmsppl 368 543 0 528 2 0 2 2 0 8 0 pdppl 4096 1125 0 1070 8 0 8 8 0 8 0 pvpl 32 276062 0 251281 239 0 239 239 0 265 32 pmappl 232 558 0 528 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 528 0 5 15 0 15 15 0 8 0