panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *123432 91814 0 0 0x4000000 0K syz-executor.1 284169 30893 0 0x2 0x480 1 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(fffffd8065bcfaf8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b36e00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b36e00,0,7,fffffd807f00ab80,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b36e00,0,7,fffffd807f00ab80,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020a88f20,ffff800020abfb40) 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(fffffd806e27c8f0,c5005601,ffff800000aa8000,1,fffffd807f7c6840,ffff800020abfb40) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8062762a28,c5005601,ffff800000aa8000,ffff800020abfb40) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020abfb40,ffff800022b9af18,ffff800022b9af60) at sys_ioctl+0x5b9 syscall(ffff800022b9afe0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022b9afe0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,929aab4f010) at Xsyscall+0x128 end of kernel end trace frame: 0x92bacde0c60, 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(fffffd8065bcfaf8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b36e00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b36e00,0,7,fffffd807f00ab80,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b36e00,0,7,fffffd807f00ab80,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020a88f20,ffff800020abfb40) 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(fffffd806e27c8f0,c5005601,ffff800000aa8000,1,fffffd807f7c6840,ffff800020abfb40) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8062762a28,c5005601,ffff800000aa8000,ffff800020abfb40) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020abfb40,ffff800022b9af18,ffff800022b9af60) at sys_ioctl+0x5b9 syscall(ffff800022b9afe0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022b9afe0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,929aab4f010) at Xsyscall+0x128 end of kernel end trace frame: 0x92bacde0c60, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800022b9a870 rbx 0xffff800022b9a920 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800022d7e000 rax 0xffff800000a9b5c0 r8 0xffffffff820e3bef kprintf+0x16f r9 0x1 r10 0x25 r11 0x6f84a86f9e3e268e r12 0x3000000008 r13 0xffff800022b9a880 r14 0x100 r15 0x1 rip 0xffffffff820639f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022b9a860 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=123432 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020abf3d8,0xffff800020abf170 process=0xffff800020a8ae10 user=0xffff800022b96000, vmspace=0xfffffd807f00ab80 estcpu=36, cpticks=33, pctcpu=20.28 user=0, sys=17020, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 91814 77473 30893 0 2 0 syz-executor.1 *91814 123432 30893 0 7 0x4000000 syz-executor.1 91814 229240 30893 0 2 0x4000000 syz-executor.1 12889 110047 61418 0 2 0 syz-executor.0 12889 68615 61418 0 3 0x4000080 piperd syz-executor.0 12889 252443 61418 0 2 0x4000000 syz-executor.0 12889 178679 61418 0 2 0x4000080 syz-executor.0 61418 344711 90785 0 2 0x482 syz-executor.0 30893 284169 90785 0 7 0x482 syz-executor.1 54380 405047 0 0 2 0x14600 acct 98736 284301 1 0 3 0x100083 ttyin getty 15477 287670 0 0 3 0x14200 bored sosplice 90785 339792 27944 0 2 0x482 syz-fuzzer 90785 43066 27944 0 2 0x4000482 syz-fuzzer 90785 193910 27944 0 3 0x4000082 thrsleep syz-fuzzer 90785 374488 27944 0 3 0x4000082 kqread syz-fuzzer 90785 184857 27944 0 3 0x4000082 thrsleep syz-fuzzer 90785 428891 27944 0 3 0x4000082 thrsleep syz-fuzzer 90785 404811 27944 0 3 0x4000082 thrsleep syz-fuzzer 90785 347648 27944 0 2 0x4000482 syz-fuzzer 90785 183904 27944 0 3 0x4000082 thrsleep syz-fuzzer 90785 425356 27944 0 3 0x4000082 thrsleep syz-fuzzer 27944 147526 88094 0 3 0x10008a pause ksh 88094 496771 81887 0 3 0x92 select sshd 81887 366938 1 0 3 0x80 select sshd 41679 128232 64626 74 2 0x100492 pflogd 64626 119646 1 0 3 0x80 netio pflogd 9604 353216 17059 73 2 0x100490 syslogd 17059 196451 1 0 3 0x100082 netio syslogd 13639 13508 1 77 3 0x100090 poll dhclient 99812 264327 1 0 3 0x80 poll dhclient 30601 503199 0 0 2 0x14200 zerothread 97302 147974 0 0 3 0x14200 aiodoned aiodoned 74763 31202 0 0 2 0x14200 update 13628 211163 0 0 3 0x14200 cleaner cleaner 52465 307892 0 0 3 0x14200 reaper reaper 15758 477365 0 0 3 0x14200 pgdaemon pagedaemon 13808 346189 0 0 3 0x14200 bored crynlk 66549 75918 0 0 3 0x14200 bored crypto 35558 212001 0 0 3 0x40014200 acpi0 acpi0 45787 14544 0 0 3 0x40014200 idle1 79198 3026 0 0 2 0x14200 softnet 86102 512234 0 0 2 0x14200 systqmp 77968 102604 0 0 3 0x14200 bored systq 18108 214297 0 0 2 0x40014200 softclock 80282 159584 0 0 3 0x40014200 idle0 82749 435274 0 0 3 0x14200 bored smr 1 271306 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 91814 (syz-executor.1) thread 0xffff800020abfb40 (123432) shared rwlock vmmaplk r = 0 (0xfffffd807f00ab98) #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 (0xffff800000b36e18) #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 (0xffff80000066e478) #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 (0xffffffff82624628) #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 Process 12889 (syz-executor.0) thread 0xffff800020abf160 (252443) exclusive rrwlock inode r = 0 (0xfffffd8073a5c2c8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x447 sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0xf0 sys/kern/vfs_vops.c:615 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:571 #5 vn_write+0x11b sys/kern/vfs_vnops.c:411 #6 dofilewritev+0x1b7 sys/kern/sys_generic.c:364 #7 sys_pwritev+0xb8 sys/kern/vfs_syscalls.c:3269 #8 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] #8 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 #9 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9572 6447K 9019K 78643K 28506 0 0 pcb 13 10K 12K 78643K 862 0 0 rtable 87 12K 13K 78643K 3074 0 0 ifaddr 218 27K 28K 78643K 728 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1648 0 0 iov 1 12K 48K 78643K 832 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1236 78K 78K 78643K 7099 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 58 0 0 VM map 26 13K 13K 78643K 43 0 0 sem 12 0K 1K 78643K 1066 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 3584 0 0 sigio 0 0K 0K 78643K 71 0 0 proc 61 63K 95K 78643K 1733 0 0 subproc 32 2K 2K 78643K 408 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 558 0 0 in_multi 12 0K 2K 78643K 482 0 0 ether_multi 1 0K 0K 78643K 58 0 0 mrt 1 0K 0K 78643K 49 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 90 397K 397K 78643K 90 0 0 exec 0 0K 1K 78643K 832 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 183 242K 242K 78643K 13759 0 0 UVM aobj 130 8K 8K 78643K 151 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 729 0 0 NDP 21 0K 0K 78643K 182 0 0 temp 173 3556K 4196K 78643K 133700 0 0 kqueue 0 0K 0K 78643K 28 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 242 0 239 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 315 0 313 1 0 1 1 0 8 0 rtentry 112 837 0 810 2 0 2 2 0 8 0 unpcb 120 3592 0 3577 10 8 2 2 0 8 1 syncache 264 12 0 12 7 6 1 1 0 8 1 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 66 0 66 6 5 1 1 0 8 1 tcpcb 544 1671 0 1666 18 17 1 11 0 8 0 ipq 40 1 0 1 1 1 0 1 0 8 0 ipqe 40 2 0 2 1 1 0 1 0 8 0 inpcb 280 10189 0 10181 28 24 4 9 0 8 3 rttmr 72 18 0 18 7 7 0 1 0 8 0 ip6q 72 2 0 2 2 2 0 1 0 8 0 ip6af 40 4 0 4 2 2 0 1 0 8 0 nd6 48 46 0 46 4 3 1 1 0 8 1 pkpcb 40 27 0 27 7 6 1 1 0 8 1 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 71 0 71 10 9 1 1 0 8 1 pffrag 232 121 0 121 13 12 1 1 0 482 1 pffrnode 88 121 0 121 13 12 1 1 0 8 1 pffrent 40 3685 0 3685 13 12 1 1 0 8 1 pfosfp 40 846 0 846 5 5 0 5 0 8 0 pfosfpen 112 1428 0 1428 21 21 0 21 0 8 0 pfstitem 24 353 0 286 1 0 1 1 0 8 0 pfstkey 112 354 0 287 3 0 3 3 0 8 0 pfstate 328 354 0 287 9 2 7 8 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 11 0 9 8 5 3 3 0 8 1 art_heap4 256 2745 0 2610 33 22 11 16 0 8 1 art_table 32 2756 0 2619 2 0 2 2 0 8 0 art_node 16 824 0 799 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 8 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 1064 0 1054 1 0 1 1 0 8 0 shmpl 112 149 0 21 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 6734 0 5311 47 0 47 47 0 8 0 ffsino 272 6734 0 5311 96 0 96 96 0 8 0 nchpl 144 12090 0 11601 61 41 20 61 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 208 5926 0 0 312 0 312 312 0 8 0 namei 1024 45107 0 45107 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 23 0 0 3 0 3 3 0 8 0 vmpool 552 41 0 17 2 0 2 2 0 8 0 scsiplug 64 3 0 3 2 2 0 1 0 8 0 scxspl 192 43128 0 43128 27 26 1 7 0 8 1 plimitpl 152 298 0 290 1 0 1 1 0 8 0 sigapl 432 3719 0 3703 3 1 2 3 0 8 0 futexpl 56 106394 0 106394 2 1 1 1 0 8 1 knotepl 112 929 0 910 6 5 1 3 0 8 0 kqueuepl 104 1236 0 1234 5 4 1 4 0 8 0 pipepl 160 11656 0 11635 20 18 2 4 0 8 1 fdescpl 488 3720 0 3703 3 0 3 3 0 8 0 filepl 152 47552 0 47446 45 38 7 14 0 8 2 lockfpl 104 1446 0 1444 1 0 1 1 0 8 0 lockfspl 48 446 0 444 1 0 1 1 0 8 0 sessionpl 112 43 0 32 1 0 1 1 0 8 0 pgrppl 48 398 0 387 1 0 1 1 0 8 0 ucredpl 96 3696 0 3687 1 0 1 1 0 8 0 zombiepl 144 3705 0 3705 1 0 1 1 0 8 1 processpl 896 3739 0 3705 4 0 4 4 0 8 0 procpl 632 11783 0 11735 6 1 5 5 0 8 0 srpgc 64 46 0 46 15 14 1 1 0 8 1 sosppl 128 79 0 79 13 12 1 1 0 8 1 sockpl 384 14342 0 14317 48 41 7 14 0 8 3 mcl64k 65536 485 0 0 59 28 31 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 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 10 0 0 1 0 1 1 0 8 0 mcl2k 2048 184 0 0 22 4 18 22 0 8 0 mtagpl 80 345 0 0 4 0 4 4 0 8 0 mbufpl 256 786 0 0 36 0 36 36 0 8 0 bufpl 256 16679 0 9621 442 0 442 442 0 8 0 anonpl 16 469233 0 450471 212 109 103 103 0 124 15 amapchunkpl 152 27119 0 26956 59 48 11 20 0 158 3 amappl16 192 20697 0 19496 186 118 68 77 0 8 7 amappl15 184 127 0 126 3 2 1 1 0 8 0 amappl14 176 718 0 712 1 0 1 1 0 8 0 amappl13 168 218 0 218 2 2 0 1 0 8 0 amappl12 160 985 0 982 1 0 1 1 0 8 0 amappl11 152 760 0 745 1 0 1 1 0 8 0 amappl10 144 137 0 128 1 0 1 1 0 8 0 amappl9 136 1504 0 1501 1 0 1 1 0 8 0 amappl8 128 1099 0 1047 2 0 2 2 0 8 0 amappl7 120 237 0 224 1 0 1 1 0 8 0 amappl6 112 680 0 665 1 0 1 1 0 8 0 amappl5 104 1301 0 1285 1 0 1 1 0 8 0 amappl4 96 4070 0 4037 1 0 1 1 0 8 0 amappl3 88 705 0 699 1 0 1 1 0 8 0 amappl2 80 27551 0 27458 3 1 2 3 0 8 0 amappl1 72 93723 0 93257 25 15 10 20 0 8 0 amappl 80 12460 0 12395 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 17 0 17 1 1 0 1 0 8 0 aobjpl 64 150 0 21 3 0 3 3 0 8 0 uaddrrnd 24 3761 0 3703 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3761 0 3703 1 0 1 1 0 8 0 vmmpekpl 168 51493 0 51446 3 0 3 3 0 8 0 vmmpepl 168 490680 0 488093 295 136 159 159 0 357 44 vmsppl 368 3719 0 3703 2 0 2 2 0 8 0 pdppl 4096 7529 0 7463 10 1 9 9 0 8 0 pvpl 32 1262723 0 1241613 367 137 230 230 0 265 32 pmappl 232 3760 0 3720 5 2 3 3 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 743 0 82 19 0 19 19 0 8 0