panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 105073 69897 0 0 0 0 syz-executor.0 * 61454 69897 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(fffffd80612bd0a8,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b25200,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b25200,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b25200,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b5a010,ffff800020ab09f8) 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(fffffd806e2c58f0,c5005601,ffff800000b20800,1,fffffd807f7c6a80,ffff800020ab09f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8061ea87c8,c5005601,ffff800000b20800,ffff800020ab09f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab09f8,ffff800022b815b8,ffff800022b81600) at sys_ioctl+0x5b9 syscall(ffff800022b81680) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022b81680) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa7ba689ea20, 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(fffffd80612bd0a8,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b25200,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b25200,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b25200,0,7,fffffd807f0085c0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020b5a010,ffff800020ab09f8) 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(fffffd806e2c58f0,c5005601,ffff800000b20800,1,fffffd807f7c6a80,ffff800020ab09f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8061ea87c8,c5005601,ffff800000b20800,ffff800020ab09f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab09f8,ffff800022b815b8,ffff800022b81600) at sys_ioctl+0x5b9 syscall(ffff800022b81680) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022b81680) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa7ba689ea20, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800022b80f10 rbx 0xffff800022b80fc0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800023bbe000 rax 0xffff800000a49a80 r8 0xffffffff81a8728f kprintf+0x16f r9 0x1 r10 0x25 r11 0xf64c773487d05223 r12 0x3000000008 r13 0xffff800022b80f20 r14 0x100 r15 0x1 rip 0xffffffff81e32088 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022b80f00 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=61454 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab0018,0xffff800020ab0518 process=0xffff800020addc00 user=0xffff800022b7c000, vmspace=0xfffffd807f0085c0 estcpu=36, cpticks=17871, pctcpu=1.0 user=0, sys=17787, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 69897 105073 1261 0 7 0 syz-executor.0 *69897 61454 1261 0 7 0x4000000 syz-executor.0 87413 51631 62201 0 3 0x80 nanosleep syz-executor.1 87413 201080 62201 0 3 0x4000080 switchread syz-executor.1 87413 491543 62201 0 3 0x4000080 kqread syz-executor.1 87413 522926 62201 0 3 0x4000080 ttyout syz-executor.1 87413 31654 62201 0 3 0x4000080 ttyout syz-executor.1 87413 283154 62201 0 3 0x4000080 kqread syz-executor.1 87413 63176 62201 0 3 0x4000080 ttyout syz-executor.1 87413 18139 62201 0 3 0x4000080 fsleep syz-executor.1 62201 3388 47679 0 3 0x82 nanosleep syz-executor.1 52410 279809 1 0 3 0x100083 ttyin getty 27735 521947 0 0 3 0x14200 acct acct 1261 72569 47679 0 3 0x82 nanosleep syz-executor.0 83997 257452 0 0 3 0x14200 bored sosplice 47679 392250 66405 0 3 0x82 thrsleep syz-fuzzer 47679 243325 66405 0 3 0x4000082 nanosleep syz-fuzzer 47679 504051 66405 0 3 0x4000082 thrsleep syz-fuzzer 47679 514988 66405 0 3 0x4000082 thrsleep syz-fuzzer 47679 162075 66405 0 3 0x4000082 thrsleep syz-fuzzer 47679 62144 66405 0 3 0x4000082 kqread syz-fuzzer 47679 476547 66405 0 3 0x4000082 thrsleep syz-fuzzer 47679 338283 66405 0 3 0x4000082 thrsleep syz-fuzzer 47679 387187 66405 0 3 0x4000082 thrsleep syz-fuzzer 47679 85158 66405 0 3 0x4000082 thrsleep syz-fuzzer 66405 165442 23338 0 3 0x10008a pause ksh 23338 360192 89413 0 3 0x92 select sshd 89413 169681 1 0 3 0x80 select sshd 36028 58955 80381 74 3 0x100092 bpf pflogd 80381 356100 1 0 3 0x80 netio pflogd 56237 412534 35813 73 3 0x100090 kqread syslogd 35813 417908 1 0 3 0x100082 netio syslogd 62220 392179 1 77 3 0x100090 poll dhclient 87229 464767 1 0 3 0x80 poll dhclient 59753 323540 0 0 3 0x14200 pgzero zerothread 5842 107201 0 0 3 0x14200 aiodoned aiodoned 71517 101932 0 0 3 0x14200 syncer update 44321 362362 0 0 3 0x14200 cleaner cleaner 46602 179524 0 0 3 0x14200 reaper reaper 86597 29149 0 0 3 0x14200 pgdaemon pagedaemon 35915 285406 0 0 3 0x14200 bored crynlk 16918 101935 0 0 3 0x14200 bored crypto 39749 140806 0 0 3 0x40014200 acpi0 acpi0 78237 512089 0 0 3 0x40014200 idle1 42043 212055 0 0 3 0x14200 bored softnet 76211 322443 0 0 3 0x14200 bored systqmp 46531 312001 0 0 3 0x14200 bored systq 3396 499401 0 0 3 0x40014200 bored softclock 47821 144327 0 0 3 0x40014200 idle0 50314 469297 0 0 3 0x14200 bored smr 1 15005 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 69897 (syz-executor.0) thread 0xffff800020ab09f8 (61454) 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 (0xffff800000b25218) #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 (0xffffffff82686170) #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 9566 7069K 7651K 78643K 12594 0 0 pcb 13 8K 9K 78643K 324 0 0 rtable 115 13K 13K 78643K 793 0 0 ifaddr 98 18K 18K 78643K 334 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1542 0 0 iov 0 0K 20K 78643K 192 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1224 77K 77K 78643K 2159 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 22 0 0 VM map 24 12K 12K 78643K 29 0 0 sem 12 0K 1K 78643K 528 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 986 0 0 sigio 0 0K 0K 78643K 22 0 0 proc 60 63K 95K 78643K 803 0 0 subproc 32 2K 2K 78643K 136 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 89 0 0 in_multi 139 7K 7K 78643K 242 0 0 ether_multi 1 0K 0K 78643K 11 0 0 mrt 0 0K 0K 78643K 9 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 144 636K 636K 78643K 144 0 0 exec 0 0K 1K 78643K 384 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 163 142K 142K 78643K 4785 0 0 UVM aobj 103 3K 3K 78643K 122 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 249 0 0 NDP 17 0K 0K 78643K 71 0 0 temp 156 3559K 4195K 78643K 25509 0 0 kqueue 0 0K 0K 78643K 2 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 26 0 21 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 105 0 103 1 0 1 1 0 8 0 rtentry 112 133 0 90 2 0 2 2 0 8 0 unpcb 120 1195 0 1181 2 1 1 2 0 8 0 syncache 264 8 0 8 4 3 1 1 0 8 1 tcpqe 32 22 0 22 3 2 1 1 0 8 1 tcpcb 544 519 0 515 3 2 1 2 0 8 0 inpcb 280 2192 0 2184 6 4 2 3 0 8 1 rttmr 72 3 0 3 2 2 0 1 0 8 0 nd6 48 19 0 16 2 1 1 1 0 8 0 pkpcb 40 3 0 3 2 2 0 1 0 8 0 ppxss 1128 19 0 19 8 7 1 1 0 8 1 pffrag 232 26 0 25 6 5 1 1 0 482 0 pffrnode 88 26 0 25 6 5 1 1 0 8 0 pffrent 40 997 0 996 6 5 1 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 87 0 65 1 0 1 1 0 8 0 pfstkey 112 87 0 65 2 0 2 2 0 8 0 pfstate 328 87 0 65 4 1 3 4 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 600 0 377 18 4 14 15 0 8 0 art_table 32 603 0 377 2 0 2 2 0 8 0 art_node 16 132 0 92 1 0 1 1 0 8 0 sysvmsgpl 40 28 0 17 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 524 0 514 1 0 1 1 0 8 0 shmpl 112 120 0 19 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2992 0 1586 46 0 46 46 0 8 0 ffsino 272 2992 0 1586 95 0 95 95 0 8 0 nchpl 144 4645 0 3042 61 1 60 61 0 8 0 uvmvnodes 72 3623 0 0 66 0 66 66 0 8 0 vnodes 208 3623 0 0 191 0 191 191 0 8 0 namei 1024 17669 0 17669 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 21 0 0 3 0 3 3 0 8 0 vmpool 552 27 0 5 3 1 2 2 0 8 0 scxspl 192 14679 0 14679 16 15 1 6 0 8 1 plimitpl 152 95 0 87 1 0 1 1 0 8 0 sigapl 432 1168 0 1152 3 1 2 3 0 8 0 futexpl 56 23883 0 23882 2 1 1 1 0 8 0 knotepl 112 420 0 401 1 0 1 1 0 8 0 kqueuepl 104 616 0 610 1 0 1 1 0 8 0 pipepl 160 848 0 827 7 6 1 2 0 8 0 fdescpl 488 1169 0 1152 3 0 3 3 0 8 0 filepl 152 12330 0 12209 18 12 6 7 0 8 0 lockfpl 104 425 0 424 1 0 1 1 0 8 0 lockfspl 48 149 0 148 1 0 1 1 0 8 0 sessionpl 112 26 0 15 1 0 1 1 0 8 0 pgrppl 48 40 0 29 1 0 1 1 0 8 0 ucredpl 96 3253 0 3244 1 0 1 1 0 8 0 zombiepl 144 1152 0 1152 2 1 1 1 0 8 1 processpl 896 1186 0 1152 4 0 4 4 0 8 0 procpl 632 3652 0 3601 5 0 5 5 0 8 0 srpgc 64 14 0 14 6 6 0 1 0 8 0 sosppl 128 32 0 32 5 5 0 1 0 8 0 sockpl 384 3511 0 3488 14 10 4 6 0 8 0 mcl64k 65536 20 0 0 3 0 3 3 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 9 0 0 1 0 1 1 0 8 0 mcl9k 9216 8 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 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 165 0 0 20 0 20 20 0 8 0 mtagpl 80 19 0 0 1 0 1 1 0 8 0 mbufpl 256 775 0 0 45 0 45 45 0 8 0 bufpl 256 8994 0 1936 442 0 442 442 0 8 0 anonpl 16 178995 0 151189 146 34 112 123 0 124 0 amapchunkpl 152 9834 0 9308 45 24 21 30 0 158 0 amappl16 192 7211 0 5804 116 45 71 75 0 8 0 amappl14 176 127 0 123 1 0 1 1 0 8 0 amappl13 168 11 0 9 1 0 1 1 0 8 0 amappl12 160 18 0 16 1 0 1 1 0 8 0 amappl11 152 222 0 207 1 0 1 1 0 8 0 amappl10 144 174 0 167 1 0 1 1 0 8 0 amappl9 136 1127 0 1122 1 0 1 1 0 8 0 amappl8 128 715 0 675 2 0 2 2 0 8 0 amappl7 120 221 0 213 1 0 1 1 0 8 0 amappl6 112 227 0 212 1 0 1 1 0 8 0 amappl5 104 190 0 176 1 0 1 1 0 8 0 amappl4 96 1422 0 1386 2 1 1 2 0 8 0 amappl3 88 213 0 205 1 0 1 1 0 8 0 amappl2 80 7963 0 7881 3 1 2 3 0 8 0 amappl1 72 36885 0 36424 25 15 10 20 0 8 0 amappl 80 4037 0 3971 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 121 0 19 2 0 2 2 0 8 0 uaddrrnd 24 1196 0 1152 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1196 0 1152 1 0 1 1 0 8 0 vmmpekpl 168 13907 0 13869 2 0 2 2 0 8 0 vmmpepl 168 160280 0 157506 252 91 161 162 0 357 40 vmsppl 368 1168 0 1152 2 0 2 2 0 8 0 pdppl 4096 2399 0 2335 9 1 8 9 0 8 0 pvpl 32 475218 0 448336 304 87 217 253 0 265 0 pmappl 232 1195 0 1157 4 1 3 3 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 655 0 12 19 0 19 19 0 8 0