panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 100754 74687 0 0 0 0 syz-executor.0 * 51137 74687 0 0 0x4000000 1K 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(fffffd80653e2648,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b09000,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b09000,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b09000,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b46f18,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(fffffd806e7a08f0,c5005601,ffff800000ae8800,1,fffffd807f7c6960,ffff800020ab0ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80649f6dc0,c5005601,ffff800000ae8800,ffff800020ab0ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0ee8,ffff800023b971c8,ffff800023b97210) at sys_ioctl+0x5b9 syscall(ffff800023b97290) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023b97290) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x693ccee0bf0, 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic amap_pp_adjref: negative reference count ddb{1}> 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(fffffd80653e2648,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b09000,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b09000,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b09000,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b46f18,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(fffffd806e7a08f0,c5005601,ffff800000ae8800,1,fffffd807f7c6960,ffff800020ab0ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80649f6dc0,c5005601,ffff800000ae8800,ffff800020ab0ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0ee8,ffff800023b971c8,ffff800023b97210) at sys_ioctl+0x5b9 syscall(ffff800023b97290) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023b97290) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x693ccee0bf0, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023b96b20 rbx 0xffff800023b96bd0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b66000 rax 0xffff800000a7d780 r8 0xffffffff811a12cf kprintf+0x16f r9 0x1 r10 0x25 r11 0x484b6cdc4f253003 r12 0x3000000008 r13 0xffff800023b96b30 r14 0x100 r15 0x1 rip 0xffffffff8210c428 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023b96b10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=51137 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab13d8,0xffffffff826404e0 process=0xffff800020adc700 user=0xffff800023b92000, vmspace=0xfffffd807f008730 estcpu=36, cpticks=17839, pctcpu=0.0 user=0, sys=17839, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 74687 100754 3945 0 7 0 syz-executor.0 *74687 51137 3945 0 7 0x4000000 syz-executor.0 9050 87756 0 0 3 0x14200 bored sosplice 96283 183890 97508 0 3 0x82 nanosleep syz-executor.1 3945 375227 97508 0 3 0x82 nanosleep syz-executor.0 97508 444227 62994 0 3 0x82 nanosleep syz-fuzzer 97508 275346 62994 0 3 0x4000082 nanosleep syz-fuzzer 97508 358476 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 372516 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 37573 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 509652 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 68641 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 426495 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 419491 62994 0 3 0x4000082 thrsleep syz-fuzzer 97508 441688 62994 0 3 0x4000082 kqread syz-fuzzer 62994 470156 71218 0 3 0x10008a pause ksh 71218 475560 36038 0 3 0x92 select sshd 72442 240810 1 0 3 0x100083 ttyin getty 36038 151588 1 0 3 0x80 select sshd 28086 96476 39533 74 3 0x100092 bpf pflogd 39533 4078 1 0 3 0x80 netio pflogd 53576 426152 55557 73 3 0x100090 kqread syslogd 55557 247099 1 0 3 0x100082 netio syslogd 30738 128033 1 77 3 0x100090 poll dhclient 49405 18139 1 0 3 0x80 poll dhclient 71329 68437 0 0 3 0x14200 pgzero zerothread 59194 407964 0 0 3 0x14200 aiodoned aiodoned 26816 142822 0 0 3 0x14200 syncer update 30428 469382 0 0 3 0x14200 cleaner cleaner 95612 196201 0 0 3 0x14200 reaper reaper 45162 24546 0 0 3 0x14200 pgdaemon pagedaemon 50600 457050 0 0 3 0x14200 bored crynlk 5338 273240 0 0 3 0x14200 bored crypto 64416 199424 0 0 3 0x40014200 acpi0 acpi0 67808 127631 0 0 3 0x40014200 idle1 43876 472552 0 0 3 0x14200 bored softnet 514 184204 0 0 3 0x14200 bored systqmp 48807 179918 0 0 3 0x14200 bored systq 23348 461263 0 0 3 0x40014200 bored softclock 2041 72315 0 0 3 0x40014200 idle0 86654 512294 0 0 3 0x14200 bored smr 1 480175 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 74687 (syz-executor.0) thread 0xffff800020ab0ee8 (51137) shared rwlock vmmaplk r = 0 (0xfffffd807f008748) #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 (0xffff800000b09018) #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 (0xffffffff82678320) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9573 7376K 7376K 78643K 11206 0 0 pcb 13 8K 8K 78643K 43 0 0 rtable 110 4K 4K 78643K 270 0 0 ifaddr 70 14K 14K 78643K 97 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1483 0 0 iov 0 0K 16K 78643K 21 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1225 77K 77K 78643K 1367 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 3 0 0 VM map 7 3K 3K 78643K 7 0 0 sem 12 0K 0K 78643K 19 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 5 13K 25K 78643K 131 0 0 proc 60 63K 95K 78643K 446 0 0 subproc 32 2K 2K 78643K 34 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 3 0 0 in_multi 53 3K 3K 78643K 63 0 0 ether_multi 1 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 42 185K 185K 78643K 42 0 0 exec 0 0K 1K 78643K 219 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 112 50K 50K 78643K 1346 0 0 UVM aobj 4 2K 2K 78643K 4 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 67 0 0 NDP 9 0K 0K 78643K 20 0 0 temp 98 3544K 3608K 78643K 8686 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 9 0 2 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 33 0 31 1 0 1 1 0 8 0 rtentry 112 52 0 7 2 0 2 2 0 8 0 unpcb 120 103 0 93 1 0 1 1 0 8 0 syncache 264 8 0 8 2 1 1 1 0 8 1 tcpqe 32 40 0 40 1 0 1 1 0 8 1 tcpcb 544 80 0 76 1 0 1 1 0 8 0 inpcb 280 238 0 231 2 0 2 2 0 8 1 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 1 0 1 1 0 1 1 0 8 1 pffrag 232 1 0 1 1 0 1 1 0 482 1 pffrnode 88 1 0 1 1 0 1 1 0 8 1 pffrent 40 45 0 45 1 0 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 21 0 0 1 0 1 1 0 8 0 pfstkey 112 21 0 0 1 0 1 1 0 8 0 pfstate 328 21 0 0 2 0 2 2 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 232 0 9 15 0 15 15 0 8 0 art_table 32 233 0 9 2 0 2 2 0 8 0 art_node 16 51 0 10 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 3 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 17 0 7 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1588 0 181 46 0 46 46 0 8 0 ffsino 272 1588 0 181 94 0 94 94 0 8 0 nchpl 144 2010 0 395 60 0 60 60 0 8 0 uvmvnodes 72 1761 0 0 33 0 33 33 0 8 0 vnodes 208 1761 0 0 93 0 93 93 0 8 0 namei 1024 5457 0 5457 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 4 0 0 1 0 1 1 0 8 0 vmpool 552 5 0 0 1 0 1 1 0 8 0 scxspl 192 5772 0 5772 8 1 7 7 0 8 7 plimitpl 152 23 0 15 1 0 1 1 0 8 0 sigapl 432 329 0 314 3 0 3 3 0 8 1 futexpl 56 2770 0 2770 1 0 1 1 0 8 1 knotepl 112 67 0 48 1 0 1 1 0 8 0 kqueuepl 104 45 0 43 1 0 1 1 0 8 0 pipepl 160 200 0 181 2 0 2 2 0 8 1 fdescpl 488 330 0 314 3 0 3 3 0 8 0 filepl 152 2248 0 2146 6 0 6 6 0 8 2 lockfpl 104 61 0 60 1 0 1 1 0 8 0 lockfspl 48 24 0 23 1 0 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 160 0 151 1 0 1 1 0 8 0 zombiepl 144 314 0 313 1 0 1 1 0 8 0 processpl 896 346 0 313 4 0 4 4 0 8 0 procpl 632 588 0 545 5 0 5 5 0 8 1 sosppl 128 2 0 2 1 0 1 1 0 8 1 sockpl 384 374 0 355 4 0 4 4 0 8 2 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 147 0 0 18 0 18 18 0 8 0 mtagpl 80 16 0 0 1 0 1 1 0 8 0 mbufpl 256 296 0 0 18 0 18 18 0 8 0 bufpl 256 6559 0 1309 329 0 329 329 0 8 0 anonpl 16 51853 0 31035 90 1 89 89 0 124 5 amapchunkpl 152 1664 0 1505 12 0 12 12 0 158 5 amappl16 192 1738 0 590 58 0 58 58 0 8 0 amappl14 176 46 0 42 1 0 1 1 0 8 0 amappl13 168 50 0 49 1 0 1 1 0 8 0 amappl12 160 9 0 6 1 0 1 1 0 8 0 amappl11 152 62 0 46 1 0 1 1 0 8 0 amappl10 144 15 0 12 1 0 1 1 0 8 0 amappl9 136 607 0 602 1 0 1 1 0 8 0 amappl8 128 167 0 138 1 0 1 1 0 8 0 amappl7 120 39 0 35 1 0 1 1 0 8 0 amappl6 112 73 0 60 1 0 1 1 0 8 0 amappl5 104 135 0 120 1 0 1 1 0 8 0 amappl4 96 627 0 595 2 1 1 2 0 8 0 amappl3 88 118 0 113 1 0 1 1 0 8 0 amappl2 80 1705 0 1633 3 1 2 3 0 8 0 amappl1 72 17351 0 16912 26 15 11 20 0 8 1 amappl 80 838 0 788 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 335 0 314 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 335 0 314 1 0 1 1 0 8 0 vmmpekpl 168 6721 0 6689 3 1 2 2 0 8 0 vmmpepl 168 47872 0 45566 143 5 138 138 0 357 33 vmsppl 368 329 0 314 2 0 2 2 0 8 0 pdppl 4096 677 0 632 6 0 6 6 0 8 0 pvpl 32 166468 0 142460 210 0 210 210 0 265 16 pmappl 232 334 0 314 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 495 0 3 15 0 15 15 0 8 0