panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 273171 13169 0 0 0 0 syz-executor.1 *156067 13169 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(fffffd806ca08788,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aeb600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aeb600,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aeb600,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020abecf8,ffff800020ab0c70) 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(fffffd806e155c30,c5005601,ffff800000abb000,1,fffffd807f7c68a0,ffff800020ab0c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806146b7d0,c5005601,ffff800000abb000,ffff800020ab0c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0c70,ffff80002195d088,ffff80002195d0d0) at sys_ioctl+0x5b9 syscall(ffff80002195d150) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff80002195d150) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4b4e0387d30, 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(fffffd806ca08788,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aeb600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aeb600,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aeb600,0,7,fffffd807f008730,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020abecf8,ffff800020ab0c70) 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(fffffd806e155c30,c5005601,ffff800000abb000,1,fffffd807f7c68a0,ffff800020ab0c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806146b7d0,c5005601,ffff800000abb000,ffff800020ab0c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab0c70,ffff80002195d088,ffff80002195d0d0) at sys_ioctl+0x5b9 syscall(ffff80002195d150) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff80002195d150) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4b4e0387d30, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff80002195c9e0 rbx 0xffff80002195ca90 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff8000229d0000 rax 0xffff800000b66080 r8 0xffffffff81aac14f kprintf+0x16f r9 0x1 r10 0x25 r11 0x2e02f8f588290c01 r12 0x3000000008 r13 0xffff80002195c9f0 r14 0x100 r15 0x1 rip 0xffffffff8211e9c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002195c9d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=156067 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab0508,0xffffffff826602c8 process=0xffff800020add180 user=0xffff800021958000, vmspace=0xfffffd807f008730 estcpu=36, cpticks=18502, pctcpu=0.0 user=0, sys=18501, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 13169 273171 58417 0 7 0 syz-executor.1 *13169 156067 58417 0 7 0x4000000 syz-executor.1 92912 254630 35574 0 2 0 syz-executor.0 92912 337192 35574 0 3 0x4000080 pipewr syz-executor.0 92912 434714 35574 0 3 0x4000080 piperd syz-executor.0 58417 446813 4725 0 3 0x82 nanosleep syz-executor.1 29187 382756 1 0 3 0x100083 ttyin getty 35574 477490 4725 0 3 0x82 nanosleep syz-executor.0 3504 418231 0 0 3 0x14200 acct acct 89431 6652 0 0 3 0x14200 bored sosplice 4725 361946 69124 0 3 0x82 thrsleep syz-fuzzer 4725 321765 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 246870 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 425982 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 395480 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 18694 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 249377 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 282740 69124 0 3 0x4000082 thrsleep syz-fuzzer 4725 3333 69124 0 3 0x4000082 kqread syz-fuzzer 4725 424762 69124 0 3 0x4000082 thrsleep syz-fuzzer 69124 176279 52882 0 3 0x10008a pause ksh 52882 208435 92260 0 3 0x92 select sshd 92260 94473 1 0 3 0x80 select sshd 38919 478589 1862 74 3 0x100092 bpf pflogd 1862 304834 1 0 3 0x80 netio pflogd 98638 286449 46303 73 3 0x100090 kqread syslogd 46303 191093 1 0 3 0x100082 netio syslogd 1207 288751 1 77 3 0x100090 poll dhclient 10372 259997 1 0 3 0x80 poll dhclient 61526 67535 0 0 2 0x14200 zerothread 35729 373451 0 0 3 0x14200 aiodoned aiodoned 81366 12116 0 0 3 0x14200 syncer update 62801 466054 0 0 3 0x14200 cleaner cleaner 34471 451197 0 0 3 0x14200 reaper reaper 69081 292368 0 0 3 0x14200 pgdaemon pagedaemon 33778 448872 0 0 3 0x14200 bored crynlk 63702 279863 0 0 3 0x14200 bored crypto 768 115003 0 0 3 0x40014200 acpi0 acpi0 45748 107473 0 0 3 0x40014200 idle1 93397 425261 0 0 3 0x14200 bored softnet 8289 242881 0 0 3 0x14200 bored systqmp 73129 200112 0 0 3 0x14200 bored systq 52638 69350 0 0 3 0x40014200 bored softclock 75758 248548 0 0 3 0x40014200 idle0 96865 24994 0 0 3 0x14200 bored smr 1 389282 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 13169 (syz-executor.1) thread 0xffff800020ab0c70 (156067) shared rwlock vmmaplk r = 0 (0xfffffd807f008748) #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 (0xffff800000aeb618) #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 (0xffffffff8265dc90) #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 9600 6720K 8068K 78643K 20108 0 0 pcb 13 8K 9K 78643K 647 0 0 rtable 103 5K 6K 78643K 1855 0 0 ifaddr 207 26K 27K 78643K 697 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1630 0 0 iov 0 0K 32K 78643K 600 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1219 77K 77K 78643K 4396 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 54 0 0 VM map 28 14K 14K 78643K 32 0 0 sem 12 1K 1K 78643K 14 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 2815 0 0 sigio 0 0K 0K 78643K 26 0 0 proc 62 63K 95K 78643K 1528 0 0 subproc 32 2K 2K 78643K 374 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 379 0 0 in_multi 155 7K 7K 78643K 537 0 0 ether_multi 1 0K 0K 78643K 30 0 0 mrt 1 0K 0K 78643K 20 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 96 424K 424K 78643K 96 0 0 exec 0 0K 1K 78643K 714 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 185 244K 244K 78643K 12540 0 0 UVM aobj 130 9K 9K 78643K 132 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 657 0 0 NDP 20 0K 0K 78643K 163 0 0 temp 168 3556K 4195K 78643K 168483 0 0 kqueue 0 0K 0K 78643K 33 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 72 0 68 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 346 0 309 2 0 2 2 0 8 0 unpcb 120 2188 0 2176 2 1 1 2 0 8 0 syncache 264 21 0 21 8 8 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 5 0 5 4 4 0 1 0 8 0 tcpcb 544 1092 0 1086 7 6 1 2 0 8 0 inpcb 280 4397 0 4388 30 28 2 4 0 8 1 rttmr 72 6 0 5 1 0 1 1 0 8 0 ip6q 72 2 0 2 2 2 0 1 0 8 0 ip6af 40 6 0 6 2 2 0 1 0 8 0 nd6 48 52 0 50 1 0 1 1 0 8 0 pkpcb 40 15 0 15 4 4 0 1 0 8 0 ppxss 1128 51 0 51 19 18 1 1 0 8 1 pffrag 232 82 0 82 22 21 1 1 0 482 1 pffrnode 88 82 0 82 22 21 1 1 0 8 1 pffrent 40 2450 0 2450 22 21 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 255 0 228 1 0 1 1 0 8 0 pfstkey 112 255 0 228 2 0 2 2 0 8 0 pfstate 328 255 0 228 5 1 4 4 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 10 0 8 7 5 2 3 0 8 0 art_heap4 256 1610 0 1385 33 17 16 17 0 8 0 art_table 32 1620 0 1393 4 1 3 3 0 8 0 art_node 16 345 0 310 1 0 1 1 0 8 0 sysvmsgpl 40 47 0 26 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 12 0 2 1 0 1 1 0 8 0 shmpl 112 130 0 2 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 5577 0 4159 46 0 46 46 0 8 0 ffsino 272 5577 0 4159 96 1 95 95 0 8 0 nchpl 144 10556 0 10094 62 42 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 35967 0 35967 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 25 0 0 4 0 4 4 0 8 0 vmpool 552 30 0 4 2 0 2 2 0 8 0 scsiplug 64 6 0 6 4 4 0 1 0 8 0 scxspl 192 34330 0 34330 44 41 3 7 0 8 3 plimitpl 152 275 0 267 1 0 1 1 0 8 0 sigapl 432 2955 0 2939 3 1 2 3 0 8 0 futexpl 56 72495 0 72495 2 1 1 1 0 8 1 knotepl 112 1102 0 1083 2 1 1 2 0 8 0 kqueuepl 104 2096 0 2093 1 0 1 1 0 8 0 pipepl 160 5086 0 5065 2 0 2 2 0 8 1 fdescpl 488 2956 0 2939 3 0 3 3 0 8 0 filepl 152 30934 0 30828 35 29 6 8 0 8 1 lockfpl 104 1081 0 1080 1 0 1 1 0 8 0 lockfspl 48 327 0 326 1 0 1 1 0 8 0 sessionpl 112 40 0 29 1 0 1 1 0 8 0 pgrppl 48 55 0 44 1 0 1 1 0 8 0 ucredpl 96 3354 0 3345 1 0 1 1 0 8 0 zombiepl 144 2940 0 2940 1 0 1 1 0 8 1 processpl 896 2974 0 2940 4 0 4 4 0 8 0 procpl 632 10634 0 10588 5 0 5 5 0 8 0 srpgc 64 38 0 38 16 15 1 1 0 8 1 sosppl 128 51 0 51 12 11 1 1 0 8 1 sockpl 384 6954 0 6931 45 41 4 8 0 8 1 mcl64k 65536 33 0 0 4 1 3 3 0 8 0 mcl16k 16384 14 0 0 2 0 2 2 0 8 0 mcl12k 12288 29 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 28 0 0 4 2 2 3 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 161 0 0 18 3 15 18 0 8 0 mtagpl 80 66 0 0 1 0 1 1 0 8 0 mbufpl 256 866 0 0 33 0 33 33 0 8 0 bufpl 256 18484 0 11426 442 0 442 442 0 8 0 anonpl 16 410060 0 387869 203 107 96 110 0 124 1 amapchunkpl 152 25964 0 25783 58 47 11 15 0 158 2 amappl16 192 16738 0 15451 183 118 65 77 0 8 0 amappl15 184 181 0 181 3 3 0 1 0 8 0 amappl14 176 514 0 508 1 0 1 1 0 8 0 amappl13 168 343 0 343 3 3 0 1 0 8 0 amappl12 160 577 0 574 1 0 1 1 0 8 0 amappl11 152 417 0 399 1 0 1 1 0 8 0 amappl10 144 348 0 343 1 0 1 1 0 8 0 amappl9 136 1243 0 1239 1 0 1 1 0 8 0 amappl8 128 837 0 779 2 0 2 2 0 8 0 amappl7 120 450 0 442 1 0 1 1 0 8 0 amappl6 112 375 0 359 1 0 1 1 0 8 0 amappl5 104 875 0 860 1 0 1 1 0 8 0 amappl4 96 2960 0 2919 3 1 2 2 0 8 0 amappl3 88 925 0 916 1 0 1 1 0 8 0 amappl2 80 21816 0 21733 3 1 2 3 0 8 0 amappl1 72 79549 0 79090 25 15 10 20 0 8 0 amappl 80 11279 0 11213 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 131 0 2 3 0 3 3 0 8 0 uaddrrnd 24 2986 0 2939 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2986 0 2939 1 0 1 1 0 8 0 vmmpekpl 168 37607 0 37564 3 0 3 3 0 8 0 vmmpepl 168 396780 0 394131 468 308 160 165 0 357 43 vmsppl 368 2955 0 2939 2 0 2 2 0 8 0 pdppl 4096 5979 0 5911 10 1 9 9 0 8 0 pvpl 32 1090544 0 1066051 414 192 222 247 0 265 12 pmappl 232 2985 0 2943 5 2 3 3 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 670 0 40 19 0 19 19 0 8 0