panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 460446 39661 0 0 0 0 syz-executor.1 *423318 39661 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(fffffd8063262698,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b4ce00,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b4ce00,0,7,fffffd807f007170,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b4ce00,0,7,fffffd807f007170,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020acecf8,ffff800020ab1b40) 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(fffffd806e4d89c0,c5005601,ffff800000a9a000,1,fffffd807f7c6a80,ffff800020ab1b40) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca4b990,c5005601,ffff800000a9a000,ffff800020ab1b40) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab1b40,ffff800024be5af8,ffff800024be5b40) at sys_ioctl+0x5b9 syscall(ffff800024be5bc0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800024be5bc0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x68bdb79a4e0, 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(fffffd8063262698,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b4ce00,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b4ce00,0,7,fffffd807f007170,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b4ce00,0,7,fffffd807f007170,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020acecf8,ffff800020ab1b40) 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(fffffd806e4d89c0,c5005601,ffff800000a9a000,1,fffffd807f7c6a80,ffff800020ab1b40) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca4b990,c5005601,ffff800000a9a000,ffff800020ab1b40) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab1b40,ffff800024be5af8,ffff800024be5b40) at sys_ioctl+0x5b9 syscall(ffff800024be5bc0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800024be5bc0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x68bdb79a4e0, count: -12 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800024be5450 rbx 0xffff800024be5500 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800020b5e000 rax 0xffff800000b4b1c0 r8 0xffffffff8194382f kprintf+0x16f r9 0x1 r10 0x25 r11 0xef0413e22efb171f r12 0x3000000008 r13 0xffff800024be5460 r14 0x100 r15 0x1 rip 0xffffffff816cef58 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024be5440 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=423318 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab0508,0xffffffff82665408 process=0xffff800020addc00 user=0xffff800024be0000, vmspace=0xfffffd807f007170 estcpu=36, cpticks=17200, pctcpu=0.0 user=0, sys=17200, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 39661 460446 35087 0 7 0 syz-executor.1 *39661 423318 35087 0 7 0x4000000 syz-executor.1 31895 281773 96232 0 2 0 syz-executor.0 31895 55936 96232 0 3 0x4000080 fsleep syz-executor.0 35087 407798 65825 0 3 0x82 nanosleep syz-executor.1 96232 72591 65825 0 3 0x82 nanosleep syz-executor.0 34114 229345 0 0 3 0x14200 acct acct 35181 494337 0 0 3 0x14200 bored sosplice 65825 205685 55530 0 3 0x82 thrsleep syz-fuzzer 65825 407927 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 144960 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 304292 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 115459 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 204001 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 391770 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 17784 55530 0 3 0x4000082 kqread syz-fuzzer 65825 356567 55530 0 3 0x4000082 thrsleep syz-fuzzer 65825 319387 55530 0 3 0x4000082 thrsleep syz-fuzzer 55530 480120 11850 0 3 0x10008a pause ksh 11850 317238 95950 0 3 0x92 select sshd 91487 281130 1 0 3 0x100083 ttyin getty 95950 154585 1 0 3 0x80 select sshd 30039 104409 74661 74 3 0x100092 bpf pflogd 74661 101256 1 0 3 0x80 netio pflogd 89469 441212 62754 73 3 0x100090 kqread syslogd 62754 373740 1 0 3 0x100082 netio syslogd 58958 452950 1 77 3 0x100090 poll dhclient 14233 191034 1 0 3 0x80 poll dhclient 57840 402880 0 0 2 0x14200 zerothread 90551 434475 0 0 3 0x14200 aiodoned aiodoned 86073 342398 0 0 3 0x14200 syncer update 68107 380855 0 0 3 0x14200 cleaner cleaner 71001 352148 0 0 3 0x14200 reaper reaper 62130 325235 0 0 3 0x14200 pgdaemon pagedaemon 951 44954 0 0 3 0x14200 bored crynlk 75808 243686 0 0 3 0x14200 bored crypto 60962 192851 0 0 3 0x40014200 acpi0 acpi0 91740 241452 0 0 3 0x40014200 idle1 50663 519512 0 0 3 0x14200 bored softnet 72879 225786 0 0 3 0x14200 bored systqmp 73315 222239 0 0 3 0x14200 bored systq 37026 78282 0 0 3 0x40014200 bored softclock 67957 499691 0 0 3 0x40014200 idle0 71294 452166 0 0 3 0x14200 bored smr 1 521994 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 39661 (syz-executor.1) thread 0xffff800020ab1b40 (423318) shared rwlock vmmaplk r = 0 (0xfffffd807f007188) #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 (0xffff800000b4ce18) #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 (0xffffffff82688dc0) #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 9544 6433K 7573K 78643K 14812 0 0 pcb 13 8K 9K 78643K 921 0 0 rtable 106 3K 4K 78643K 2553 0 0 ifaddr 86 16K 16K 78643K 235 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1548 0 0 iov 0 0K 16K 78643K 115 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1226 77K 78K 78643K 2820 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 12 0 0 VM map 25 12K 12K 78643K 28 0 0 sem 9 1K 1K 78643K 9 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 6 17K 25K 78643K 1339 0 0 sigio 0 0K 0K 78643K 16 0 0 proc 62 63K 95K 78643K 692 0 0 subproc 32 2K 2K 78643K 119 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 69 0 0 in_multi 75 4K 4K 78643K 160 0 0 ether_multi 1 0K 0K 78643K 5 0 0 mrt 0 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 320 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 163 165K 165K 78643K 5056 0 0 UVM aobj 58 2K 2K 78643K 58 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 232 0 0 NDP 15 0K 0K 78643K 57 0 0 temp 147 3555K 3624K 78643K 22280 0 0 kqueue 0 0K 0K 78643K 3 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 338 0 332 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 53 0 51 1 0 1 1 0 8 0 rtentry 112 446 0 403 2 0 2 2 0 8 0 unpcb 120 368 0 358 1 0 1 1 0 8 0 syncache 264 7 0 7 3 3 0 1 0 8 0 tcpcb 544 396 0 392 2 1 1 2 0 8 0 inpcb 280 2335 0 2328 6 5 1 3 0 8 0 rttmr 72 1 0 0 1 0 1 1 0 8 0 nd6 48 16 0 13 1 0 1 1 0 8 0 pkpcb 40 6 0 6 2 2 0 1 0 8 0 swfcl 56 1 0 0 1 0 1 1 0 8 0 ppxss 1128 11 0 11 3 3 0 1 0 8 0 pffrag 232 12 0 12 3 3 0 1 0 482 0 pffrnode 88 12 0 12 3 3 0 1 0 8 0 pffrent 40 454 0 454 3 3 0 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 36 0 21 1 0 1 1 0 8 0 pfstkey 112 36 0 21 1 0 1 1 0 8 0 pfstate 328 36 0 21 2 0 2 2 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 876 0 649 18 3 15 16 0 8 0 art_table 32 877 0 649 2 0 2 2 0 8 0 art_node 16 445 0 405 1 0 1 1 0 8 0 sysvmsgpl 40 27 0 12 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 7 0 0 1 0 1 1 0 8 0 shmpl 112 56 0 0 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4111 0 2710 46 0 46 46 0 8 0 ffsino 272 4111 0 2710 95 0 95 95 0 8 0 nchpl 144 6189 0 4587 61 1 60 61 0 8 0 uvmvnodes 72 5142 0 0 94 0 94 94 0 8 0 vnodes 208 5142 0 0 271 0 271 271 0 8 0 namei 1024 19195 0 19195 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 22 0 0 3 0 3 3 0 8 0 vmpool 552 26 0 3 2 0 2 2 0 8 0 scsiplug 64 2 0 2 2 2 0 1 0 8 0 scxspl 192 17212 0 17212 10 9 1 7 0 8 1 plimitpl 152 55 0 47 1 0 1 1 0 8 0 sigapl 432 1522 0 1506 3 1 2 3 0 8 0 futexpl 56 24633 0 24632 1 0 1 1 0 8 0 knotepl 112 169 0 150 1 0 1 1 0 8 0 kqueuepl 104 132 0 129 1 0 1 1 0 8 0 pipepl 160 3028 0 3009 3 2 1 2 0 8 0 fdescpl 488 1523 0 1506 3 0 3 3 0 8 0 filepl 152 12932 0 12830 9 5 4 7 0 8 0 lockfpl 104 443 0 442 1 0 1 1 0 8 0 lockfspl 48 160 0 159 1 0 1 1 0 8 0 sessionpl 112 23 0 12 1 0 1 1 0 8 0 pgrppl 48 27 0 16 1 0 1 1 0 8 0 ucredpl 96 896 0 887 1 0 1 1 0 8 0 zombiepl 144 1506 0 1506 1 0 1 1 0 8 1 processpl 896 1540 0 1506 4 0 4 4 0 8 0 procpl 632 4020 0 3975 8 3 5 5 0 8 1 srpgc 64 8 0 8 3 3 0 1 0 8 0 sosppl 128 12 0 12 1 1 0 1 0 8 0 sockpl 384 2776 0 2757 11 8 3 5 0 8 1 mcl64k 65536 16 0 0 2 0 2 2 0 8 0 mcl16k 16384 23 0 0 3 1 2 3 0 8 0 mcl12k 12288 16 0 0 2 0 2 2 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 15 0 0 2 0 2 2 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 148 0 0 18 1 17 18 0 8 0 mtagpl 80 6 0 0 1 0 1 1 0 8 0 mbufpl 256 628 0 0 38 0 38 38 0 8 0 bufpl 256 8928 0 1870 442 0 442 442 0 8 0 anonpl 16 194508 0 167170 125 2 123 123 0 124 5 amapchunkpl 152 9487 0 8657 39 5 34 34 0 158 0 amappl16 192 8561 0 7366 77 9 68 72 0 8 8 amappl15 184 438 0 437 1 0 1 1 0 8 0 amappl14 176 78 0 73 1 0 1 1 0 8 0 amappl12 160 736 0 733 2 1 1 1 0 8 0 amappl11 152 124 0 109 1 0 1 1 0 8 0 amappl10 144 82 0 72 1 0 1 1 0 8 0 amappl9 136 666 0 662 1 0 1 1 0 8 0 amappl8 128 244 0 207 2 0 2 2 0 8 0 amappl7 120 118 0 107 1 0 1 1 0 8 0 amappl6 112 122 0 110 1 0 1 1 0 8 0 amappl5 104 984 0 969 1 0 1 1 0 8 0 amappl4 96 1686 0 1652 2 1 1 2 0 8 0 amappl3 88 312 0 306 1 0 1 1 0 8 0 amappl2 80 11366 0 11287 3 1 2 3 0 8 0 amappl1 72 41460 0 41009 25 15 10 20 0 8 0 amappl 80 4368 0 4300 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 57 0 0 1 0 1 1 0 8 0 uaddrrnd 24 1549 0 1506 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1549 0 1506 1 0 1 1 0 8 0 vmmpekpl 168 19172 0 19134 2 0 2 2 0 8 0 vmmpepl 168 196096 0 193599 197 53 144 151 0 357 28 vmsppl 368 1522 0 1506 2 0 2 2 0 8 0 pdppl 4096 3105 0 3040 9 0 9 9 0 8 0 pvpl 32 496026 0 476337 241 26 215 232 0 265 16 pmappl 232 1548 0 1509 3 0 3 3 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 641 0 9 19 0 19 19 0 8 0