panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *212002 26385 0 0 0x4000000 0K syz-executor.1 341897 67221 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(fffffd807846a420,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000bbe400,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000bbe400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000bbe400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b61800,ffff800020abe9f8) 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(fffffd806e1c6410,c5005601,ffff800000b76800,1,fffffd807f7c6b40,ffff800020abe9f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca48c88,c5005601,ffff800000b76800,ffff800020abe9f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020abe9f8,ffff800021e05548,ffff800021e05590) at sys_ioctl+0x5b9 syscall(ffff800021e05610) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021e05610) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,de00b79b010) at Xsyscall+0x128 end of kernel end trace frame: 0xde2ff5829a0, 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(fffffd807846a420,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000bbe400,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000bbe400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000bbe400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b61800,ffff800020abe9f8) 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(fffffd806e1c6410,c5005601,ffff800000b76800,1,fffffd807f7c6b40,ffff800020abe9f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca48c88,c5005601,ffff800000b76800,ffff800020abe9f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020abe9f8,ffff800021e05548,ffff800021e05590) at sys_ioctl+0x5b9 syscall(ffff800021e05610) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021e05610) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,de00b79b010) at Xsyscall+0x128 end of kernel end trace frame: 0xde2ff5829a0, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021e04ea0 rbx 0xffff800021e04f50 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b78000 rax 0xffff800000c5bb80 r8 0xffffffff820e3bef kprintf+0x16f r9 0x1 r10 0x25 r11 0xf82fce20fb515535 r12 0x3000000008 r13 0xffff800021e04eb0 r14 0x100 r15 0x1 rip 0xffffffff820639f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021e04e90 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=212002 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020abe780,0xffffffff826582c0 process=0xffff800020adce00 user=0xffff800021e00000, vmspace=0xfffffd807f0088a0 estcpu=36, cpticks=46, pctcpu=20.28 user=0, sys=17239, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 26385 241773 1606 0 2 0 syz-executor.1 *26385 212002 1606 0 7 0x4000000 syz-executor.1 90824 477042 67221 0 2 0x482 syz-executor.0 1606 373409 67221 0 2 0x482 syz-executor.1 62685 376040 0 0 2 0x14600 acct 23622 187221 1 0 3 0x100083 ttyin getty 96972 253340 0 0 3 0x14200 bored sosplice 67221 217780 5225 0 3 0x82 thrsleep syz-fuzzer 67221 189254 5225 0 2 0x4000482 syz-fuzzer 67221 289408 5225 0 2 0x4000482 syz-fuzzer 67221 172518 5225 0 3 0x4000082 thrsleep syz-fuzzer 67221 39897 5225 0 3 0x4000082 kqread syz-fuzzer 67221 298813 5225 0 3 0x4000082 thrsleep syz-fuzzer 67221 127937 5225 0 3 0x4000082 thrsleep syz-fuzzer 67221 360006 5225 0 3 0x4000082 thrsleep syz-fuzzer 67221 254480 5225 0 2 0x4000482 syz-fuzzer 67221 341897 5225 0 7 0x4000482 syz-fuzzer 5225 217258 93713 0 3 0x10008a pause ksh 93713 280983 79019 0 3 0x92 select sshd 79019 172057 1 0 3 0x80 select sshd 14813 176514 31033 74 2 0x100492 pflogd 31033 143143 1 0 3 0x80 netio pflogd 44277 164710 28653 73 2 0x100490 syslogd 28653 332692 1 0 3 0x100082 netio syslogd 52945 292215 1 77 3 0x100090 poll dhclient 41143 314316 1 0 3 0x80 poll dhclient 57758 204938 0 0 3 0x14200 pgzero zerothread 19775 354419 0 0 3 0x14200 aiodoned aiodoned 93770 323106 0 0 2 0x14200 update 33990 94997 0 0 3 0x14200 cleaner cleaner 10236 269836 0 0 3 0x14200 reaper reaper 46642 219810 0 0 3 0x14200 pgdaemon pagedaemon 58382 453939 0 0 3 0x14200 bored crynlk 97711 95083 0 0 3 0x14200 bored crypto 57191 76827 0 0 3 0x40014200 acpi0 acpi0 48780 164780 0 0 3 0x40014200 idle1 27240 350395 0 0 2 0x14200 softnet 44681 226119 0 0 2 0x14200 systqmp 68909 47889 0 0 3 0x14200 bored systq 41718 211225 0 0 2 0x40014200 softclock 73125 227061 0 0 3 0x40014200 idle0 79296 226473 0 0 3 0x14200 bored smr 1 182414 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 26385 (syz-executor.1) thread 0xffff800020abe9f8 (212002) shared rwlock vmmaplk r = 0 (0xfffffd807f0088b8) #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 (0xffff800000bbe418) #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 (0xffffffff82624628) #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 9647 7126K 14751K 78643K 113419 0 0 pcb 13 11K 12K 78643K 2645 0 0 rtable 100 13K 14K 78643K 9840 0 0 ifaddr 652 62K 69K 78643K 2841 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 2264 0 0 iov 0 0K 62K 78643K 4131 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1231 77K 78K 78643K 31746 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 139 0 0 VM map 113 56K 56K 78643K 146 0 0 sem 12 0K 1K 78643K 6206 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 5 13K 25K 78643K 13834 0 0 sigio 0 0K 1K 78643K 6219 0 0 proc 62 63K 95K 78643K 5260 0 0 subproc 32 2K 2K 78643K 1530 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 1297 0 0 in_multi 12 0K 2K 78643K 1473 0 0 ether_multi 1 0K 0K 78643K 125 0 0 mrt 0 0K 0K 78643K 85 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 204 901K 901K 78643K 204 0 0 exec 0 0K 1K 78643K 2405 0 0 pfkey data 0 0K 4K 78643K 4 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 313 896K 896K 78643K 47969 0 0 UVM aobj 130 6K 6K 78643K 134 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 2K 78643K 2441 0 0 NDP 26 0K 1K 78643K 742 0 0 temp 193 3556K 4199K 78643K 443070 0 0 kqueue 0 0K 0K 78643K 107 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 329 0 326 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 2276 0 2274 1 0 1 1 0 8 0 rtentry 112 1383 0 1351 2 0 2 2 0 8 0 unpcb 120 21735 0 21716 34 33 1 2 0 8 0 syncache 264 74 0 74 30 30 0 1 0 8 0 tcpqe 32 203 0 203 16 16 0 1 0 8 0 tcpcb 544 6250 0 6246 75 74 1 13 0 8 0 ipq 40 2 0 2 2 2 0 1 0 8 0 ipqe 40 4 0 4 2 2 0 1 0 8 0 inpcb 280 31460 0 31453 96 95 1 9 0 8 0 rttmr 72 27 0 26 9 8 1 1 0 8 0 ip6q 72 6 0 6 5 5 0 1 0 8 0 ip6af 40 13 0 13 4 4 0 1 0 8 0 nd6 48 189 0 189 10 10 0 1 0 8 0 pkpcb 40 50 0 50 20 20 0 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 321 0 321 36 36 0 1 0 8 0 pffrag 232 334 0 334 31 31 0 1 0 482 0 pffrnode 88 325 0 325 31 31 0 1 0 8 0 pffrent 40 11318 0 11318 31 31 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 1031 0 968 1 0 1 1 0 8 0 pfstkey 112 1032 0 969 3 0 3 3 0 8 0 pfstate 328 1032 0 969 11 4 7 7 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 42 0 40 25 23 2 3 0 8 0 art_heap4 256 5455 0 5241 76 59 17 19 0 8 0 art_table 32 5497 0 5281 9 6 3 3 0 8 0 art_node 16 1382 0 1352 1 0 1 1 0 8 0 sysvmsgpl 40 92 0 64 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 6200 0 6190 1 0 1 1 0 8 0 shmpl 112 132 0 4 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 28135 0 26644 51 2 49 49 0 8 0 ffsino 272 28135 0 26644 100 0 100 100 0 8 0 nchpl 144 50049 0 49518 61 38 23 61 0 8 0 uvmvnodes 72 8599 0 0 157 0 157 157 0 8 0 vnodes 208 8599 0 0 453 0 453 453 0 8 0 namei 1024 226339 0 226339 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 111 0 1 14 0 14 14 0 8 0 vmpool 552 144 0 33 10 2 8 8 0 8 0 scsiplug 64 14 0 14 9 9 0 1 0 8 0 scxspl 192 150328 0 150328 92 91 1 6 0 8 1 plimitpl 152 1042 0 1034 1 0 1 1 0 8 0 sigapl 432 13774 0 13759 7 5 2 3 0 8 0 futexpl 56 481556 0 481556 2 1 1 1 0 8 1 knotepl 112 2898 0 2879 13 12 1 3 0 8 0 kqueuepl 104 4423 0 4420 20 19 1 4 0 8 0 pipepl 160 20444 0 20425 29 28 1 3 0 8 0 fdescpl 488 13775 0 13759 3 0 3 3 0 8 0 filepl 152 204835 0 204733 172 167 5 14 0 8 1 lockfpl 104 5002 0 5000 1 0 1 1 0 8 0 lockfspl 48 1761 0 1759 1 0 1 1 0 8 0 sessionpl 112 112 0 101 1 0 1 1 0 8 0 pgrppl 48 285 0 274 1 0 1 1 0 8 0 ucredpl 96 49230 0 49216 1 0 1 1 0 8 0 zombiepl 144 13772 0 13771 1 0 1 1 0 8 0 processpl 896 13805 0 13771 7 3 4 5 0 8 0 procpl 632 42449 0 42405 12 8 4 5 0 8 0 srpgc 64 161 0 161 48 48 0 1 0 8 0 sosppl 128 378 0 378 42 42 0 1 0 8 0 sockpl 384 55998 0 55970 170 166 4 15 0 8 0 mcl64k 65536 300 0 0 34 31 3 34 0 8 0 mcl16k 16384 33 0 0 5 2 3 3 0 8 0 mcl12k 12288 73 0 0 2 0 2 2 0 8 0 mcl9k 9216 32 0 0 2 0 2 2 0 8 0 mcl8k 8192 33 0 0 4 1 3 3 0 8 0 mcl4k 4096 25 0 0 3 0 3 3 0 8 0 mcl2k2 2112 9 0 0 1 0 1 1 0 8 0 mcl2k 2048 191 0 0 18 7 11 18 0 8 0 mtagpl 80 1033 0 0 11 4 7 11 0 8 0 mbufpl 256 1801 0 0 73 0 73 73 0 8 0 bufpl 256 49515 0 40915 538 0 538 538 0 8 0 anonpl 16 1686425 0 1635920 478 262 216 216 0 124 4 amapchunkpl 152 101878 0 100045 228 156 72 72 0 158 0 amappl16 192 70379 0 68957 371 291 80 83 0 8 6 amappl15 184 3908 0 3908 10 10 0 1 0 8 0 amappl14 176 3204 0 3195 1 0 1 1 0 8 0 amappl13 168 1725 0 1724 1 0 1 1 0 8 0 amappl12 160 2389 0 2385 1 0 1 1 0 8 0 amappl11 152 2018 0 2002 1 0 1 1 0 8 0 amappl10 144 1090 0 1084 1 0 1 1 0 8 0 amappl9 136 2555 0 2552 1 0 1 1 0 8 0 amappl8 128 2173 0 2090 5 2 3 3 0 8 0 amappl7 120 1359 0 1349 1 0 1 1 0 8 0 amappl6 112 1808 0 1785 1 0 1 1 0 8 0 amappl5 104 3693 0 3679 1 0 1 1 0 8 0 amappl4 96 15740 0 15704 2 1 1 2 0 8 0 amappl3 88 4503 0 4497 1 0 1 1 0 8 0 amappl2 80 106496 0 106405 5 2 3 3 0 8 0 amappl1 72 310944 0 310511 25 15 10 20 0 8 0 amappl 80 44482 0 44371 3 0 3 3 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 133 0 4 3 0 3 3 0 8 0 uaddrrnd 24 13919 0 13759 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 13919 0 13759 1 0 1 1 0 8 0 vmmpekpl 168 131578 0 131525 5 2 3 3 0 8 0 vmmpepl 168 1765446 0 1762486 708 535 173 185 0 357 32 vmsppl 368 13774 0 13759 2 0 2 2 0 8 0 pdppl 4096 27845 0 27694 27 7 20 20 0 8 0 pvpl 32 4747586 0 4723727 720 489 231 237 0 265 28 pmappl 232 13918 0 13792 10 2 8 8 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 991 0 210 25 2 23 23 0 8 0