panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 351481 26575 0 0 0 0 syz-executor.0 * 6684 41541 0 0 0x4000000 1K syz-executor.1 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(fffffd8063df20f8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ab3400,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ab3400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ab3400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020ace678,ffff800020ab0780) 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(fffffd806e1da680,c5005601,ffff800000b32800,1,fffffd807f7c6840,ffff800020ab0780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8064193bf8,c5005601,ffff800000b32800,ffff800020ab0780) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0780,ffff800021b7aed8,ffff800021b7af20) at sys_ioctl+0x5b9 syscall(ffff800021b7afa0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b7afa0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xbc31aa19030, 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(fffffd8063df20f8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ab3400,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ab3400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ab3400,0,7,fffffd807f0088a0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020ace678,ffff800020ab0780) 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(fffffd806e1da680,c5005601,ffff800000b32800,1,fffffd807f7c6840,ffff800020ab0780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8064193bf8,c5005601,ffff800000b32800,ffff800020ab0780) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0780,ffff800021b7aed8,ffff800021b7af20) at sys_ioctl+0x5b9 syscall(ffff800021b7afa0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b7afa0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xbc31aa19030, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021b7a830 rbx 0xffff800021b7a8e0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022d90000 rax 0xffff800000a49300 r8 0xffffffff81cadc2f kprintf+0x16f r9 0x1 r10 0x25 r11 0xa6e5b09a1539aa63 r12 0x3000000008 r13 0xffff800021b7a840 r14 0x100 r15 0x1 rip 0xffffffff81372a18 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021b7a820 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=6684 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab0508,0xffff800020ab0a08 process=0xffff800020adc000 user=0xffff800021b76000, vmspace=0xfffffd807f0088a0 estcpu=36, cpticks=17030, pctcpu=0.0 user=0, sys=17028, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 26575 351481 67748 0 7 0 syz-executor.0 26575 349811 67748 0 3 0x4000080 fsleep syz-executor.0 41541 131858 46362 0 2 0 syz-executor.1 *41541 6684 46362 0 7 0x4000000 syz-executor.1 67748 276954 91032 0 3 0x82 nanosleep syz-executor.0 20107 254335 0 0 3 0x14200 bored sosplice 46362 112035 91032 0 3 0x82 nanosleep syz-executor.1 91032 175879 3476 0 3 0x82 thrsleep syz-fuzzer 91032 375979 3476 0 3 0x4000082 nanosleep syz-fuzzer 91032 78774 3476 0 3 0x4000082 thrsleep syz-fuzzer 91032 345566 3476 0 3 0x4000082 kqread syz-fuzzer 91032 269318 3476 0 3 0x4000082 thrsleep syz-fuzzer 91032 324038 3476 0 3 0x4000082 thrsleep syz-fuzzer 91032 228074 3476 0 3 0x4000082 thrsleep syz-fuzzer 91032 25753 3476 0 3 0x4000082 thrsleep syz-fuzzer 91032 521449 3476 0 3 0x4000082 thrsleep syz-fuzzer 91032 151918 3476 0 3 0x4000082 thrsleep syz-fuzzer 3476 11078 78845 0 3 0x10008a pause ksh 78845 72224 66948 0 3 0x92 select sshd 961 73070 1 0 3 0x100083 ttyin getty 66948 181998 1 0 3 0x80 select sshd 98499 161989 42618 74 3 0x100092 bpf pflogd 42618 287450 1 0 3 0x80 netio pflogd 5575 331383 28794 73 3 0x100090 kqread syslogd 28794 260797 1 0 3 0x100082 netio syslogd 29474 276693 1 77 3 0x100090 poll dhclient 16874 442508 1 0 3 0x80 poll dhclient 55773 80364 0 0 2 0x14200 zerothread 81071 228661 0 0 3 0x14200 aiodoned aiodoned 59728 167051 0 0 3 0x14200 syncer update 21001 195923 0 0 3 0x14200 cleaner cleaner 65519 161427 0 0 3 0x14200 reaper reaper 45238 166862 0 0 3 0x14200 pgdaemon pagedaemon 56928 2700 0 0 3 0x14200 bored crynlk 69145 459287 0 0 3 0x14200 bored crypto 60133 304833 0 0 3 0x40014200 acpi0 acpi0 75387 127671 0 0 3 0x40014200 idle1 14311 80828 0 0 3 0x14200 bored softnet 43163 363383 0 0 3 0x14200 bored systqmp 56824 18519 0 0 3 0x14200 bored systq 42406 417786 0 0 3 0x40014200 bored softclock 26236 429335 0 0 3 0x40014200 idle0 95718 166799 0 0 3 0x14200 bored smr 1 334018 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 41541 (syz-executor.1) thread 0xffff800020ab0780 (6684) 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 (0xffff800000ab3418) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9518 6677K 7764K 78643K 12439 0 0 pcb 14 8K 8K 78643K 170 0 0 rtable 114 4K 4K 78643K 394 0 0 ifaddr 77 15K 15K 78643K 126 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1505 0 0 iov 0 0K 16K 78643K 42 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1234 78K 78K 78643K 1736 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 9 0 0 VM map 11 5K 5K 78643K 13 0 0 sem 12 1K 1K 78643K 54 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 342 0 0 sigio 0 0K 0K 78643K 4 0 0 proc 60 63K 95K 78643K 521 0 0 subproc 32 2K 2K 78643K 51 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 41 0 0 in_multi 58 3K 3K 78643K 92 0 0 ether_multi 1 0K 0K 78643K 7 0 0 mrt 0 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 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 248 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 124 99K 99K 78643K 2191 0 0 UVM aobj 52 2K 2K 78643K 54 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 1 0K 0K 78643K 148 0 0 NDP 11 0K 0K 78643K 28 0 0 temp 124 3550K 3626K 78643K 28015 0 0 kqueue 0 0K 0K 78643K 1 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 17 0 8 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 49 0 47 1 0 1 1 0 8 0 rtentry 112 77 0 30 2 0 2 2 0 8 0 unpcb 120 216 0 204 1 0 1 1 0 8 0 syncache 264 8 0 8 3 3 0 1 0 8 0 tcpqe 32 38 0 38 2 2 0 1 0 8 0 tcpcb 544 221 0 216 1 0 1 1 0 8 0 inpcb 280 1645 0 1598 14 6 8 9 0 8 4 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 7 0 3 1 0 1 1 0 8 0 ppxss 1128 6 0 6 2 1 1 1 0 8 1 pffrag 232 5 0 5 3 2 1 1 0 482 1 pffrnode 88 5 0 5 3 2 1 1 0 8 1 pffrent 40 141 0 141 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 35 0 8 1 0 1 1 0 8 0 pfstkey 112 35 0 8 1 0 1 1 0 8 0 pfstate 328 35 0 8 3 0 3 3 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 323 0 86 15 0 15 15 0 8 0 art_table 32 324 0 86 2 0 2 2 0 8 0 art_node 16 76 0 33 1 0 1 1 0 8 0 sysvmsgpl 40 58 0 34 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 52 0 42 1 0 1 1 0 8 0 shmpl 112 52 0 2 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1917 0 512 46 0 46 46 0 8 0 ffsino 272 1917 0 512 95 1 94 95 0 8 0 nchpl 144 2604 0 998 61 0 61 61 0 8 0 uvmvnodes 72 2394 0 0 44 0 44 44 0 8 0 vnodes 208 2394 0 0 126 0 126 126 0 8 0 namei 1024 7873 0 7873 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 8 0 0 1 0 1 1 0 8 0 vmpool 552 11 0 2 1 0 1 1 0 8 0 scsiplug 64 1 0 1 1 0 1 1 0 8 1 scxspl 192 7528 0 7528 8 7 1 5 0 8 1 plimitpl 152 42 0 34 1 0 1 1 0 8 0 sigapl 432 537 0 521 3 1 2 3 0 8 0 futexpl 56 10796 0 10795 1 0 1 1 0 8 0 knotepl 112 108 0 89 1 0 1 1 0 8 0 kqueuepl 104 89 0 86 1 0 1 1 0 8 0 pipepl 160 328 0 309 2 1 1 2 0 8 0 fdescpl 488 538 0 521 3 0 3 3 0 8 0 filepl 152 5164 0 5012 13 4 9 10 0 8 3 lockfpl 104 105 0 103 1 0 1 1 0 8 0 lockfspl 48 38 0 36 1 0 1 1 0 8 0 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 19 0 8 1 0 1 1 0 8 0 ucredpl 96 488 0 479 1 0 1 1 0 8 0 zombiepl 144 521 0 521 1 0 1 1 0 8 1 processpl 896 554 0 521 4 0 4 4 0 8 0 procpl 632 1339 0 1295 5 0 5 5 0 8 1 srpgc 64 1 0 1 1 0 1 1 0 8 1 sosppl 128 225 0 219 1 0 1 1 0 8 0 sockpl 384 1942 0 1882 24 14 10 14 0 8 4 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 12 0 0 2 0 2 2 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 209 0 0 26 1 25 26 0 8 0 mtagpl 80 33 0 0 1 0 1 1 0 8 0 mbufpl 256 554 0 0 33 0 33 33 0 8 0 bufpl 256 7107 0 1311 363 0 363 363 0 8 0 anonpl 16 80764 0 62917 114 6 108 108 0 124 17 amapchunkpl 152 3547 0 3382 16 4 12 12 0 158 4 amappl16 192 3156 0 1930 79 9 70 74 0 8 8 amappl14 176 59 0 53 1 0 1 1 0 8 0 amappl13 168 153 0 150 1 0 1 1 0 8 0 amappl12 160 7 0 6 1 0 1 1 0 8 0 amappl11 152 195 0 179 1 0 1 1 0 8 0 amappl10 144 15 0 10 1 0 1 1 0 8 0 amappl9 136 614 0 611 1 0 1 1 0 8 0 amappl8 128 184 0 154 2 0 2 2 0 8 0 amappl7 120 44 0 38 1 0 1 1 0 8 0 amappl6 112 201 0 190 1 0 1 1 0 8 0 amappl5 104 150 0 136 1 0 1 1 0 8 0 amappl4 96 806 0 773 1 0 1 1 0 8 0 amappl3 88 122 0 117 1 0 1 1 0 8 0 amappl2 80 3504 0 3422 3 1 2 3 0 8 0 amappl1 72 21670 0 21212 25 14 11 20 0 8 0 amappl 80 1629 0 1576 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 53 0 2 1 0 1 1 0 8 0 uaddrrnd 24 549 0 521 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 549 0 521 1 0 1 1 0 8 0 vmmpekpl 168 8032 0 7994 4 1 3 3 0 8 0 vmmpepl 168 74768 0 72275 175 22 153 153 0 357 44 vmsppl 368 537 0 521 2 0 2 2 0 8 0 pdppl 4096 1105 0 1054 8 1 7 7 0 8 0 pvpl 32 233037 0 211891 256 5 251 251 0 265 45 pmappl 232 548 0 523 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 557 0 6 16 0 16 16 0 8 0