panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 92337 4196 0 0 0x4000000 0K syz-executor.0 154015 70763 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(fffffd8063c00558,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b90600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b90600,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b90600,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b2cac8,ffff800020ab0290) 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(fffffd806e5558f0,c5005601,ffff800000b97800,1,fffffd807f7c67e0,ffff800020ab0290) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd807a17edb8,c5005601,ffff800000b97800,ffff800020ab0290) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0290,ffff800023bb3768,ffff800023bb37b0) at sys_ioctl+0x5b9 syscall(ffff800023bb3830) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023bb3830) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf384c3b3070, 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(fffffd8063c00558,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b90600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b90600,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b90600,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b2cac8,ffff800020ab0290) 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(fffffd806e5558f0,c5005601,ffff800000b97800,1,fffffd807f7c67e0,ffff800020ab0290) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd807a17edb8,c5005601,ffff800000b97800,ffff800020ab0290) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0290,ffff800023bb3768,ffff800023bb37b0) at sys_ioctl+0x5b9 syscall(ffff800023bb3830) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023bb3830) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf384c3b3070, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023bb30c0 rbx 0xffff800023bb3170 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b66000 rax 0xffff800000a7d7c0 r8 0xffffffff81cadc2f kprintf+0x16f r9 0x1 r10 0x25 r11 0x4410c7d52c3d240d r12 0x3000000008 r13 0xffff800023bb30d0 r14 0x100 r15 0x1 rip 0xffffffff81372a18 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023bb30b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=92337 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020a5e280,0xffffffff8267ba78 process=0xffff800020adce00 user=0xffff800023bae000, vmspace=0xfffffd807f0085c0 estcpu=36, cpticks=75, pctcpu=20.28 user=0, sys=18324, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 4196 24 20828 0 2 0 syz-executor.0 * 4196 92337 20828 0 7 0x4000000 syz-executor.0 82117 368717 89782 0 2 0 syz-executor.1 82117 369823 89782 0 3 0x4000080 ttyout syz-executor.1 82117 504428 89782 0 3 0x4000080 ttyout syz-executor.1 89782 431182 70763 0 2 0x482 syz-executor.1 78203 458088 0 0 3 0x14200 bored sosplice 20828 403557 70763 0 2 0x482 syz-executor.0 70763 135678 90505 0 3 0x82 thrsleep syz-fuzzer 70763 154015 90505 0 7 0x4000482 syz-fuzzer 70763 119917 90505 0 3 0x4000082 thrsleep syz-fuzzer 70763 253036 90505 0 2 0x4000482 syz-fuzzer 70763 481791 90505 0 3 0x4000082 thrsleep syz-fuzzer 70763 517855 90505 0 3 0x4000082 thrsleep syz-fuzzer 70763 382968 90505 0 3 0x4000082 thrsleep syz-fuzzer 70763 321102 90505 0 3 0x4000082 thrsleep syz-fuzzer 70763 382356 90505 0 2 0x4000482 syz-fuzzer 70763 493683 90505 0 3 0x4000082 kqread syz-fuzzer 90505 249364 499 0 3 0x10008a pause ksh 499 460072 89803 0 3 0x92 select sshd 81403 451985 1 0 3 0x100083 ttyin getty 89803 341289 1 0 3 0x80 select sshd 46160 136696 75869 74 2 0x100492 pflogd 75869 370190 1 0 3 0x80 netio pflogd 28704 344245 18174 73 2 0x100490 syslogd 18174 424701 1 0 3 0x100082 netio syslogd 68771 20842 1 77 3 0x100090 poll dhclient 45025 240325 1 0 3 0x80 poll dhclient 54525 345655 0 0 2 0x14200 zerothread 39975 477735 0 0 3 0x14200 aiodoned aiodoned 69203 266708 0 0 2 0x14200 update 48607 38851 0 0 3 0x14200 cleaner cleaner 87698 88557 0 0 3 0x14200 reaper reaper 383 70323 0 0 3 0x14200 pgdaemon pagedaemon 12581 71119 0 0 3 0x14200 bored crynlk 61894 174819 0 0 3 0x14200 bored crypto 46550 266220 0 0 3 0x40014200 acpi0 acpi0 92244 224681 0 0 3 0x40014200 idle1 37043 263158 0 0 2 0x14200 softnet 74749 425286 0 0 2 0x14200 systqmp 11168 413980 0 0 3 0x14200 bored systq 89772 12265 0 0 2 0x40014200 softclock 24764 35028 0 0 3 0x40014200 idle0 10755 438050 0 0 2 0x14200 smr 1 59065 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 4196 (syz-executor.0) thread 0xffff800020ab0290 (92337) shared rwlock vmmaplk r = 0 (0xfffffd807f0085d8) #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 (0xffff800000b90618) #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 (0xffffffff82627b50) #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 9529 6418K 7822K 78643K 11553 0 0 pcb 14 8K 8K 78643K 163 0 0 rtable 102 12K 14K 78643K 456 0 0 ifaddr 84 14K 14K 78643K 165 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1505 0 0 iov 0 0K 16K 78643K 68 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1230 77K 78K 78643K 1568 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 8 0 0 VM map 12 6K 6K 78643K 12 0 0 sem 12 1K 1K 78643K 63 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 402 0 0 proc 60 63K 95K 78643K 569 0 0 subproc 32 2K 2K 78643K 68 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 1K 78643K 57 0 0 in_multi 37 2K 2K 78643K 93 0 0 ether_multi 1 0K 0K 78643K 6 0 0 mrt 0 0K 0K 78643K 2 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 260 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 136 100K 100K 78643K 2345 0 0 UVM aobj 57 4K 4K 78643K 58 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 128 0 0 NDP 12 0K 0K 78643K 38 0 0 temp 135 3551K 3619K 78643K 15753 0 0 kqueue 0 0K 0K 78643K 1 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 10 0 6 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 59 0 57 1 0 1 1 0 8 0 rtentry 112 73 0 38 2 0 2 2 0 8 0 unpcb 120 294 0 282 1 0 1 1 0 8 0 syncache 264 6 0 6 2 2 0 1 0 8 0 tcpqe 32 201 0 201 2 2 0 1 0 8 0 tcpcb 544 269 0 264 2 1 1 2 0 8 0 inpcb 280 1745 0 1735 9 5 4 8 0 8 3 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 9 0 7 2 1 1 1 0 8 0 pkpcb 40 6 0 6 2 1 1 1 0 8 1 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 6 0 6 3 3 0 1 0 8 0 pffrag 232 13 0 13 2 1 1 1 0 482 1 pffrnode 88 13 0 13 2 1 1 1 0 8 1 pffrent 40 415 0 415 2 1 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 55 0 8 1 0 1 1 0 8 0 pfstkey 112 55 0 8 2 0 2 2 0 8 0 pfstate 328 55 0 8 4 0 4 4 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 360 0 182 17 5 12 14 0 8 0 art_table 32 362 0 182 2 0 2 2 0 8 0 art_node 16 70 0 38 1 0 1 1 0 8 0 sysvmsgpl 40 37 0 19 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 61 0 51 1 0 1 1 0 8 0 shmpl 112 56 0 1 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1993 0 589 46 0 46 46 0 8 0 ffsino 272 1993 0 589 96 1 95 95 0 8 0 nchpl 144 2810 0 1203 61 0 61 61 0 8 0 uvmvnodes 72 2319 0 0 43 0 43 43 0 8 0 vnodes 208 2319 0 0 123 0 123 123 0 8 0 namei 1024 8912 0 8912 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 9 0 0 2 0 2 2 0 8 0 vmpool 552 10 0 0 1 0 1 1 0 8 0 scxspl 192 8454 0 8454 9 7 2 7 0 8 2 plimitpl 152 45 0 37 1 0 1 1 0 8 0 sigapl 432 594 0 578 3 1 2 3 0 8 0 futexpl 56 12854 0 12854 1 0 1 1 0 8 1 knotepl 112 128 0 109 1 0 1 1 0 8 0 kqueuepl 104 134 0 131 1 0 1 1 0 8 0 pipepl 160 382 0 363 4 2 2 2 0 8 1 fdescpl 488 595 0 578 3 0 3 3 0 8 0 filepl 152 5580 0 5474 9 3 6 9 0 8 1 lockfpl 104 170 0 169 1 0 1 1 0 8 0 lockfspl 48 52 0 51 1 0 1 1 0 8 0 sessionpl 112 20 0 9 1 0 1 1 0 8 0 pgrppl 48 24 0 13 1 0 1 1 0 8 0 ucredpl 96 455 0 446 1 0 1 1 0 8 0 zombiepl 144 578 0 578 1 0 1 1 0 8 1 processpl 896 611 0 578 4 0 4 4 0 8 0 procpl 632 1454 0 1409 5 0 5 5 0 8 1 srpgc 64 6 0 6 2 2 0 1 0 8 0 sosppl 128 178 0 178 2 1 1 1 0 8 1 sockpl 384 2117 0 2093 14 7 7 13 0 8 3 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 16 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 159 0 0 19 0 19 19 0 8 0 mtagpl 80 20 0 0 1 0 1 1 0 8 0 mbufpl 256 355 0 0 21 0 21 21 0 8 0 bufpl 256 8424 0 1366 442 0 442 442 0 8 0 anonpl 16 86574 0 67329 106 15 91 104 0 124 0 amapchunkpl 152 3781 0 3615 14 6 8 14 0 158 0 amappl16 192 3332 0 2097 75 11 64 72 0 8 2 amappl15 184 27 0 23 1 0 1 1 0 8 0 amappl14 176 231 0 221 1 0 1 1 0 8 0 amappl13 168 52 0 52 2 1 1 1 0 8 1 amappl12 160 18 0 17 1 0 1 1 0 8 0 amappl11 152 64 0 49 1 0 1 1 0 8 0 amappl10 144 126 0 119 1 0 1 1 0 8 0 amappl9 136 636 0 632 1 0 1 1 0 8 0 amappl8 128 217 0 178 2 0 2 2 0 8 0 amappl7 120 152 0 147 1 0 1 1 0 8 0 amappl6 112 60 0 51 1 0 1 1 0 8 0 amappl5 104 155 0 141 1 0 1 1 0 8 0 amappl4 96 909 0 876 1 0 1 1 0 8 0 amappl3 88 296 0 289 1 0 1 1 0 8 0 amappl2 80 3755 0 3672 3 1 2 3 0 8 0 amappl1 72 22896 0 22433 25 15 10 20 0 8 0 amappl 80 1754 0 1698 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 57 0 1 1 0 1 1 0 8 0 uaddrrnd 24 605 0 578 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 605 0 578 1 0 1 1 0 8 0 vmmpekpl 168 8857 0 8826 2 0 2 2 0 8 0 vmmpepl 168 82380 0 79820 180 26 154 154 0 357 42 vmsppl 368 594 0 578 2 0 2 2 0 8 0 pdppl 4096 1217 0 1165 7 0 7 7 0 8 0 pvpl 32 251336 0 229556 230 21 209 230 0 265 7 pmappl 232 604 0 578 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 621 0 10 18 0 18 18 0 8 0