panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *197865 59595 0 0 0x4000000 1K syz-executor.0 317011 68860 0 0x14000 0x200 0 reaper 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(fffffd8064161858) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021c414d0,1,ffff800020b5e018) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab77d8,c0106477,ffff800021c414d0,1,fffffd807f7c6900,ffff800020b5e018) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8065b7f260,c0106477,ffff800021c414d0,ffff800020b5e018) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b5e018,ffff800021c415e8,ffff800021c41650) at sys_ioctl+0x5b8 syscall(ffff800021c416c0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021c416c0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,f3f95f05010) at Xsyscall+0x128 end of kernel end trace frame: 0xf41de517470, 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(fffffd8064161858) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021c414d0,1,ffff800020b5e018) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab77d8,c0106477,ffff800021c414d0,1,fffffd807f7c6900,ffff800020b5e018) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8065b7f260,c0106477,ffff800021c414d0,ffff800020b5e018) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b5e018,ffff800021c415e8,ffff800021c41650) at sys_ioctl+0x5b8 syscall(ffff800021c416c0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021c416c0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,f3f95f05010) at Xsyscall+0x128 end of kernel end trace frame: 0xf41de517470, count: -9 ddb{1}> show registers rdi 0xffffffff818a6367 db_enter+0x17 rsi 0x66c1 __ALIGN_SIZE+0x56c1 rbp 0xffff800021c41090 rbx 0xffff800021c41140 rdx 0x66c2 __ALIGN_SIZE+0x56c2 rcx 0xffff800020c22000 rax 0xffff800020c22000 r8 0xffffffff817612d3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x5a41d077dbf41e1c r12 0x3000000008 r13 0xffff800021c410a0 r14 0x100 r15 0x1 rip 0xffffffff818a6368 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021c41080 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=197865 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b5f3d8,0xffff800020b5e2a0 process=0xffff800020b7dc00 user=0xffff800021c3c000, vmspace=0xfffffd807effd5c0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 59595 235600 61494 0 2 0 syz-executor.0 *59595 197865 61494 0 7 0x4000000 syz-executor.0 59595 232816 61494 0 2 0x4000000 syz-executor.0 10689 170543 1 0 3 0x100083 ttyin getty 55760 77020 0 0 3 0x14200 bored sosplice 63355 260433 74327 0 3 0x82 nanosleep syz-executor.1 61494 58749 74327 0 3 0x82 nanosleep syz-executor.0 74327 484175 63258 0 3 0x82 thrsleep syz-fuzzer 74327 382659 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 37567 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 490527 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 192078 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 207908 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 58189 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 489046 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 265069 63258 0 3 0x4000082 thrsleep syz-fuzzer 74327 147357 63258 0 3 0x4000082 kqread syz-fuzzer 63258 399460 50930 0 3 0x10008a pause ksh 50930 474806 6903 0 3 0x92 select sshd 6903 132908 1 0 3 0x80 select sshd 68507 228731 80600 74 3 0x100092 bpf pflogd 80600 135964 1 0 3 0x80 netio pflogd 13296 320268 77000 73 3 0x100090 kqread syslogd 77000 44806 1 0 3 0x100082 netio syslogd 61102 114844 1 77 3 0x100090 poll dhclient 54455 462136 1 0 3 0x80 poll dhclient 67709 303681 0 0 3 0x14200 pgzero zerothread 91006 242143 0 0 3 0x14200 aiodoned aiodoned 62673 141644 0 0 3 0x14200 syncer update 74128 415595 0 0 3 0x14200 cleaner cleaner 68860 317011 0 0 7 0x14200 reaper 34779 39244 0 0 3 0x14200 pgdaemon pagedaemon 58825 381201 0 0 3 0x14200 bored crynlk 68943 508342 0 0 3 0x14200 bored crypto 87229 16769 0 0 3 0x40014200 acpi0 acpi0 27123 382284 0 0 3 0x40014200 idle1 34887 273776 0 0 3 0x14200 bored softnet 19988 298813 0 0 3 0x14200 bored systqmp 81552 356610 0 0 3 0x14200 bored systq 38332 430585 0 0 3 0x40014200 bored softclock 98941 252122 0 0 3 0x40014200 idle0 74111 478832 0 0 3 0x14200 bored smr 1 191061 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 59595 (syz-executor.0) thread 0xffff800020b5e018 (197865) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff823a69a8) #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 9542 7324K 15050K 78643K 13192 0 0 pcb 13 8K 8K 78643K 67 0 0 rtable 86 3K 4K 78643K 387 0 0 ifaddr 52 12K 14K 78643K 145 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1518 0 0 iov 0 0K 36K 78643K 101 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1223 77K 77K 78643K 2102 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 17 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 38 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 920 0 0 sigio 0 0K 0K 78643K 3 0 0 proc 54 51K 83K 78643K 535 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 101 0 0 in_multi 22 1K 2K 78643K 43 0 0 ether_multi 1 0K 0K 78643K 1 0 0 mrt 0 0K 0K 78643K 5 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 78 344K 344K 78643K 78 0 0 exec 0 0K 1K 78643K 272 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 103 21K 30K 78643K 3955 0 0 UVM aobj 40 2K 2K 78643K 53 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 26 0 0 NDP 11 0K 0K 78643K 40 0 0 temp 166 2747K 3378K 78643K 6211 0 0 kqueue 0 0K 0K 78643K 8 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 44 0 42 1 0 1 1 0 8 0 rtentry 112 47 0 14 2 0 2 2 0 8 0 unpcb 120 287 0 275 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 8052 0 8052 2 2 0 2 0 8 0 tcpcb 544 152 0 148 1 0 1 1 0 8 0 inpcb 280 397 0 390 1 0 1 1 0 8 0 rttmr 72 2 0 2 2 1 1 1 0 8 1 nd6 48 6 0 3 1 0 1 1 0 8 0 pkpcb 40 6 0 6 2 2 0 1 0 8 0 ppxss 1128 12 0 12 3 3 0 1 0 8 0 pffrent 40 2 0 2 1 1 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 16 0 11 1 0 1 1 0 8 0 pfstkey 112 16 0 11 1 0 1 1 0 8 0 pfstate 328 16 0 11 1 0 1 1 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 189 0 44 12 0 12 12 0 8 0 art_table 32 190 0 44 2 0 2 2 0 8 0 art_node 16 46 0 16 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 5 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 36 0 26 1 0 1 1 0 8 0 shmpl 112 51 0 13 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2871 0 1446 47 0 47 47 0 8 0 ffsino 272 2871 0 1446 96 0 96 96 0 8 0 nchpl 144 4396 0 2747 62 0 62 62 0 8 0 uvmvnodes 72 3536 0 0 65 0 65 65 0 8 0 vnodes 200 3536 0 0 187 0 187 187 0 8 0 namei 1024 13067 0 13067 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 3 0 3 2 2 0 1 0 8 0 scxspl 192 12203 0 12203 7 6 1 6 0 8 1 plimitpl 152 101 0 93 1 0 1 1 0 8 0 sigapl 432 1121 0 1106 3 1 2 3 0 8 0 futexpl 56 10503 0 10503 2 1 1 1 0 8 1 knotepl 112 212 0 193 1 0 1 1 0 8 0 kqueuepl 104 193 0 191 1 0 1 1 0 8 0 pipepl 112 576 0 557 2 1 1 2 0 8 0 fdescpl 488 1122 0 1106 3 0 3 3 0 8 0 filepl 152 6392 0 6291 6 1 5 5 0 8 0 lockfpl 104 303 0 303 3 2 1 1 0 8 1 lockfspl 48 100 0 100 3 2 1 1 0 8 1 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 35 0 24 1 0 1 1 0 8 0 ucredpl 96 1184 0 1175 1 0 1 1 0 8 0 zombiepl 144 1106 0 1105 3 2 1 1 0 8 0 processpl 896 1138 0 1105 4 0 4 4 0 8 0 procpl 632 3167 0 3123 7 2 5 5 0 8 1 srpgc 64 4 0 4 2 1 1 1 0 8 1 sosppl 128 11 0 11 2 2 0 1 0 8 0 sockpl 384 742 0 721 5 2 3 3 0 8 0 mcl64k 65536 260 0 0 33 0 33 33 0 8 0 mcl12k 12288 7 0 0 1 0 1 1 0 8 0 mcl9k 9216 6 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 10 0 0 2 0 2 2 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 205 0 0 25 0 25 25 0 8 0 mtagpl 80 19 0 0 1 0 1 1 0 8 0 mbufpl 256 394 0 0 23 1 22 22 0 8 0 bufpl 256 7850 0 1172 418 0 418 418 0 8 0 anonpl 16 107975 0 96372 72 13 59 63 0 125 12 amapchunkpl 152 6349 0 6210 21 10 11 11 0 158 5 amappl16 192 4639 0 4028 44 8 36 43 0 8 5 amappl15 184 437 0 434 1 0 1 1 0 8 0 amappl14 176 485 0 479 1 0 1 1 0 8 0 amappl13 168 6 0 6 1 1 0 1 0 8 0 amappl12 160 5 0 4 2 1 1 1 0 8 0 amappl11 152 522 0 504 1 0 1 1 0 8 0 amappl10 144 73 0 71 1 0 1 1 0 8 0 amappl9 136 605 0 602 1 0 1 1 0 8 0 amappl8 128 153 0 134 1 0 1 1 0 8 0 amappl7 120 36 0 31 1 0 1 1 0 8 0 amappl6 112 512 0 502 1 0 1 1 0 8 0 amappl5 104 135 0 121 1 0 1 1 0 8 0 amappl4 96 1387 0 1354 2 1 1 2 0 8 0 amappl3 88 213 0 202 1 0 1 1 0 8 0 amappl2 80 8515 0 8434 3 1 2 3 0 8 0 amappl1 72 33850 0 33388 25 15 10 20 0 8 0 amappl 80 3423 0 3375 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 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 52 0 13 1 0 1 1 0 8 0 uaddrrnd 24 1122 0 1106 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1122 0 1106 1 0 1 1 0 8 0 vmmpekpl 168 13217 0 13189 2 0 2 2 0 8 0 vmmpepl 168 140869 0 139040 127 40 87 91 0 357 6 vmsppl 368 1121 0 1105 2 0 2 2 0 8 0 pdppl 4096 2252 0 2210 6 0 6 6 0 8 0 pvpl 32 317824 0 303103 188 37 151 157 0 265 31 pmappl 232 1121 0 1105 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 629 0 5 18 0 18 18 0 8 0