panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 455154 80502 0 0 0 0 syz-executor.1 *218484 80502 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(fffffd806c9d4468,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000af4a00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000af4a00,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000af4a00,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800023b73c10,ffff800020acec78) 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(fffffd806e14b8f0,c5005601,ffff800000b31800,1,fffffd807f7c6960,ffff800020acec78) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8063a98dc0,c5005601,ffff800000b31800,ffff800020acec78) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020acec78,ffff800023ba7c18,ffff800023ba7c60) at sys_ioctl+0x5b9 syscall(ffff800023ba7ce0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023ba7ce0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1783db4fe40, 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(fffffd806c9d4468,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000af4a00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000af4a00,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000af4a00,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800023b73c10,ffff800020acec78) 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(fffffd806e14b8f0,c5005601,ffff800000b31800,1,fffffd807f7c6960,ffff800020acec78) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8063a98dc0,c5005601,ffff800000b31800,ffff800020acec78) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020acec78,ffff800023ba7c18,ffff800023ba7c60) at sys_ioctl+0x5b9 syscall(ffff800023ba7ce0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023ba7ce0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1783db4fe40, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023ba7570 rbx 0xffff800023ba7620 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021b60000 rax 0xffff800000a4b400 r8 0xffffffff8218361f kprintf+0x16f r9 0x1 r10 0x25 r11 0x4ac9f2fc6fd07703 r12 0x3000000008 r13 0xffff800023ba7580 r14 0x100 r15 0x1 rip 0xffffffff8175c768 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023ba7560 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=218484 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ace788,0xffffffff8267ef18 process=0xffff800020adca80 user=0xffff800023ba2000, vmspace=0xfffffd807f008a10 estcpu=36, cpticks=16883, pctcpu=0.0 user=0, sys=16883, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 80502 455154 66407 0 7 0 syz-executor.1 *80502 218484 66407 0 7 0x4000000 syz-executor.1 66407 106498 55899 0 3 0x82 nanosleep syz-executor.1 21609 207399 55899 0 2 0x2 syz-executor.0 48555 184760 0 0 3 0x14200 bored sosplice 55899 404121 68527 0 3 0x82 thrsleep syz-fuzzer 55899 237278 68527 0 3 0x4000082 nanosleep syz-fuzzer 55899 260942 68527 0 3 0x4000082 thrsleep syz-fuzzer 55899 515793 68527 0 3 0x4000082 thrsleep syz-fuzzer 55899 310653 68527 0 3 0x4000082 nanosleep syz-fuzzer 55899 491283 68527 0 2 0x4000002 syz-fuzzer 55899 194807 68527 0 3 0x4000082 thrsleep syz-fuzzer 55899 245669 68527 0 3 0x4000082 thrsleep syz-fuzzer 55899 19011 68527 0 3 0x4000082 thrsleep syz-fuzzer 55899 326197 68527 0 3 0x4000082 thrsleep syz-fuzzer 68527 519533 46987 0 3 0x10008a pause ksh 46987 367239 11287 0 3 0x92 select sshd 25758 255197 1 0 3 0x100083 ttyin getty 11287 205200 1 0 3 0x80 select sshd 59116 224481 5079 74 3 0x100092 bpf pflogd 5079 142316 1 0 3 0x80 netio pflogd 62381 355377 87696 73 3 0x100090 kqread syslogd 87696 365507 1 0 3 0x100082 netio syslogd 5498 464136 1 77 3 0x100090 poll dhclient 78367 513831 1 0 3 0x80 poll dhclient 79221 213428 0 0 2 0x14200 zerothread 12382 312294 0 0 3 0x14200 aiodoned aiodoned 56210 111503 0 0 3 0x14200 syncer update 51008 484315 0 0 3 0x14200 cleaner cleaner 34526 491991 0 0 3 0x14200 reaper reaper 86989 501156 0 0 3 0x14200 pgdaemon pagedaemon 16083 90206 0 0 3 0x14200 bored crynlk 75717 286667 0 0 3 0x14200 bored crypto 57665 376134 0 0 3 0x40014200 acpi0 acpi0 11363 348846 0 0 3 0x40014200 idle1 84900 9235 0 0 3 0x14200 bored softnet 43871 83447 0 0 3 0x14200 bored systqmp 17850 427126 0 0 3 0x14200 bored systq 90608 400212 0 0 3 0x40014200 bored softclock 48948 92231 0 0 3 0x40014200 idle0 68372 391129 0 0 3 0x14200 bored smr 1 190459 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 80502 (syz-executor.1) thread 0xffff800020acec78 (218484) shared rwlock vmmaplk r = 0 (0xfffffd807f008a28) #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 (0xffff800000af4a18) #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 (0xffffffff82649680) #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 9589 6898K 7921K 78643K 16799 0 0 pcb 13 11K 13K 78643K 316 0 0 rtable 120 5K 5K 78643K 1021 0 0 ifaddr 95 18K 18K 78643K 395 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1543 0 0 iov 0 0K 36K 78643K 1166 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1237 78K 78K 78643K 3229 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 17 8K 8K 78643K 22 0 0 sem 12 1K 1K 78643K 327 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 5 13K 25K 78643K 1344 0 0 sigio 0 0K 0K 78643K 37 0 0 proc 62 63K 95K 78643K 929 0 0 subproc 32 2K 2K 78643K 187 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 148 0 0 in_multi 102 5K 5K 78643K 262 0 0 ether_multi 1 0K 0K 78643K 16 0 0 mrt 0 0K 0K 78643K 15 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 78 344K 344K 78643K 78 0 0 exec 0 0K 1K 78643K 435 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 144 149K 149K 78643K 5761 0 0 UVM aobj 130 4K 4K 78643K 135 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 292 0 0 NDP 19 0K 0K 78643K 96 0 0 temp 156 3559K 4198K 78643K 74130 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 33 0 24 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 159 0 157 1 0 1 1 0 8 0 rtentry 112 187 0 140 2 0 2 2 0 8 0 unpcb 120 873 0 862 1 0 1 1 0 8 0 syncache 264 17 0 17 4 4 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 116 0 116 3 3 0 1 0 8 0 tcpcb 544 985 0 980 19 18 1 12 0 8 0 inpcb 280 3970 0 3962 17 14 3 9 0 8 2 rttmr 72 5 0 5 5 5 0 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 3 0 3 1 1 0 1 0 8 0 nd6 48 30 0 26 1 0 1 1 0 8 0 pkpcb 40 14 0 14 4 3 1 1 0 8 1 ppxss 1128 30 0 30 2 1 1 1 0 8 1 pffrag 232 37 0 37 4 3 1 1 0 482 1 pffrnode 88 37 0 37 4 3 1 1 0 8 1 pffrent 40 1094 0 1094 4 3 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 108 0 49 1 0 1 1 0 8 0 pfstkey 112 108 0 49 2 0 2 2 0 8 0 pfstate 328 108 0 49 6 0 6 6 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 979 0 742 22 7 15 16 0 8 0 art_table 32 981 0 742 3 1 2 3 0 8 0 art_node 16 186 0 143 1 0 1 1 0 8 0 sysvmsgpl 40 44 0 26 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 325 0 315 1 0 1 1 0 8 0 shmpl 112 133 0 5 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3391 0 1983 46 0 46 46 0 8 0 ffsino 272 3391 0 1983 95 0 95 95 0 8 0 nchpl 144 5919 0 5445 61 41 20 61 0 8 0 uvmvnodes 72 5153 0 0 94 0 94 94 0 8 0 vnodes 208 5153 0 0 272 0 272 272 0 8 0 namei 1024 20201 0 20201 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 14 0 0 2 0 2 2 0 8 0 vmpool 552 20 0 5 2 0 2 2 0 8 0 scxspl 192 18102 0 18102 16 15 1 7 0 8 1 plimitpl 152 132 0 124 1 0 1 1 0 8 0 sigapl 432 1515 0 1500 3 1 2 3 0 8 0 futexpl 56 37875 0 37875 1 0 1 1 0 8 1 knotepl 112 296 0 277 1 0 1 1 0 8 0 kqueuepl 104 624 0 621 7 6 1 4 0 8 0 pipepl 160 978 0 957 3 1 2 2 0 8 1 fdescpl 488 1516 0 1500 3 0 3 3 0 8 0 filepl 152 15551 0 15446 22 17 5 14 0 8 0 lockfpl 104 411 0 410 1 0 1 1 0 8 0 lockfspl 48 142 0 141 1 0 1 1 0 8 0 sessionpl 112 27 0 16 1 0 1 1 0 8 0 pgrppl 48 45 0 34 1 0 1 1 0 8 0 ucredpl 96 1402 0 1393 1 0 1 1 0 8 0 zombiepl 144 1500 0 1500 1 0 1 1 0 8 1 processpl 896 1532 0 1500 4 0 4 4 0 8 0 procpl 632 4512 0 4470 5 0 5 5 0 8 0 srpgc 64 12 0 12 4 4 0 1 0 8 0 sosppl 128 783 0 783 2 1 1 2 0 8 1 sockpl 384 5078 0 5056 27 22 5 14 0 8 1 mcl64k 65536 19 0 0 3 0 3 3 0 8 0 mcl16k 16384 8 0 0 1 0 1 1 0 8 0 mcl12k 12288 9 0 0 1 0 1 1 0 8 0 mcl9k 9216 6 0 0 1 0 1 1 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 8 0 0 1 0 1 1 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 186 0 0 23 0 23 23 0 8 1 mtagpl 80 14 0 0 1 0 1 1 0 8 0 mbufpl 256 384 0 0 21 0 21 21 0 8 0 bufpl 256 10016 0 2958 442 0 442 442 0 8 0 anonpl 16 193363 0 175512 123 21 102 103 0 124 13 amapchunkpl 152 10827 0 10661 23 12 11 12 0 158 2 amappl16 192 7773 0 6587 90 22 68 72 0 8 8 amappl15 184 8 0 8 1 1 0 1 0 8 0 amappl14 176 762 0 756 1 0 1 1 0 8 0 amappl13 168 9 0 9 2 2 0 1 0 8 0 amappl12 160 131 0 129 2 1 1 1 0 8 0 amappl11 152 220 0 204 1 0 1 1 0 8 0 amappl10 144 189 0 182 1 0 1 1 0 8 0 amappl9 136 814 0 810 1 0 1 1 0 8 0 amappl8 128 399 0 360 2 0 2 2 0 8 0 amappl7 120 252 0 244 1 0 1 1 0 8 0 amappl6 112 198 0 185 1 0 1 1 0 8 0 amappl5 104 333 0 319 1 0 1 1 0 8 0 amappl4 96 1457 0 1421 2 1 1 2 0 8 0 amappl3 88 1149 0 1139 1 0 1 1 0 8 0 amappl2 80 10666 0 10596 3 1 2 3 0 8 0 amappl1 72 44410 0 43975 25 15 10 20 0 8 0 amappl 80 4933 0 4878 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 134 0 5 3 0 3 3 0 8 0 uaddrrnd 24 1536 0 1500 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1536 0 1500 1 0 1 1 0 8 0 vmmpekpl 168 16478 0 16441 2 0 2 2 0 8 0 vmmpepl 168 203168 0 200793 186 34 152 152 0 357 40 vmsppl 368 1515 0 1500 2 0 2 2 0 8 0 pdppl 4096 3079 0 3024 7 0 7 7 0 8 0 pvpl 32 544411 0 523347 279 41 238 243 0 265 38 pmappl 232 1535 0 1505 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 649 0 28 19 1 18 19 0 8 0