panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *347056 33870 0 0 0x4000000 1K syz-executor.0 409195 12635 0 0 0x4000080 0 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(fffffd8063d03918,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b7a400,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b7a400,0,7,fffffd807f00b730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b7a400,0,7,fffffd807f00b730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800022d5c238,ffff800020acf170) 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(fffffd806e1e79c0,c5005601,ffff800000b74800,1,fffffd807f7c6660,ffff800020acf170) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80611aa7d8,c5005601,ffff800000b74800,ffff800020acf170) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020acf170,ffff800023991928,ffff800023991970) at sys_ioctl+0x5b9 syscall(ffff8000239919f0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff8000239919f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,c813b910e0) at Xsyscall+0x128 end of kernel end trace frame: 0xca8dd189c0, 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(fffffd8063d03918,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b7a400,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b7a400,0,7,fffffd807f00b730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b7a400,0,7,fffffd807f00b730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800022d5c238,ffff800020acf170) 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(fffffd806e1e79c0,c5005601,ffff800000b74800,1,fffffd807f7c6660,ffff800020acf170) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80611aa7d8,c5005601,ffff800000b74800,ffff800020acf170) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020acf170,ffff800023991928,ffff800023991970) at sys_ioctl+0x5b9 syscall(ffff8000239919f0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff8000239919f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,c813b910e0) at Xsyscall+0x128 end of kernel end trace frame: 0xca8dd189c0, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800023991280 rbx 0xffff800023991330 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800021f58000 rax 0xffff800000a7b300 r8 0xffffffff816ebd8f kprintf+0x16f r9 0x1 r10 0x25 r11 0x95f4be549eda7b1e r12 0x3000000008 r13 0xffff800023991290 r14 0x100 r15 0x1 rip 0xffffffff811a5758 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023991270 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=347056 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ace2a0,0xffffffff8265cd40 process=0xffff800020adca80 user=0xffff80002398c000, vmspace=0xfffffd807f00b730 estcpu=36, cpticks=19878, pctcpu=0.0 user=0, sys=19878, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 33870 310447 14491 0 2 0 syz-executor.0 33870 81447 14491 0 2 0x4000000 syz-executor.0 *33870 347056 14491 0 7 0x4000000 syz-executor.0 12635 407346 19478 0 2 0 syz-executor.1 12635 409195 19478 0 7 0x4000080 syz-executor.1 14491 28610 17907 0 3 0x82 nanosleep syz-executor.0 19478 419556 17907 0 3 0x82 nanosleep syz-executor.1 1589 515787 0 0 3 0x14200 acct acct 50337 336836 1 0 3 0x100083 ttyin getty 21282 480419 0 0 3 0x14200 bored sosplice 17907 376653 96800 0 3 0x82 thrsleep syz-fuzzer 17907 458024 96800 0 3 0x4000082 nanosleep syz-fuzzer 17907 488734 96800 0 3 0x4000082 thrsleep syz-fuzzer 17907 367481 96800 0 3 0x4000082 thrsleep syz-fuzzer 17907 420755 96800 0 3 0x4000082 thrsleep syz-fuzzer 17907 1057 96800 0 3 0x4000082 thrsleep syz-fuzzer 17907 457741 96800 0 3 0x4000082 kqread syz-fuzzer 17907 498068 96800 0 3 0x4000082 thrsleep syz-fuzzer 17907 263907 96800 0 3 0x4000082 thrsleep syz-fuzzer 17907 400531 96800 0 3 0x4000082 thrsleep syz-fuzzer 96800 93059 92720 0 3 0x10008a pause ksh 92720 478819 24301 0 3 0x92 select sshd 24301 369401 1 0 3 0x80 select sshd 76190 428458 4408 74 3 0x100092 bpf pflogd 4408 30644 1 0 3 0x80 netio pflogd 36166 199453 93533 73 3 0x100090 kqread syslogd 93533 343861 1 0 3 0x100082 netio syslogd 43175 502452 1 77 3 0x100090 poll dhclient 67917 91804 1 0 3 0x80 poll dhclient 44226 438186 0 0 2 0x14200 zerothread 36767 307535 0 0 3 0x14200 aiodoned aiodoned 99794 493784 0 0 3 0x14200 syncer update 51201 17892 0 0 3 0x14200 cleaner cleaner 93337 520284 0 0 3 0x14200 reaper reaper 75520 179090 0 0 3 0x14200 pgdaemon pagedaemon 30340 44016 0 0 3 0x14200 bored crynlk 826 13741 0 0 3 0x14200 bored crypto 96144 196383 0 0 3 0x40014200 acpi0 acpi0 99183 148090 0 0 3 0x40014200 idle1 38103 3285 0 0 3 0x14200 bored softnet 75859 201024 0 0 3 0x14200 bored systqmp 56807 506536 0 0 3 0x14200 bored systq 82888 475219 0 0 3 0x40014200 bored softclock 16971 417224 0 0 3 0x40014200 idle0 52648 323599 0 0 3 0x14200 bored smr 1 311456 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 33870 (syz-executor.0) thread 0xffff800020acf170 (347056) shared rwlock vmmaplk r = 0 (0xfffffd807f00b748) #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 (0xffff800000b7a418) #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 9573 7083K 8476K 78643K 17761 0 0 pcb 15 8K 9K 78643K 610 0 0 rtable 102 12K 13K 78643K 1933 0 0 ifaddr 210 25K 26K 78643K 657 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 2464 0 0 iov 0 0K 24K 78643K 526 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1218 77K 78K 78643K 3802 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 42 0 0 VM map 34 17K 17K 78643K 43 0 0 sem 12 0K 1K 78643K 611 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 2628 0 0 sigio 0 0K 0K 78643K 59 0 0 proc 62 63K 95K 78643K 1541 0 0 subproc 32 2K 2K 78643K 391 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 294 0 0 in_multi 22 1K 2K 78643K 379 0 0 ether_multi 1 0K 0K 78643K 38 0 0 mrt 0 0K 0K 78643K 13 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 102 450K 450K 78643K 102 0 0 exec 0 0K 1K 78643K 733 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 296K 301K 78643K 10193 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 4 0K 0K 78643K 594 0 0 NDP 21 0K 1K 78643K 164 0 0 temp 172 3556K 4195K 78643K 113482 0 0 kqueue 0 0K 0K 78643K 12 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 79 0 74 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 256 0 254 1 0 1 1 0 8 0 rtentry 112 342 0 307 2 0 2 2 0 8 0 unpcb 120 1445 0 1435 1 0 1 1 0 8 0 syncache 264 17 0 17 6 6 0 1 0 8 0 tcpqe 32 95 0 95 4 4 0 1 0 8 0 tcpcb 544 1143 0 1138 5 4 1 2 0 8 0 inpcb 280 6927 0 6917 11 9 2 4 0 8 1 rttmr 72 2 0 2 2 2 0 1 0 8 0 ip6q 72 1 0 0 1 0 1 1 0 8 0 ip6af 40 1 0 0 1 0 1 1 0 8 0 nd6 48 41 0 39 3 2 1 1 0 8 0 pkpcb 40 38 0 38 6 5 1 1 0 8 1 swfcl 56 3 0 0 1 0 1 1 0 8 0 ppxss 1128 76 0 76 11 10 1 1 0 8 1 pffrag 232 78 0 78 13 12 1 1 0 482 1 pffrnode 88 78 0 78 13 12 1 1 0 8 1 pffrent 40 2262 0 2262 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 229 0 180 1 0 1 1 0 8 0 pfstkey 112 229 0 180 3 1 2 2 0 8 0 pfstate 328 229 0 180 9 3 6 6 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 21 0 20 9 8 1 3 0 8 0 art_heap4 256 1478 0 1303 28 16 12 17 0 8 1 art_table 32 1499 0 1323 3 1 2 3 0 8 0 art_node 16 341 0 309 1 0 1 1 0 8 0 sysvmsgpl 40 24 0 8 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 609 0 599 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 5381 0 3962 46 0 46 46 0 8 0 ffsino 272 5381 0 3962 95 0 95 95 0 8 0 nchpl 144 9306 0 8844 61 41 20 61 0 8 0 uvmvnodes 72 6379 0 0 116 0 116 116 0 8 0 vnodes 208 6379 0 0 336 0 336 336 0 8 0 namei 1024 33931 0 33931 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 31 0 0 4 0 4 4 0 8 0 vmpool 552 41 0 9 3 0 3 3 0 8 0 scsiplug 64 6 0 6 4 4 0 1 0 8 0 scxspl 192 31217 0 31217 30 29 1 7 0 8 1 plimitpl 152 259 0 251 1 0 1 1 0 8 0 sigapl 432 2765 0 2749 3 1 2 3 0 8 0 futexpl 56 63958 0 63958 2 1 1 1 0 8 1 knotepl 112 712 0 693 7 5 2 3 0 8 1 kqueuepl 104 634 0 631 1 0 1 1 0 8 0 pipepl 160 1756 0 1737 8 6 2 2 0 8 1 fdescpl 488 2766 0 2749 3 0 3 3 0 8 0 filepl 152 25970 0 25864 18 13 5 7 0 8 0 lockfpl 104 1004 0 1003 1 0 1 1 0 8 0 lockfspl 48 339 0 338 1 0 1 1 0 8 0 sessionpl 112 41 0 30 1 0 1 1 0 8 0 pgrppl 48 77 0 66 1 0 1 1 0 8 0 ucredpl 96 2728 0 2716 1 0 1 1 0 8 0 zombiepl 144 2752 0 2752 3 2 1 1 0 8 1 processpl 896 2786 0 2752 4 0 4 4 0 8 0 procpl 632 8235 0 8189 6 1 5 5 0 8 0 srpgc 64 44 0 44 12 12 0 1 0 8 0 sosppl 128 48 0 48 9 9 0 1 0 8 0 sockpl 384 8742 0 8720 27 23 4 8 0 8 1 mcl64k 65536 34 0 0 3 0 3 3 0 8 0 mcl16k 16384 26 0 0 3 0 3 3 0 8 1 mcl12k 12288 25 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 4 1 3 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 223 0 0 22 4 18 22 0 8 0 mtagpl 80 52 0 0 1 0 1 1 0 8 0 mbufpl 256 633 0 0 24 0 24 24 0 8 0 bufpl 256 16750 0 9692 442 0 442 442 0 8 0 anonpl 16 404575 0 376388 193 71 122 122 0 124 5 amapchunkpl 152 22827 0 22100 67 39 28 33 0 158 0 amappl16 192 16864 0 15543 168 101 67 72 0 8 0 amappl15 184 478 0 476 5 4 1 1 0 8 0 amappl14 176 247 0 242 1 0 1 1 0 8 0 amappl13 168 387 0 385 2 1 1 1 0 8 0 amappl12 160 98 0 96 1 0 1 1 0 8 0 amappl11 152 483 0 467 1 0 1 1 0 8 0 amappl10 144 203 0 197 1 0 1 1 0 8 0 amappl9 136 975 0 970 1 0 1 1 0 8 0 amappl8 128 559 0 505 2 0 2 2 0 8 0 amappl7 120 338 0 329 1 0 1 1 0 8 0 amappl6 112 441 0 426 1 0 1 1 0 8 0 amappl5 104 635 0 620 1 0 1 1 0 8 0 amappl4 96 3328 0 3289 1 0 1 1 0 8 0 amappl3 88 517 0 510 1 0 1 1 0 8 0 amappl2 80 20830 0 20747 3 1 2 3 0 8 0 amappl1 72 72180 0 71727 25 15 10 20 0 8 0 amappl 80 8945 0 8875 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 132 0 3 3 0 3 3 0 8 0 uaddrrnd 24 2807 0 2749 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2807 0 2749 1 0 1 1 0 8 0 vmmpekpl 168 26415 0 26374 4 1 3 3 0 8 0 vmmpepl 168 366529 0 363853 304 144 160 160 0 357 43 vmsppl 368 2765 0 2749 2 0 2 2 0 8 0 pdppl 4096 5621 0 5547 12 2 10 10 0 8 0 pvpl 32 995442 0 973132 344 126 218 236 0 265 18 pmappl 232 2806 0 2758 3 0 3 3 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 663 0 41 18 0 18 18 0 8 0