panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *195693 62835 0 0 0x4000000 1K syz-executor.0 316038 62835 0 0 0x4000000 0 syz-executor.0 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(fffffd8067fd4cf8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021c37750,1,ffff800020b28c70) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806faab4b8,c0106477,ffff800021c37750,1,fffffd807f7c6a80,ffff800020b28c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80677fbef8,c0106477,ffff800021c37750,ffff800020b28c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020b28c70,ffff800021c37868,ffff800021c378d0) at sys_ioctl+0x5b8 syscall(ffff800021c37940) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021c37940) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,dcb2ff30010) at Xsyscall+0x128 end of kernel end trace frame: 0xdcdf8b3fb20, 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(fffffd8067fd4cf8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021c37750,1,ffff800020b28c70) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806faab4b8,c0106477,ffff800021c37750,1,fffffd807f7c6a80,ffff800020b28c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80677fbef8,c0106477,ffff800021c37750,ffff800020b28c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020b28c70,ffff800021c37868,ffff800021c378d0) at sys_ioctl+0x5b8 syscall(ffff800021c37940) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021c37940) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,dcb2ff30010) at Xsyscall+0x128 end of kernel end trace frame: 0xdcdf8b3fb20, count: -9 ddb{1}> show registers rdi 0xffffffff812b5187 db_enter+0x17 rsi 0x7c45 __ALIGN_SIZE+0x6c45 rbp 0xffff800021c37310 rbx 0xffff800021c373c0 rdx 0x7c46 __ALIGN_SIZE+0x6c46 rcx 0xffff800021e22000 rax 0xffff800021e22000 r8 0xffffffff8116f7e3 kprintf+0x173 r9 0x1 r10 0x25 r11 0xbf7f7576cb6ba364 r12 0x3000000008 r13 0xffff800021c37320 r14 0x100 r15 0x1 rip 0xffffffff812b5188 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021c37300 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=195693 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b289f8,0xffff800020b28790 process=0xffff800020b7d880 user=0xffff800021c32000, vmspace=0xfffffd807effd000 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 62835 358979 70800 0 2 0 syz-executor.0 *62835 195693 70800 0 7 0x4000000 syz-executor.0 62835 316038 70800 0 7 0x4000000 syz-executor.0 73660 319862 51787 0 3 0x82 nanosleep syz-executor.1 70800 492912 51787 0 3 0x82 nanosleep syz-executor.0 51787 20176 2890 0 3 0x82 thrsleep syz-fuzzer 51787 223797 2890 0 3 0x4000082 nanosleep syz-fuzzer 51787 499453 2890 0 3 0x4000082 thrsleep syz-fuzzer 51787 152892 2890 0 3 0x4000082 thrsleep syz-fuzzer 51787 350318 2890 0 3 0x4000082 thrsleep syz-fuzzer 51787 267937 2890 0 3 0x4000082 thrsleep syz-fuzzer 51787 142142 2890 0 3 0x4000082 thrsleep syz-fuzzer 51787 382790 2890 0 3 0x4000082 kqread syz-fuzzer 51787 223722 2890 0 3 0x4000082 thrsleep syz-fuzzer 51787 400323 2890 0 3 0x4000082 thrsleep syz-fuzzer 2890 440943 37244 0 3 0x10008a pause ksh 37244 109655 53685 0 3 0x92 select sshd 25435 480639 1 0 3 0x100083 ttyin getty 53685 287927 1 0 3 0x80 select sshd 1108 236357 21503 74 3 0x100092 bpf pflogd 21503 411643 1 0 3 0x80 netio pflogd 18970 420149 46261 73 3 0x100090 kqread syslogd 46261 285416 1 0 3 0x100082 netio syslogd 34102 447569 1 77 3 0x100090 poll dhclient 93611 44539 1 0 3 0x80 poll dhclient 61218 346376 0 0 2 0x14200 zerothread 73259 223773 0 0 3 0x14200 aiodoned aiodoned 38477 120341 0 0 3 0x14200 syncer update 68570 289187 0 0 3 0x14200 cleaner cleaner 83055 118378 0 0 3 0x14200 reaper reaper 92752 481947 0 0 3 0x14200 pgdaemon pagedaemon 29447 474997 0 0 3 0x14200 bored crynlk 4023 99381 0 0 3 0x14200 bored crypto 24898 342796 0 0 3 0x40014200 acpi0 acpi0 27648 338393 0 0 3 0x40014200 idle1 31615 14657 0 0 3 0x14200 bored softnet 29808 351784 0 0 3 0x14200 bored systqmp 87601 106720 0 0 3 0x14200 bored systq 34001 354030 0 0 3 0x40014200 bored softclock 26049 1904 0 0 3 0x40014200 idle0 8700 132014 0 0 3 0x14200 bored smr 1 498636 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 62835 (syz-executor.0) thread 0xffff800020b28c70 (195693) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82374c30) #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+0xb7 sys/kern/vfs_vnops.c:524 #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 9468 6389K 6776K 78643K 10721 0 0 pcb 13 8K 8K 78643K 25 0 0 rtable 105 3K 3K 78643K 203 0 0 ifaddr 38 10K 10K 78643K 39 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1470 0 0 iov 0 0K 12K 78643K 6 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1218 76K 77K 78643K 1287 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 3 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 19 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 118 0 0 proc 53 50K 83K 78643K 425 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 10 0 0 in_multi 33 2K 2K 78643K 39 0 0 ether_multi 1 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 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 214 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 101 21K 22K 78643K 1289 0 0 UVM aobj 2 2K 2K 78643K 2 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 8 0 0 NDP 6 0K 0K 78643K 10 0 0 temp 92 2733K 2799K 78643K 3534 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 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 21 0 19 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 51 0 39 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 8122 0 8122 3 1 2 2 0 8 2 tcpcb 544 29 0 25 1 0 1 1 0 8 0 inpcb 280 80 0 73 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 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 15 0 2 1 0 1 1 0 8 0 pfstkey 112 15 0 2 1 0 1 1 0 8 0 pfstate 328 15 0 2 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 0 12 0 12 12 0 8 0 art_table 32 189 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 semapl 112 17 0 7 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1587 0 157 47 0 47 47 0 8 0 ffsino 272 1587 0 157 96 0 96 96 0 8 0 nchpl 144 1960 0 309 62 0 62 62 0 8 0 uvmvnodes 72 1672 0 0 31 0 31 31 0 8 0 vnodes 200 1672 0 0 88 0 88 88 0 8 0 namei 1024 5188 0 5188 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 4808 0 4808 9 7 2 6 0 8 2 plimitpl 152 19 0 11 1 0 1 1 0 8 0 sigapl 432 318 0 303 3 0 3 3 0 8 1 futexpl 56 1130 0 1130 1 0 1 1 0 8 1 knotepl 112 53 0 34 1 0 1 1 0 8 0 kqueuepl 104 7 0 5 1 0 1 1 0 8 0 pipepl 112 200 0 181 1 0 1 1 0 8 0 fdescpl 488 319 0 303 3 0 3 3 0 8 0 filepl 152 1633 0 1532 6 1 5 5 0 8 1 lockfpl 104 45 0 45 2 1 1 1 0 8 1 lockfspl 48 18 0 18 2 1 1 1 0 8 1 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 171 0 162 1 0 1 1 0 8 0 zombiepl 144 303 0 302 2 1 1 1 0 8 0 processpl 896 334 0 302 4 0 4 4 0 8 0 procpl 632 524 0 481 5 0 5 5 0 8 1 sockpl 384 152 0 131 4 1 3 3 0 8 0 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 1 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 271 0 0 31 0 31 31 0 8 0 mtagpl 80 7 0 0 1 0 1 1 0 8 0 mbufpl 256 293 0 0 17 0 17 17 0 8 0 bufpl 256 5803 0 1166 290 0 290 290 0 8 0 anonpl 16 39062 0 27910 47 1 46 46 0 125 0 amapchunkpl 152 1442 0 1334 8 1 7 7 0 158 1 amappl16 192 1107 0 495 31 0 31 31 0 8 0 amappl15 184 5 0 5 1 0 1 1 0 8 1 amappl14 176 50 0 45 1 0 1 1 0 8 0 amappl13 168 6 0 6 1 1 0 1 0 8 0 amappl12 160 44 0 41 2 1 1 1 0 8 0 amappl11 152 60 0 45 1 0 1 1 0 8 0 amappl10 144 78 0 74 1 0 1 1 0 8 0 amappl9 136 601 0 598 1 0 1 1 0 8 0 amappl8 128 161 0 138 1 0 1 1 0 8 0 amappl7 120 35 0 31 1 0 1 1 0 8 0 amappl6 112 70 0 60 1 0 1 1 0 8 0 amappl5 104 168 0 153 1 0 1 1 0 8 0 amappl4 96 575 0 545 2 1 1 2 0 8 0 amappl3 88 179 0 168 1 0 1 1 0 8 0 amappl2 80 1631 0 1560 3 1 2 3 0 8 0 amappl1 72 16976 0 16529 25 15 10 20 0 8 0 amappl 80 773 0 735 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 1 0 0 1 0 1 1 0 8 0 uaddrrnd 24 319 0 303 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 319 0 303 1 0 1 1 0 8 0 vmmpekpl 168 6673 0 6647 2 0 2 2 0 8 0 vmmpepl 168 45358 0 43602 124 32 92 92 0 357 15 vmsppl 368 318 0 303 2 0 2 2 0 8 0 pdppl 4096 646 0 606 6 0 6 6 0 8 0 pvpl 32 139645 0 125347 141 24 117 117 0 265 0 pmappl 232 318 0 303 2 0 2 2 0 8 1 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 469 0 4 14 0 14 14 0 8 0