panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *155443 52075 0 0 0x4000000 0K syz-executor.0 338119 37445 0 0x2 0 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(fffffd80645f1418,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aed400,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aed400,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aed400,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020acf7c8,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(fffffd806e2fe9c0,c5005601,ffff800000af9000,1,fffffd807f7c69c0,ffff800020ab18c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca400a8,c5005601,ffff800000af9000,ffff800020ab18c8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab18c8,ffff800021369488,ffff8000213694d0) at sys_ioctl+0x5b9 syscall(ffff800021369550) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021369550) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf5ad7095260, 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(fffffd80645f1418,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aed400,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aed400,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aed400,0,7,fffffd807f008a10,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800020acf7c8,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(fffffd806e2fe9c0,c5005601,ffff800000af9000,1,fffffd807f7c69c0,ffff800020ab18c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd806ca400a8,c5005601,ffff800000af9000,ffff800020ab18c8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff800020ab18c8,ffff800021369488,ffff8000213694d0) at sys_ioctl+0x5b9 syscall(ffff800021369550) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021369550) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf5ad7095260, count: -12 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800021368de0 rbx 0xffff800021368e90 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800023370000 rax 0xffff800000a9fbc0 r8 0xffffffff8218361f kprintf+0x16f r9 0x1 r10 0x25 r11 0xa1242fb6eff2767b r12 0x3000000008 r13 0xffff800021368df0 r14 0x100 r15 0x1 rip 0xffffffff8175c768 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021368dd0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=155443 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ab13d8,0xffffffff8267ef18 process=0xffff800020adc700 user=0xffff800021364000, vmspace=0xfffffd807f008a10 estcpu=36, cpticks=54, pctcpu=20.28 user=0, sys=17060, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 52075 467351 61770 0 2 0 syz-executor.0 *52075 155443 61770 0 7 0x4000000 syz-executor.0 61770 325927 1707 0 2 0x482 syz-executor.0 37445 338119 1707 0 7 0x2 syz-executor.1 69895 335169 0 0 3 0x14200 bored sosplice 1707 340467 50963 0 3 0x82 thrsleep syz-fuzzer 1707 116633 50963 0 2 0x4000482 syz-fuzzer 1707 357491 50963 0 3 0x4000082 thrsleep syz-fuzzer 1707 68611 50963 0 2 0x4000482 syz-fuzzer 1707 74472 50963 0 3 0x4000082 thrsleep syz-fuzzer 1707 407449 50963 0 3 0x4000082 thrsleep syz-fuzzer 1707 191688 50963 0 3 0x4000082 thrsleep syz-fuzzer 1707 228561 50963 0 3 0x4000082 thrsleep syz-fuzzer 1707 79314 50963 0 3 0x4000082 thrsleep syz-fuzzer 1707 359220 50963 0 2 0x4000482 syz-fuzzer 1707 511186 50963 0 3 0x4000082 kqread syz-fuzzer 50963 431082 9288 0 3 0x10008a pause ksh 9288 376562 97592 0 3 0x92 select sshd 89781 160236 1 0 3 0x100083 ttyin getty 97592 54637 1 0 3 0x80 select sshd 73930 359679 66734 74 2 0x100492 pflogd 66734 412534 1 0 3 0x80 netio pflogd 46249 437892 69538 73 2 0x100090 syslogd 69538 180506 1 0 3 0x100082 netio syslogd 95548 4683 1 77 3 0x100090 poll dhclient 42577 8994 1 0 3 0x80 poll dhclient 35724 179301 0 0 3 0x14200 pgzero zerothread 78408 329476 0 0 3 0x14200 aiodoned aiodoned 82472 376876 0 0 2 0x14200 update 19499 403476 0 0 3 0x14200 cleaner cleaner 12173 47540 0 0 3 0x14200 reaper reaper 30454 410884 0 0 3 0x14200 pgdaemon pagedaemon 8547 366822 0 0 3 0x14200 bored crynlk 36636 43828 0 0 3 0x14200 bored crypto 46437 470558 0 0 3 0x40014200 acpi0 acpi0 85705 439261 0 0 3 0x40014200 idle1 66315 15881 0 0 2 0x14200 softnet 26199 270083 0 0 2 0x14200 systqmp 44273 303241 0 0 3 0x14200 bored systq 21730 422038 0 0 2 0x40014200 softclock 56077 360256 0 0 3 0x40014200 idle0 31550 46486 0 0 2 0x14200 smr 1 330785 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb{0}> show all locks Process 52075 (syz-executor.0) thread 0xffff800020ab18c8 (155443) shared rwlock vmmaplk r = 0 (0xfffffd807f008a28) #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 (0xffff800000aed418) #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 (0xffffffff82649680) #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 37445 (syz-executor.1) thread 0xffff800020ab0508 (338119) exclusive rrwlock inode r = 0 (0xfffffd807a5eae78) #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:451 #3 ufs_ihashins+0x45 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x13e sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1cf sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_mkdir+0xf4 sys/ufs/ufs/ufs_vnops.c:1164 #7 VOP_MKDIR+0xc6 sys/kern/vfs_vops.c:450 #8 domkdirat+0x121 sys/kern/vfs_syscalls.c:2983 #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 rrwlock inode r = 0 (0xfffffd806e6921b0) #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:451 #3 VOP_LOCK+0xf0 sys/kern/vfs_vops.c:615 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:571 #5 vfs_lookup+0xe6 sys/kern/vfs_lookup.c:419 #6 namei+0x63c sys/kern/vfs_lookup.c:249 #7 domkdirat+0x75 sys/kern/vfs_syscalls.c:2968 #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 9559 6430K 6948K 78643K 19274 0 0 pcb 13 8K 9K 78643K 338 0 0 rtable 116 5K 5K 78643K 1086 0 0 ifaddr 90 17K 18K 78643K 424 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 1 2K 4K 78643K 1556 0 0 iov 0 0K 16K 78643K 292 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1225 77K 78K 78643K 7998 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 16 0 0 VM map 17 8K 8K 78643K 45 0 0 sem 12 0K 1K 78643K 5947 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1809 196K 290K 78643K 12766 0 0 file desc 5 13K 25K 78643K 3577 0 0 sigio 0 0K 0K 78643K 364 0 0 proc 62 63K 95K 78643K 7289 0 0 subproc 32 2K 2K 78643K 255 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 174 0 0 in_multi 58 3K 3K 78643K 265 0 0 ether_multi 1 0K 0K 78643K 19 0 0 mrt 0 0K 0K 78643K 6 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 518 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 160 130K 130K 78643K 10493 0 0 UVM aobj 130 4K 4K 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 315 0 0 NDP 17 0K 0K 78643K 110 0 0 temp 156 3559K 3639K 78643K 43944 0 0 kqueue 0 0K 0K 78643K 3 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 28 0 21 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 147 0 145 1 0 1 1 0 8 0 rtentry 112 189 0 144 2 0 2 2 0 8 0 unpcb 120 3853 0 3842 1 0 1 1 0 8 0 syncache 264 6 0 6 3 3 0 1 0 8 0 tcpqe 32 1 0 1 1 1 0 1 0 8 0 tcpcb 544 5619 0 5615 9 8 1 3 0 8 0 inpcb 280 61015 0 61008 14 11 3 6 0 8 2 rttmr 72 2 0 2 2 2 0 1 0 8 0 ip6q 72 2 0 2 1 1 0 1 0 8 0 ip6af 40 6 0 6 1 1 0 1 0 8 0 nd6 48 33 0 29 1 0 1 1 0 8 0 pkpcb 40 9 0 9 3 3 0 1 0 8 0 ppxss 1128 29 0 29 7 7 0 1 0 8 0 pffrag 232 29 0 29 8 8 0 1 0 482 0 pffrnode 88 29 0 29 8 8 0 1 0 8 0 pffrent 40 705 0 705 8 8 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 113 0 85 1 0 1 1 0 8 0 pfstkey 112 113 0 85 2 0 2 2 0 8 0 pfstate 328 113 0 85 5 1 4 4 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 3 0 1 2 0 2 2 0 8 0 art_heap4 256 939 0 714 23 8 15 16 0 8 0 art_table 32 942 0 715 2 0 2 2 0 8 0 art_node 16 188 0 147 1 0 1 1 0 8 0 sysvmsgpl 40 48 0 30 1 0 1 1 0 8 0 semupl 112 9 0 9 1 1 0 1 0 8 0 semapl 112 5945 0 5935 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 13316 0 11910 46 0 46 46 0 8 0 ffsino 272 13316 0 11910 96 1 95 95 0 8 0 nchpl 144 16159 0 15707 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 64793 0 64792 1 0 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 vcpupl 1984 14 0 0 2 0 2 2 0 8 0 vmpool 552 43 0 28 3 1 2 2 0 8 0 scxspl 192 43292 0 43292 15 14 1 4 0 8 1 plimitpl 152 101 0 93 1 0 1 1 0 8 0 sigapl 432 3736 0 3721 3 1 2 3 0 8 0 futexpl 56 224835 0 224835 1 0 1 1 0 8 1 knotepl 112 337 0 318 1 0 1 1 0 8 0 kqueuepl 104 371 0 369 1 0 1 1 0 8 0 pipepl 160 1616 0 1597 8 7 1 2 0 8 0 fdescpl 488 3737 0 3721 3 0 3 3 0 8 0 filepl 152 93710 0 93609 19 13 6 8 0 8 2 lockfpl 104 570 0 569 1 0 1 1 0 8 0 lockfspl 48 170 0 169 1 0 1 1 0 8 0 sessionpl 112 31 0 20 1 0 1 1 0 8 0 pgrppl 48 40 0 29 1 0 1 1 0 8 0 ucredpl 96 10725 0 10716 1 0 1 1 0 8 0 zombiepl 144 3721 0 3721 1 0 1 1 0 8 1 processpl 896 3753 0 3721 4 0 4 4 0 8 0 procpl 632 8963 0 8920 9 5 4 5 0 8 0 srpgc 64 24 0 24 6 6 0 1 0 8 0 sosppl 128 13969 0 13969 1 0 1 1 0 8 1 sockpl 384 65056 0 65036 29 23 6 10 0 8 3 mcl64k 65536 18 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 25 0 0 2 0 2 2 0 8 0 mcl9k 9216 8 0 0 1 0 1 1 0 8 0 mcl8k 8192 22 0 0 3 0 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 208 0 0 21 3 18 21 0 8 0 mtagpl 80 18 0 0 1 0 1 1 0 8 0 mbufpl 256 380 0 0 20 0 20 20 0 8 0 bufpl 256 13045 0 5987 442 0 442 442 0 8 0 anonpl 16 433037 0 408702 147 32 115 115 0 124 11 amapchunkpl 152 20360 0 19994 43 25 18 19 0 158 3 amappl16 192 20787 0 19614 109 42 67 71 0 8 8 amappl15 184 199 0 198 1 0 1 1 0 8 0 amappl14 176 1245 0 1239 1 0 1 1 0 8 0 amappl13 168 303 0 301 4 3 1 1 0 8 0 amappl12 160 303 0 300 1 0 1 1 0 8 0 amappl11 152 94 0 79 1 0 1 1 0 8 0 amappl10 144 666 0 658 1 0 1 1 0 8 0 amappl9 136 908 0 905 1 0 1 1 0 8 0 amappl8 128 468 0 422 2 0 2 2 0 8 0 amappl7 120 759 0 750 1 0 1 1 0 8 0 amappl6 112 87 0 74 1 0 1 1 0 8 0 amappl5 104 2082 0 2068 1 0 1 1 0 8 0 amappl4 96 3676 0 3643 1 0 1 1 0 8 0 amappl3 88 2491 0 2485 1 0 1 1 0 8 0 amappl2 80 30086 0 30011 3 1 2 3 0 8 0 amappl1 72 76171 0 75731 25 15 10 20 0 8 0 amappl 80 9521 0 9461 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 3780 0 3721 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3780 0 3721 1 0 1 1 0 8 0 vmmpekpl 168 26210 0 26171 3 1 2 2 0 8 0 vmmpepl 168 457108 0 454732 234 101 133 154 0 357 23 vmsppl 368 3736 0 3721 2 0 2 2 0 8 0 pdppl 4096 7567 0 7512 8 0 8 8 0 8 1 pvpl 32 1082424 0 1057848 295 58 237 237 0 265 32 pmappl 232 3779 0 3749 4 2 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 643 0 23 18 0 18 18 0 8 0