panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 187092 68502 0 0 0 0 syz-executor.0 *272843 68502 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(fffffd8065a98378,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ad0400,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ad0400,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ad0400,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b46450,ffff800020ab0c70) 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(fffffd806e0dd9c0,c5005601,ffff800000ae9800,1,fffffd807f7c6ae0,ffff800020ab0c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80610ff988,c5005601,ffff800000ae9800,ffff800020ab0c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0c70,ffff800023bbf618,ffff800023bbf660) at sys_ioctl+0x5b9 syscall(ffff800023bbf6e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023bbf6e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75a6f829b30, 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(fffffd8065a98378,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ad0400,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ad0400,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ad0400,0,7,fffffd807f007730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b46450,ffff800020ab0c70) 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(fffffd806e0dd9c0,c5005601,ffff800000ae9800,1,fffffd807f7c6ae0,ffff800020ab0c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80610ff988,c5005601,ffff800000ae9800,ffff800020ab0c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0c70,ffff800023bbf618,ffff800023bbf660) at sys_ioctl+0x5b9 syscall(ffff800023bbf6e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023bbf6e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75a6f829b30, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023bbef70 rbx 0xffff800023bbf020 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021d66000 rax 0xffff800000a490c0 r8 0xffffffff81d1421f kprintf+0x16f r9 0x1 r10 0x25 r11 0x89b465a447872a9 r12 0x3000000008 r13 0xffff800023bbef80 r14 0x100 r15 0x1 rip 0xffffffff81bd1c78 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023bbef60 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=272843 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab09f8,0xffffffff82637fe8 process=0xffff800020adc000 user=0xffff800023bba000, vmspace=0xfffffd807f007730 estcpu=36, cpticks=21372, pctcpu=0.0 user=0, sys=21372, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 68502 187092 50703 0 7 0 syz-executor.0 *68502 272843 50703 0 7 0x4000000 syz-executor.0 86573 93639 35407 60929 3 0x90 nanosleep syz-executor.1 86573 383382 35407 60929 3 0x4000090 poll syz-executor.1 86573 413762 35407 60929 3 0x4000090 fsleep syz-executor.1 35407 272095 4854 0 3 0x82 nanosleep syz-executor.1 50703 215518 4854 0 3 0x82 nanosleep syz-executor.0 45754 409314 0 0 3 0x14200 acct acct 47629 472171 0 0 3 0x14200 bored sosplice 4854 278470 17969 0 3 0x82 kqread syz-fuzzer 4854 113956 17969 0 3 0x4000082 nanosleep syz-fuzzer 4854 68683 17969 0 3 0x4000082 thrsleep syz-fuzzer 4854 407667 17969 0 3 0x4000082 thrsleep syz-fuzzer 4854 19870 17969 0 3 0x4000082 thrsleep syz-fuzzer 4854 189613 17969 0 3 0x4000082 thrsleep syz-fuzzer 4854 192332 17969 0 3 0x4000082 thrsleep syz-fuzzer 4854 233697 17969 0 3 0x4000082 thrsleep syz-fuzzer 4854 448160 17969 0 3 0x4000082 nanosleep syz-fuzzer 4854 25806 17969 0 3 0x4000082 thrsleep syz-fuzzer 17969 278208 96293 0 3 0x10008a pause ksh 96293 406202 92415 0 3 0x92 select sshd 79017 500574 1 0 3 0x100083 ttyin getty 92415 442385 1 0 3 0x80 select sshd 47334 138715 49971 74 3 0x100092 bpf pflogd 49971 385306 1 0 3 0x80 netio pflogd 39378 16047 61306 73 3 0x100090 kqread syslogd 61306 226014 1 0 3 0x100082 netio syslogd 51175 284153 1 77 3 0x100090 poll dhclient 29748 469893 1 0 3 0x80 poll dhclient 57873 350962 0 0 3 0x14200 pgzero zerothread 13674 181428 0 0 3 0x14200 aiodoned aiodoned 49142 148779 0 0 3 0x14200 syncer update 12187 32626 0 0 3 0x14200 cleaner cleaner 93062 29124 0 0 3 0x14200 reaper reaper 61255 218513 0 0 3 0x14200 pgdaemon pagedaemon 40901 269718 0 0 3 0x14200 bored crynlk 60018 462657 0 0 3 0x14200 bored crypto 18169 116931 0 0 3 0x40014200 acpi0 acpi0 3208 498101 0 0 3 0x40014200 idle1 7081 158793 0 0 3 0x14200 bored softnet 25266 418478 0 0 3 0x14200 bored systqmp 12283 521074 0 0 3 0x14200 bored systq 65629 20484 0 0 3 0x40014200 bored softclock 24524 236291 0 0 3 0x40014200 idle0 73799 74131 0 0 3 0x14200 bored smr 1 144720 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 68502 (syz-executor.0) thread 0xffff800020ab0c70 (272843) shared rwlock vmmaplk r = 0 (0xfffffd807f007748) #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 (0xffff800000ad0418) #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 (0xffffffff8265d4b0) #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 9537 6438K 7923K 78643K 13059 0 0 pcb 13 8K 9K 78643K 269 0 0 rtable 107 4K 4K 78643K 700 0 0 ifaddr 79 15K 16K 78643K 305 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1504 0 0 iov 0 0K 16K 78643K 176 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1238 78K 78K 78643K 2107 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 21 0 0 VM map 6 3K 3K 78643K 19 0 0 sem 12 1K 1K 78643K 173 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 903 0 0 sigio 0 0K 0K 78643K 5 0 0 proc 62 63K 83K 78643K 653 0 0 subproc 32 2K 2K 78643K 85 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 439 0 0 in_multi 48 2K 3K 78643K 175 0 0 ether_multi 1 0K 0K 78643K 9 0 0 mrt 0 0K 0K 78643K 5 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 336 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 133 47K 47K 78643K 4199 0 0 UVM aobj 94 8K 8K 78643K 96 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 250 0 0 NDP 14 0K 0K 78643K 66 0 0 temp 144 3555K 3623K 78643K 39895 0 0 kqueue 0 0K 0K 78643K 8 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 20 0 14 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 121 0 119 1 0 1 1 0 8 0 rtentry 112 94 0 52 2 0 2 2 0 8 0 unpcb 120 690 0 679 1 0 1 1 0 8 0 syncache 264 8 0 8 4 4 0 1 0 8 0 tcpqe 32 139 0 139 2 2 0 1 0 8 0 tcpcb 544 462 0 456 3 2 1 3 0 8 0 inpcb 280 1670 0 1661 8 7 1 4 0 8 0 rttmr 72 2 0 2 2 2 0 1 0 8 0 ip6q 72 2 0 1 1 0 1 1 0 8 0 ip6af 40 3 0 2 1 0 1 1 0 8 0 nd6 48 11 0 7 1 0 1 1 0 8 0 pkpcb 40 3 0 3 1 1 0 1 0 8 0 ppxss 1128 29 0 29 2 2 0 1 0 8 0 pffrag 232 33 0 33 1 1 0 1 0 482 0 pffrnode 88 33 0 33 1 1 0 1 0 8 0 pffrent 40 974 0 974 1 1 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 76 0 37 1 0 1 1 0 8 0 pfstkey 112 76 0 37 2 0 2 2 0 8 0 pfstate 328 76 0 37 5 0 5 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 389 0 172 16 2 14 14 0 8 0 art_table 32 390 0 172 2 0 2 2 0 8 0 art_node 16 93 0 55 1 0 1 1 0 8 0 sysvmsgpl 40 56 0 16 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 171 0 161 1 0 1 1 0 8 0 shmpl 112 94 0 2 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2813 0 1404 46 0 46 46 0 8 0 ffsino 272 2813 0 1404 95 0 95 95 0 8 0 nchpl 144 4547 0 2937 61 0 61 61 0 8 0 uvmvnodes 72 3515 0 0 64 0 64 64 0 8 0 vnodes 208 3515 0 0 185 0 185 185 0 8 0 namei 1024 15446 0 15446 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 3 0 0 1 0 1 1 0 8 0 vmpool 552 17 0 13 1 0 1 1 0 8 0 scxspl 192 13083 0 13083 11 10 1 7 0 8 1 plimitpl 152 86 0 78 1 0 1 1 0 8 0 sigapl 432 1092 0 1076 3 1 2 3 0 8 0 futexpl 56 24148 0 24147 1 0 1 1 0 8 0 knotepl 112 223 0 204 1 0 1 1 0 8 0 kqueuepl 104 743 0 741 1 0 1 1 0 8 0 pipepl 160 1016 0 997 2 1 1 2 0 8 0 fdescpl 488 1093 0 1076 3 0 3 3 0 8 0 filepl 152 10813 0 10709 9 4 5 7 0 8 0 lockfpl 104 1130 0 1129 1 0 1 1 0 8 0 lockfspl 48 257 0 256 1 0 1 1 0 8 0 sessionpl 112 21 0 10 1 0 1 1 0 8 0 pgrppl 48 28 0 17 1 0 1 1 0 8 0 ucredpl 96 1070 0 1059 1 0 1 1 0 8 0 zombiepl 144 1078 0 1078 1 0 1 1 0 8 1 processpl 896 1112 0 1078 4 0 4 4 0 8 0 procpl 632 3202 0 3156 5 1 4 5 0 8 0 srpgc 64 4 0 4 2 2 0 1 0 8 0 sosppl 128 8 0 8 1 1 0 1 0 8 0 sockpl 384 2500 0 2478 13 10 3 7 0 8 0 mcl64k 65536 259 0 0 33 4 29 33 0 8 1 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 1 2 3 0 8 0 mcl4k 4096 11 0 0 2 0 2 2 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 158 0 0 19 0 19 19 0 8 0 mtagpl 80 28 0 0 1 0 1 1 0 8 0 mbufpl 256 568 0 0 32 0 32 32 0 8 0 bufpl 256 8819 0 1761 442 0 442 442 0 8 0 anonpl 16 170775 0 147781 126 17 109 109 0 124 7 amapchunkpl 152 8757 0 8399 25 7 18 18 0 158 1 amappl16 192 7196 0 6004 84 16 68 70 0 8 7 amappl15 184 1 0 1 1 1 0 1 0 8 0 amappl14 176 107 0 103 1 0 1 1 0 8 0 amappl13 168 35 0 32 1 0 1 1 0 8 0 amappl12 160 663 0 661 1 0 1 1 0 8 0 amappl11 152 169 0 151 1 0 1 1 0 8 0 amappl10 144 25 0 20 1 0 1 1 0 8 0 amappl9 136 649 0 644 1 0 1 1 0 8 0 amappl8 128 223 0 183 2 0 2 2 0 8 0 amappl7 120 52 0 46 1 0 1 1 0 8 0 amappl6 112 174 0 159 1 0 1 1 0 8 0 amappl5 104 819 0 805 1 0 1 1 0 8 0 amappl4 96 1112 0 1076 2 1 1 2 0 8 0 amappl3 88 454 0 449 1 0 1 1 0 8 0 amappl2 80 7690 0 7609 3 1 2 3 0 8 0 amappl1 72 34158 0 33699 26 16 10 20 0 8 0 amappl 80 3564 0 3508 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 95 0 2 2 0 2 2 0 8 0 uaddrrnd 24 1110 0 1076 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1110 0 1076 1 0 1 1 0 8 0 vmmpekpl 168 14551 0 14518 2 0 2 2 0 8 0 vmmpepl 168 145821 0 143343 191 48 143 151 0 357 28 vmsppl 368 1092 0 1076 2 0 2 2 0 8 0 pdppl 4096 2227 0 2181 6 0 6 6 0 8 0 pvpl 32 415000 0 391720 248 24 224 233 0 265 10 pmappl 232 1109 0 1089 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 663 0 12 19 0 19 19 0 8 0