panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *215825 15305 0 0 0x4000000 0K syz-executor.1 520598 56797 0 0x2 0x480 1 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(fffffd80652aee18,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000cb3000,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000cb3000,0,7,fffffd807f007450,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000cb3000,0,7,fffffd807f007450,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800021b648d0,ffff800020ab1160) 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(fffffd8070917a90,c5005601,ffff800000bb5800,1,fffffd807f7c6900,ffff800020ab1160) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd805f2c3260,c5005601,ffff800000bb5800,ffff800020ab1160) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab1160,ffff800021b5f6a8,ffff800021b5f6f0) at sys_ioctl+0x5b9 syscall(ffff800021b5f770) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b5f770) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xedd51e49b10, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic amap_pp_adjref: negative reference count ddb{0}> 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(fffffd80652aee18,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000cb3000,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000cb3000,0,7,fffffd807f007450,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000cb3000,0,7,fffffd807f007450,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800021b648d0,ffff800020ab1160) 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(fffffd8070917a90,c5005601,ffff800000bb5800,1,fffffd807f7c6900,ffff800020ab1160) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd805f2c3260,c5005601,ffff800000bb5800,ffff800020ab1160) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab1160,ffff800021b5f6a8,ffff800021b5f6f0) at sys_ioctl+0x5b9 syscall(ffff800021b5f770) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021b5f770) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xedd51e49b10, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021b5f000 rbx 0xffff800021b5f0b0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020f4c000 rax 0xffff800000b5e7c0 r8 0xffffffff820f047f kprintf+0x16f r9 0x1 r10 0x25 r11 0x80be3ee241b215a6 r12 0x3000000008 r13 0xffff800021b5f010 r14 0x100 r15 0x1 rip 0xffffffff812479b8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021b5eff0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=215825 stat=onproc flags process=0 proc=4000000 pri=84, usrpri=84, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab18c8,0xffff800020ab13e8 process=0xffff800020add880 user=0xffff800021b5a000, vmspace=0xfffffd807f007450 estcpu=34, cpticks=2, pctcpu=20.28 user=0, sys=18683, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 15305 502906 7659 0 2 0 syz-executor.1 *15305 215825 7659 0 7 0x4000000 syz-executor.1 57161 354941 56797 0 2 0x10 syz-executor.0 57161 52932 56797 0 3 0x4000090 fsleep syz-executor.0 57161 178694 56797 0 3 0x4000090 fsleep syz-executor.0 57161 273000 56797 0 3 0x4000090 fsleep syz-executor.0 57161 197806 56797 0 2 0x4000010 syz-executor.0 56797 520598 57851 0 7 0x482 syz-executor.0 7659 128887 57851 0 2 0x482 syz-executor.1 61608 420929 1 0 3 0x100083 ttyin getty 88750 343537 0 0 3 0x14200 bored sosplice 57851 343085 98632 0 2 0x482 syz-fuzzer 57851 502209 98632 0 2 0x4000482 syz-fuzzer 57851 185833 98632 0 3 0x4000082 thrsleep syz-fuzzer 57851 153690 98632 0 3 0x4000082 thrsleep syz-fuzzer 57851 172669 98632 0 2 0x4000482 syz-fuzzer 57851 334098 98632 0 3 0x4000082 thrsleep syz-fuzzer 57851 236067 98632 0 3 0x4000082 thrsleep syz-fuzzer 57851 510938 98632 0 3 0x4000082 thrsleep syz-fuzzer 57851 195296 98632 0 3 0x4000082 thrsleep syz-fuzzer 57851 15740 98632 0 3 0x4000082 kqread syz-fuzzer 98632 372163 63957 0 3 0x10008a pause ksh 63957 437906 59162 0 3 0x92 select sshd 59162 424124 1 0 3 0x80 select sshd 78932 185747 7400 74 2 0x100492 pflogd 7400 316913 1 0 3 0x80 netio pflogd 61158 523133 63627 73 2 0x100490 syslogd 63627 49960 1 0 3 0x100082 netio syslogd 36465 394513 1 77 3 0x100090 poll dhclient 4104 371483 1 0 3 0x80 poll dhclient 32416 167116 0 0 2 0x14200 zerothread 62387 45523 0 0 3 0x14200 aiodoned aiodoned 42048 139890 0 0 2 0x14200 update 90930 351493 0 0 3 0x14200 cleaner cleaner 54566 241910 0 0 3 0x14200 reaper reaper 24670 439727 0 0 3 0x14200 pgdaemon pagedaemon 34650 104842 0 0 3 0x14200 bored crynlk 94646 44613 0 0 3 0x14200 bored crypto 37097 508588 0 0 3 0x40014200 acpi0 acpi0 37897 209492 0 0 3 0x40014200 idle1 2594 172310 0 0 2 0x14200 softnet 80666 276923 0 0 2 0x14200 systqmp 80564 174700 0 0 3 0x14200 bored systq 30208 101082 0 0 2 0x40014200 softclock 9996 379163 0 0 3 0x40014200 idle0 28194 314008 0 0 2 0x14200 smr 1 298560 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 15305 (syz-executor.1) thread 0xffff800020ab1160 (215825) shared rwlock vmmaplk r = 0 (0xfffffd807f007468) #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 (0xffff800000cb3018) #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 (0xffffffff82634088) #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9658 6950K 8705K 78643K 34944 0 0 pcb 13 11K 13K 78643K 2068 0 0 rtable 127 13K 14K 78643K 5339 0 0 ifaddr 437 48K 49K 78643K 1779 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1921 0 0 iov 0 0K 48K 78643K 1856 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1229 77K 77K 78643K 9890 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 137 0 0 VM map 68 34K 34K 78643K 104 0 0 sem 12 0K 0K 78643K 4865 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 8312 0 0 sigio 0 0K 2K 78643K 6160 0 0 proc 62 63K 95K 78643K 3594 0 0 subproc 32 2K 2K 78643K 938 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 1044 0 0 in_multi 201 12K 12K 78643K 1259 0 0 ether_multi 1 0K 0K 78643K 113 0 0 mrt 4 0K 0K 78643K 64 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 114 503K 503K 78643K 114 0 0 exec 0 0K 1K 78643K 1719 0 0 pfkey data 0 0K 4K 78643K 2 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 267 528K 528K 78643K 31073 0 0 UVM aobj 130 8K 8K 78643K 136 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 1915 0 0 NDP 25 0K 1K 78643K 465 0 0 temp 190 3556K 4196K 78643K 263947 0 0 kqueue 0 0K 0K 78643K 105 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 221 0 215 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 850 0 848 1 0 1 1 0 8 0 rtentry 112 980 0 934 2 0 2 2 0 8 0 unpcb 120 8369 0 8345 13 11 2 2 0 8 1 syncache 264 57 0 57 21 21 0 1 0 8 0 tcpqe 32 201 0 201 14 14 0 1 0 8 0 tcpcb 544 4010 0 4006 39 33 6 15 0 8 5 inpcb 280 19245 0 19237 58 52 6 10 0 8 5 rttmr 72 15 0 15 12 12 0 1 0 8 0 ip6q 72 2 0 2 1 1 0 1 0 8 0 ip6af 40 6 0 6 1 1 0 1 0 8 0 nd6 48 141 0 137 5 4 1 1 0 8 0 pkpcb 40 26 0 26 14 14 0 1 0 8 0 swfcl 56 4 0 0 1 0 1 1 0 8 0 ppxss 1128 181 0 181 26 25 1 1 0 8 1 pffrag 232 246 0 245 26 25 1 1 0 482 0 pffrnode 88 246 0 245 26 25 1 1 0 8 0 pffrent 40 8098 0 8097 26 25 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 733 0 655 1 0 1 1 0 8 0 pfstkey 112 733 0 655 3 0 3 3 0 8 0 pfstate 328 733 0 654 12 4 8 8 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 14 0 13 9 8 1 3 0 8 0 art_heap4 256 4259 0 4008 52 36 16 17 0 8 0 art_table 32 4273 0 4021 5 2 3 3 0 8 0 art_node 16 979 0 937 1 0 1 1 0 8 0 sysvmsgpl 40 42 0 29 1 0 1 1 0 8 0 semupl 112 4 0 4 3 3 0 1 0 8 0 semapl 112 4863 0 4853 1 0 1 1 0 8 0 shmpl 112 134 0 6 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 14922 0 13471 47 0 47 47 0 8 0 ffsino 272 14922 0 13471 98 0 98 98 0 8 0 nchpl 144 29338 0 28824 62 42 20 61 0 8 0 uvmvnodes 72 7705 0 0 141 0 141 141 0 8 0 vnodes 208 7705 0 0 406 0 406 406 0 8 0 namei 1024 116102 0 116102 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 65 0 0 9 0 9 9 0 8 0 vmpool 552 102 0 36 7 2 5 5 0 8 0 scsiplug 64 5 0 5 4 4 0 1 0 8 0 scxspl 192 94331 0 94331 63 60 3 5 0 8 3 plimitpl 152 718 0 710 1 0 1 1 0 8 0 sigapl 432 8352 0 8336 5 3 2 3 0 8 0 futexpl 56 279098 0 279095 2 1 1 1 0 8 0 knotepl 112 1793 0 1774 8 7 1 3 0 8 0 kqueuepl 104 2413 0 2410 8 7 1 4 0 8 0 pipepl 160 19410 0 19391 33 31 2 5 0 8 1 fdescpl 488 8353 0 8336 3 0 3 3 0 8 0 filepl 152 109099 0 108984 97 88 9 14 0 8 4 lockfpl 104 3702 0 3701 1 0 1 1 0 8 0 lockfspl 48 1094 0 1093 1 0 1 1 0 8 0 sessionpl 112 72 0 61 1 0 1 1 0 8 0 pgrppl 48 139 0 128 1 0 1 1 0 8 0 ucredpl 96 12574 0 12561 5 4 1 2 0 8 0 zombiepl 144 8339 0 8339 1 0 1 1 0 8 1 processpl 896 8372 0 8339 6 2 4 5 0 8 0 procpl 632 27193 0 27146 9 4 5 5 0 8 0 srpgc 64 80 0 80 25 25 0 1 0 8 0 sosppl 128 277 0 277 31 30 1 1 0 8 1 sockpl 384 28902 0 28867 101 92 9 17 0 8 5 mcl64k 65536 535 0 0 65 44 21 34 0 8 1 mcl16k 16384 35 0 0 5 3 2 3 0 8 0 mcl12k 12288 33 0 0 3 1 2 2 0 8 0 mcl9k 9216 41 0 0 2 0 2 2 0 8 0 mcl8k 8192 33 0 0 5 2 3 3 0 8 0 mcl4k 4096 28 0 0 3 1 2 3 0 8 0 mcl2k2 2112 14 0 0 1 0 1 1 0 8 0 mcl2k 2048 250 0 0 20 8 12 20 0 8 1 mtagpl 80 368 0 0 2 0 2 2 0 8 0 mbufpl 256 1309 0 0 48 0 48 48 0 8 0 bufpl 256 39250 0 31237 501 0 501 501 0 8 0 anonpl 16 1099447 0 1074718 312 204 108 117 0 124 2 amapchunkpl 152 68519 0 68315 166 154 12 22 0 158 3 amappl16 192 47285 0 45855 320 247 73 84 0 8 1 amappl15 184 233 0 232 1 0 1 1 0 8 0 amappl14 176 2575 0 2568 1 0 1 1 0 8 0 amappl13 168 791 0 791 9 9 0 1 0 8 0 amappl12 160 1161 0 1156 1 0 1 1 0 8 0 amappl11 152 634 0 619 1 0 1 1 0 8 0 amappl10 144 1173 0 1166 1 0 1 1 0 8 0 amappl9 136 1750 0 1746 1 0 1 1 0 8 0 amappl8 128 1461 0 1374 5 1 4 4 0 8 0 amappl7 120 1365 0 1354 1 0 1 1 0 8 0 amappl6 112 514 0 500 1 0 1 1 0 8 0 amappl5 104 1843 0 1828 1 0 1 1 0 8 0 amappl4 96 7873 0 7830 2 0 2 2 0 8 0 amappl3 88 3359 0 3350 1 0 1 1 0 8 0 amappl2 80 63403 0 63312 3 1 2 3 0 8 0 amappl1 72 199066 0 198603 27 17 10 20 0 8 0 amappl 80 28615 0 28525 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 135 0 6 3 0 3 3 0 8 0 uaddrrnd 24 8455 0 8336 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 8455 0 8336 1 0 1 1 0 8 0 vmmpekpl 168 95145 0 95091 3 0 3 3 0 8 0 vmmpepl 168 1091442 0 1088466 496 320 176 178 0 357 44 vmsppl 368 8352 0 8336 2 0 2 2 0 8 0 pdppl 4096 16917 0 16809 16 2 14 14 0 8 0 pvpl 32 2825424 0 2800270 599 370 229 247 0 265 19 pmappl 232 8454 0 8372 6 1 5 5 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 871 0 140 22 0 22 22 0 8 0