panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 252507 88466 0 0 0 0 syz-executor.0 * 8748 88466 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(fffffd80555a3bf8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000c22600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000c22600,0,7,fffffd807f00b450,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000c22600,0,7,fffffd807f00b450,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff8000221c6920,ffff800020ab18c8) 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(fffffd806e15b680,c5005601,ffff800000ce0800,1,fffffd807f7c6ae0,ffff800020ab18c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8061065a20,c5005601,ffff800000ce0800,ffff800020ab18c8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab18c8,ffff8000221f9e28,ffff8000221f9e70) at sys_ioctl+0x5b9 syscall(ffff8000221f9ef0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff8000221f9ef0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,3aa976b8010) at Xsyscall+0x128 end of kernel end trace frame: 0x3acde21b710, 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(fffffd80555a3bf8,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000c22600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000c22600,0,7,fffffd807f00b450,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000c22600,0,7,fffffd807f00b450,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff8000221c6920,ffff800020ab18c8) 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(fffffd806e15b680,c5005601,ffff800000ce0800,1,fffffd807f7c6ae0,ffff800020ab18c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8061065a20,c5005601,ffff800000ce0800,ffff800020ab18c8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab18c8,ffff8000221f9e28,ffff8000221f9e70) at sys_ioctl+0x5b9 syscall(ffff8000221f9ef0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff8000221f9ef0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,3aa976b8010) at Xsyscall+0x128 end of kernel end trace frame: 0x3acde21b710, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff8000221f9780 rbx 0xffff8000221f9830 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021f82000 rax 0xffff800000cdf0c0 r8 0xffffffff816ebd8f kprintf+0x16f r9 0x1 r10 0x25 r11 0x3b33cebda8b9a31a r12 0x3000000008 r13 0xffff8000221f9790 r14 0x100 r15 0x1 rip 0xffffffff811a5758 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000221f9770 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=8748 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab1650,0xffffffff8265cd40 process=0xffff800020adca80 user=0xffff8000221f4000, vmspace=0xfffffd807f00b450 estcpu=36, cpticks=17303, pctcpu=0.0 user=0, sys=17303, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 88466 252507 29217 0 7 0 syz-executor.0 *88466 8748 29217 0 7 0x4000000 syz-executor.0 29217 206130 79027 0 3 0x82 nanosleep syz-executor.0 92064 183949 79027 0 3 0x82 nanosleep syz-executor.1 44399 464834 0 0 3 0x14200 acct acct 15798 66365 1 0 3 0x100083 ttyin getty 66071 116129 0 0 3 0x14200 bored sosplice 79027 360708 53735 0 3 0x82 thrsleep syz-fuzzer 79027 454382 53735 0 3 0x4000082 nanosleep syz-fuzzer 79027 9984 53735 0 3 0x4000082 thrsleep syz-fuzzer 79027 7535 53735 0 3 0x4000082 thrsleep syz-fuzzer 79027 5547 53735 0 3 0x4000082 thrsleep syz-fuzzer 79027 401750 53735 0 3 0x4000082 thrsleep syz-fuzzer 79027 488466 53735 0 3 0x4000082 thrsleep syz-fuzzer 79027 182575 53735 0 3 0x4000082 thrsleep syz-fuzzer 79027 5662 53735 0 3 0x4000082 kqread syz-fuzzer 79027 405354 53735 0 3 0x4000082 thrsleep syz-fuzzer 53735 337850 45302 0 3 0x10008a pause ksh 45302 316043 20644 0 3 0x92 select sshd 20644 103767 1 0 3 0x80 select sshd 46831 258851 21765 74 3 0x100092 bpf pflogd 21765 165002 1 0 3 0x80 netio pflogd 51461 474279 80323 73 3 0x100090 kqread syslogd 80323 301359 1 0 3 0x100082 netio syslogd 95524 73297 0 0 3 0x14200 pgzero zerothread 44449 348867 0 0 3 0x14200 aiodoned aiodoned 12959 442542 0 0 3 0x14200 syncer update 97982 173274 0 0 3 0x14200 cleaner cleaner 5554 383617 0 0 3 0x14200 reaper reaper 24314 109305 0 0 3 0x14200 pgdaemon pagedaemon 83611 182658 0 0 3 0x14200 bored crynlk 96450 390448 0 0 3 0x14200 bored crypto 49710 431684 0 0 3 0x40014200 acpi0 acpi0 3393 239949 0 0 3 0x40014200 idle1 35307 473292 0 0 3 0x14200 bored softnet 89307 361258 0 0 3 0x14200 bored systqmp 74919 319706 0 0 3 0x14200 bored systq 152 98683 0 0 3 0x40014200 bored softclock 30211 385358 0 0 3 0x40014200 idle0 82070 335303 0 0 3 0x14200 bored smr 1 21003 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 88466 (syz-executor.0) thread 0xffff800020ab18c8 (8748) shared rwlock vmmaplk r = 0 (0xfffffd807f00b468) #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 (0xffff800000c22618) #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 (0xffffffff82667590) #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 9636 6551K 9774K 78643K 152059 0 0 pcb 13 12K 14K 78643K 6243 0 0 rtable 134 14K 15K 78643K 8911 0 0 ifaddr 1162 108K 120K 78643K 5396 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 3030 0 0 iov 0 0K 72K 78643K 5536 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1229 77K 78K 78643K 43248 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 442 0 0 VM map 208 104K 104K 78643K 357 0 0 sem 12 1K 1K 78643K 5682 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 25956 0 0 sigio 0 0K 0K 78643K 379 0 0 proc 57 51K 95K 78643K 9871 0 0 subproc 32 2K 2K 78643K 2819 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 3302 0 0 in_multi 29 1K 2K 78643K 3147 0 0 ether_multi 1 0K 0K 78643K 323 0 0 mrt 4 0K 0K 78643K 159 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 120 530K 530K 78643K 120 0 0 exec 0 0K 1K 78643K 4934 0 0 pfkey data 0 0K 4K 78643K 3 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 474 1572K 1572K 78643K 95339 0 0 UVM aobj 130 4K 4K 78643K 133 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 2K 78643K 6373 0 0 NDP 30 1K 1K 78643K 1385 0 0 temp 205 3557K 4199K 78643K 734694 0 0 kqueue 0 0K 0K 78643K 227 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 700 0 694 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 2465 0 2465 26 25 1 1 0 8 1 rtentry 112 2862 0 2815 2 0 2 2 0 8 0 unpcb 120 16524 0 16500 39 37 2 2 0 8 1 syncache 264 150 0 150 65 65 0 1 0 8 0 tcpqe 32 55 0 55 34 34 0 1 0 8 0 tcpcb 544 13115 0 13109 145 144 1 14 0 8 0 ipq 40 6 0 6 4 4 0 1 0 8 0 ipqe 40 12 0 12 4 4 0 1 0 8 0 inpcb 280 104668 0 104664 371 367 4 14 0 8 3 rttmr 72 46 0 45 20 19 1 1 0 8 0 ip6q 72 12 0 12 10 10 0 1 0 8 0 ip6af 40 33 0 33 10 10 0 1 0 8 0 nd6 48 358 0 355 19 18 1 1 0 8 0 pkpcb 40 256 0 256 52 52 0 1 0 8 0 swfcl 56 12 0 0 1 0 1 1 0 8 0 ppxss 1128 661 0 661 68 67 1 1 0 8 1 pffrag 232 779 0 779 58 57 1 1 0 482 1 pffrnode 88 778 0 778 58 57 1 1 0 8 1 pffrent 40 26578 0 26578 56 55 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 2156 0 2079 1 0 1 1 0 8 0 pfstkey 112 2156 0 2079 7 4 3 4 0 8 0 pfstate 328 2156 0 2079 26 18 8 9 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 72 0 71 43 42 1 4 0 8 0 art_heap4 256 10889 0 10578 140 118 22 22 0 8 1 art_table 32 10961 0 10649 11 8 3 3 0 8 0 art_node 16 2859 0 2815 1 0 1 1 0 8 0 sysvmsgpl 40 22 0 17 1 0 1 1 0 8 0 semupl 112 3 0 3 2 2 0 1 0 8 0 semapl 112 5680 0 5670 1 0 1 1 0 8 0 shmpl 112 131 0 3 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 40975 0 39426 54 3 51 51 0 8 0 ffsino 272 40975 0 39426 106 2 104 104 0 8 0 nchpl 144 79205 0 78726 64 44 20 61 0 8 0 uvmvnodes 72 9885 0 0 180 0 180 180 0 8 0 vnodes 208 9885 0 0 521 0 521 521 0 8 0 namei 1024 305093 0 305093 7 6 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 206 0 1 26 0 26 26 0 8 0 vmpool 552 355 0 149 17 2 15 15 0 8 0 scsiplug 64 29 0 29 24 24 0 1 0 8 0 scxspl 192 259645 0 259645 165 162 3 7 0 8 3 plimitpl 152 2204 0 2197 1 0 1 1 0 8 0 sigapl 432 25667 0 25654 3 1 2 3 0 8 0 futexpl 56 788171 0 788171 4 3 1 1 0 8 1 knotepl 112 5601 0 5582 13 12 1 3 0 8 0 kqueuepl 104 7892 0 7889 28 27 1 4 0 8 0 pipepl 160 16852 0 16833 55 53 2 3 0 8 1 fdescpl 488 25668 0 25654 3 0 3 3 0 8 0 filepl 152 292646 0 292552 257 250 7 14 0 8 3 lockfpl 104 10633 0 10633 10 9 1 1 0 8 1 lockfspl 48 3297 0 3297 10 9 1 1 0 8 1 sessionpl 112 183 0 174 1 0 1 1 0 8 0 pgrppl 48 586 0 577 1 0 1 1 0 8 0 ucredpl 96 28949 0 28936 1 0 1 1 0 8 0 zombiepl 144 25679 0 25678 5 4 1 1 0 8 0 processpl 896 25710 0 25678 4 0 4 4 0 8 0 procpl 632 85450 0 85408 67 62 5 5 0 8 1 srpgc 64 290 0 290 86 86 0 1 0 8 0 sosppl 128 17179 0 17179 90 89 1 4 0 8 1 sockpl 384 125491 0 125459 515 506 9 22 0 8 4 mcl64k 65536 2089 0 0 198 161 37 66 0 8 1 mcl16k 16384 98 0 0 8 5 3 3 0 8 0 mcl12k 12288 73 0 0 2 0 2 2 0 8 0 mcl9k 9216 56 0 0 2 0 2 2 0 8 0 mcl8k 8192 81 0 0 6 3 3 3 0 8 0 mcl4k 4096 36 0 0 4 1 3 3 0 8 0 mcl2k2 2112 22 0 0 2 0 2 2 0 8 0 mcl2k 2048 341 0 0 19 12 7 19 0 8 0 mtagpl 80 427 0 0 2 1 1 2 0 8 0 mbufpl 256 2366 0 0 65 19 46 65 0 8 0 bufpl 256 100373 0 90488 618 0 618 618 0 8 0 anonpl 16 3315153 0 3238243 986 660 326 326 0 124 16 amapchunkpl 152 206280 0 203137 492 366 126 126 0 158 4 amappl16 192 142735 0 140915 775 671 104 104 0 8 12 amappl15 184 4364 0 4364 13 13 0 1 0 8 0 amappl14 176 4875 0 4870 1 0 1 1 0 8 0 amappl13 168 2322 0 2321 26 25 1 1 0 8 0 amappl12 160 3363 0 3359 2 1 1 1 0 8 0 amappl11 152 3599 0 3591 1 0 1 1 0 8 0 amappl10 144 3263 0 3258 1 0 1 1 0 8 0 amappl9 136 6804 0 6797 1 0 1 1 0 8 0 amappl8 128 6777 0 6655 7 2 5 5 0 8 0 amappl7 120 3938 0 3928 1 0 1 1 0 8 0 amappl6 112 3277 0 3249 1 0 1 1 0 8 0 amappl5 104 5157 0 5146 1 0 1 1 0 8 0 amappl4 96 24164 0 24125 4 3 1 2 0 8 0 amappl3 88 7392 0 7381 1 0 1 1 0 8 0 amappl2 80 199250 0 199166 3 1 2 3 0 8 0 amappl1 72 593401 0 593000 25 15 10 20 0 8 0 amappl 80 89101 0 88949 4 0 4 4 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 132 0 3 3 0 3 3 0 8 0 uaddrrnd 24 26023 0 25654 3 0 3 3 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 26023 0 25654 3 0 3 3 0 8 0 vmmpekpl 168 179433 0 179372 13 9 4 4 0 8 0 vmmpepl 168 3325814 0 3322124 1143 939 204 219 0 357 30 vmsppl 368 25667 0 25654 2 0 2 2 0 8 0 pdppl 4096 52053 0 51811 41 10 31 31 0 8 0 pvpl 32 8153802 0 8129587 1214 980 234 242 0 265 30 pmappl 232 26022 0 25803 14 1 13 13 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 1409 0 526 26 0 26 26 0 8 0