panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *132604 10244 0 0 0x4000000 1K syz-executor.1 233085 10244 0 0 0x4000000 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 vrele(fffffd80669fcc58) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff80002261cd80,1,ffff800020b518c8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806faca3f0,c0106477,ffff80002261cd80,1,fffffd807f7c6900,ffff800020b518c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806712f318,c0106477,ffff80002261cd80,ffff800020b518c8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b518c8,ffff80002261ce98,ffff80002261cf00) at sys_ioctl+0x5b8 syscall(ffff80002261cf70) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff80002261cf70) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,e99eecbd010) at Xsyscall+0x128 end of kernel end trace frame: 0xe9cd5ed8110, count: 6 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 vrele: v_writecount != 0 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 vrele(fffffd80669fcc58) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff80002261cd80,1,ffff800020b518c8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806faca3f0,c0106477,ffff80002261cd80,1,fffffd807f7c6900,ffff800020b518c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806712f318,c0106477,ffff80002261cd80,ffff800020b518c8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b518c8,ffff80002261ce98,ffff80002261cf00) at sys_ioctl+0x5b8 syscall(ffff80002261cf70) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff80002261cf70) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,e99eecbd010) at Xsyscall+0x128 end of kernel end trace frame: 0xe9cd5ed8110, count: -9 ddb{1}> show registers rdi 0xffffffff81dcdf97 db_enter+0x17 rsi 0x6af2 __ALIGN_SIZE+0x5af2 rbp 0xffff80002261c940 rbx 0xffff80002261c9f0 rdx 0x6af3 __ALIGN_SIZE+0x5af3 rcx 0xffff800022e34000 rax 0xffff800022e34000 r8 0xffffffff81386d93 kprintf+0x173 r9 0x1 r10 0x25 r11 0xd31581622431ecdd r12 0x3000000008 r13 0xffff80002261c950 r14 0x100 r15 0x1 rip 0xffffffff81dcdf98 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002261c930 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=132604 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b50c70,0xffff800020b502a0 process=0xffff800020b7ca80 user=0xffff800022618000, vmspace=0xfffffd807f00bb80 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 26667 406333 400 0 2 0 syz-executor.0 26667 307877 400 0 3 0x4000080 ttyin syz-executor.0 10244 475127 25255 0 2 0 syz-executor.1 *10244 132604 25255 0 7 0x4000000 syz-executor.1 10244 233085 25255 0 7 0x4000000 syz-executor.1 42169 449950 0 0 3 0x14200 bored sosplice 25255 279048 52332 0 3 0x82 nanosleep syz-executor.1 400 78911 52332 0 3 0x82 nanosleep syz-executor.0 52332 21709 55037 0 3 0x82 thrsleep syz-fuzzer 52332 446195 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 436592 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 226141 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 287124 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 208500 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 139063 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 195212 55037 0 3 0x4000082 thrsleep syz-fuzzer 52332 207118 55037 0 3 0x4000082 kqread syz-fuzzer 52332 126048 55037 0 3 0x4000082 thrsleep syz-fuzzer 55037 462148 55888 0 3 0x10008a pause ksh 55888 519257 81621 0 3 0x92 select sshd 939 383671 1 0 3 0x100083 ttyin getty 81621 214197 1 0 3 0x80 select sshd 33408 202402 64800 74 3 0x100092 bpf pflogd 64800 429081 1 0 3 0x80 netio pflogd 88366 407017 16744 73 3 0x100090 kqread syslogd 16744 373471 1 0 3 0x100082 netio syslogd 47686 514369 1 77 3 0x100090 poll dhclient 93209 131326 1 0 3 0x80 poll dhclient 90785 348844 0 0 2 0x14200 zerothread 39312 433492 0 0 3 0x14200 aiodoned aiodoned 80798 93336 0 0 3 0x14200 syncer update 16635 480811 0 0 3 0x14200 cleaner cleaner 73758 190093 0 0 3 0x14200 reaper reaper 67755 84551 0 0 3 0x14200 pgdaemon pagedaemon 85270 301535 0 0 3 0x14200 bored crynlk 51322 89992 0 0 3 0x14200 bored crypto 92722 299349 0 0 3 0x40014200 acpi0 acpi0 46313 116192 0 0 3 0x40014200 idle1 56715 522985 0 0 3 0x14200 bored softnet 28725 449009 0 0 3 0x14200 bored systqmp 26854 74108 0 0 3 0x14200 bored systq 12146 49093 0 0 3 0x40014200 bored softclock 11135 127865 0 0 3 0x40014200 idle0 57377 233685 0 0 3 0x14200 bored smr 1 99265 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 10244 (syz-executor.1) thread 0xffff800020b518c8 (132604) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8238f2b8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x38f sys/kern/sched_bsd.c:441 #3 sleep_finish+0x113 sys/kern/kern_synch.c:373 #4 tsleep+0x198 sleep_finish_timeout sys/kern/kern_synch.c:397 [inline] #4 tsleep+0x198 sleep_finish_all sys/kern/kern_synch.c:183 [inline] #4 tsleep+0x198 sys/kern/kern_synch.c:152 #5 fifo_open+0x3b6 sys/miscfs/fifofs/fifo_vnops.c:194 #6 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #7 vn_open+0x495 sys/kern/vfs_vnops.c:174 #8 diskmapioctl+0x1ba sys/dev/diskmap.c:89 #9 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 #10 vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 #11 sys_ioctl+0x5b8 #12 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #12 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #13 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9529 6418K 7059K 78643K 12550 0 0 pcb 13 8K 8K 78643K 71 0 0 rtable 86 3K 4K 78643K 400 0 0 ifaddr 56 13K 14K 78643K 165 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1500 0 0 iov 0 0K 16K 78643K 58 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 77K 78643K 1864 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 15 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 117 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 756 0 0 sigio 0 0K 0K 78643K 10 0 0 proc 53 50K 83K 78643K 499 0 0 subproc 32 2K 2K 78643K 34 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 73 0 0 in_multi 22 1K 2K 78643K 47 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 90 397K 397K 78643K 90 0 0 exec 0 0K 1K 78643K 264 0 0 pfkey data 0 0K 0K 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 100 21K 25K 78643K 3387 0 0 UVM aobj 37 3K 3K 78643K 40 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 58 0 0 NDP 12 0K 0K 78643K 44 0 0 temp 172 2747K 2815K 78643K 5714 0 0 kqueue 0 0K 0K 78643K 9 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 6 0 2 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 45 0 12 2 0 2 2 0 8 0 unpcb 120 239 0 227 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 7332 0 7332 2 2 0 2 0 8 0 tcpcb 544 142 0 138 1 0 1 1 0 8 0 inpcb 280 375 0 366 1 0 1 1 0 8 0 nd6 48 6 0 3 1 0 1 1 0 8 0 pkpcb 40 6 0 6 4 3 1 1 0 8 1 ppxss 1128 21 0 21 3 2 1 1 0 8 1 pffrag 232 1 0 1 1 1 0 1 0 482 0 pffrnode 88 1 0 1 1 1 0 1 0 8 0 pffrent 40 4 0 4 2 2 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 32 0 13 1 0 1 1 0 8 0 pfstkey 112 32 0 13 1 0 1 1 0 8 0 pfstate 328 32 0 13 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 188 0 44 12 0 12 12 0 8 0 art_table 32 189 0 44 2 0 2 2 0 8 0 art_node 16 44 0 14 1 0 1 1 0 8 0 sysvmsgpl 40 22 0 8 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 111 0 101 1 0 1 1 0 8 0 shmpl 112 38 0 3 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2635 0 1213 47 0 47 47 0 8 0 ffsino 272 2635 0 1213 96 0 96 96 0 8 0 nchpl 144 3904 0 2253 62 0 62 62 0 8 0 uvmvnodes 72 3118 0 0 57 0 57 57 0 8 0 vnodes 200 3118 0 0 165 0 165 165 0 8 0 namei 1024 11492 0 11492 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 10482 0 10482 9 8 1 6 0 8 1 plimitpl 152 58 0 49 1 0 1 1 0 8 0 sigapl 432 956 0 940 3 1 2 3 0 8 0 futexpl 56 9231 0 9231 1 0 1 1 0 8 1 knotepl 112 197 0 178 1 0 1 1 0 8 0 kqueuepl 104 166 0 164 1 0 1 1 0 8 0 pipepl 112 482 0 463 1 0 1 1 0 8 0 fdescpl 488 957 0 940 3 0 3 3 0 8 0 filepl 152 5327 0 5223 6 1 5 5 0 8 0 lockfpl 104 325 0 325 2 1 1 1 0 8 1 lockfspl 48 115 0 115 2 1 1 1 0 8 1 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 34 0 23 1 0 1 1 0 8 0 ucredpl 96 883 0 874 1 0 1 1 0 8 0 zombiepl 144 940 0 940 2 1 1 1 0 8 1 processpl 896 973 0 940 4 0 4 4 0 8 0 procpl 632 2612 0 2567 8 3 5 5 0 8 1 srpgc 64 2 0 2 1 0 1 1 0 8 1 sosppl 128 17 0 17 4 3 1 1 0 8 1 sockpl 384 681 0 660 4 1 3 3 0 8 0 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 5 0 0 1 0 1 1 0 8 0 mcl4k 4096 8 0 0 1 0 1 1 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 263 0 0 31 0 31 31 0 8 0 mtagpl 80 9 0 0 1 0 1 1 0 8 0 mbufpl 256 291 0 0 18 0 18 18 0 8 0 bufpl 256 7075 0 1166 370 0 370 370 0 8 0 anonpl 16 98277 0 86300 76 21 55 65 0 125 5 amapchunkpl 152 5573 0 5460 16 11 5 9 0 158 0 amappl16 192 4125 0 3468 51 16 35 41 0 8 2 amappl15 184 354 0 352 1 0 1 1 0 8 0 amappl14 176 411 0 402 1 0 1 1 0 8 0 amappl13 168 9 0 8 1 0 1 1 0 8 0 amappl12 160 5 0 4 2 1 1 1 0 8 0 amappl11 152 429 0 412 1 0 1 1 0 8 0 amappl10 144 70 0 67 1 0 1 1 0 8 0 amappl9 136 594 0 591 1 0 1 1 0 8 0 amappl8 128 168 0 146 1 0 1 1 0 8 0 amappl7 120 35 0 31 1 0 1 1 0 8 0 amappl6 112 429 0 420 1 0 1 1 0 8 0 amappl5 104 149 0 133 1 0 1 1 0 8 0 amappl4 96 867 0 836 2 1 1 2 0 8 0 amappl3 88 909 0 895 1 0 1 1 0 8 0 amappl2 80 6803 0 6723 3 1 2 3 0 8 0 amappl1 72 30101 0 29656 25 15 10 19 0 8 0 amappl 80 2865 0 2825 1 0 1 1 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 dma64 64 259 0 259 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 39 0 3 1 0 1 1 0 8 0 uaddrrnd 24 957 0 940 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 957 0 940 1 0 1 1 0 8 0 vmmpekpl 168 10301 0 10268 2 0 2 2 0 8 0 vmmpepl 168 122159 0 120270 132 47 85 100 0 357 2 vmsppl 368 956 0 940 2 0 2 2 0 8 0 pdppl 4096 1921 0 1880 7 1 6 6 0 8 0 pvpl 32 293888 0 278657 188 38 150 162 0 265 27 pmappl 232 956 0 940 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 551 0 5 16 0 16 16 0 8 0