panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 235264 82458 0 0 0 0 syz-executor.0 * 3471 82458 0 0 0x4000000 1K 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(fffffd8064104b08) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800023c37490,1,ffff800020b29b48) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fac9580,c0106477,ffff800023c37490,1,fffffd807f7c6ae0,ffff800020b29b48) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8065f54d30,c0106477,ffff800023c37490,ffff800020b29b48) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b29b48,ffff800023c375a8,ffff800023c37610) at sys_ioctl+0x5b8 syscall(ffff800023c37680) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023c37680) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,9f8057ac010) at Xsyscall+0x128 end of kernel end trace frame: 0x9fa4256b900, 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(fffffd8064104b08) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800023c37490,1,ffff800020b29b48) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fac9580,c0106477,ffff800023c37490,1,fffffd807f7c6ae0,ffff800020b29b48) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8065f54d30,c0106477,ffff800023c37490,ffff800020b29b48) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b29b48,ffff800023c375a8,ffff800023c37610) at sys_ioctl+0x5b8 syscall(ffff800023c37680) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800023c37680) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,9f8057ac010) at Xsyscall+0x128 end of kernel end trace frame: 0x9fa4256b900, count: -9 ddb{1}> show registers rdi 0xffffffff810a6987 db_enter+0x17 rsi 0x7093 __ALIGN_SIZE+0x6093 rbp 0xffff800023c37050 rbx 0xffff800023c37100 rdx 0x7094 __ALIGN_SIZE+0x6094 rcx 0xffff800020bfe000 rax 0xffff800020bfe000 r8 0xffffffff81491283 kprintf+0x173 r9 0x1 r10 0x25 r11 0xadd05d4bb327a2ab r12 0x3000000008 r13 0xffff800023c37060 r14 0x100 r15 0x1 rip 0xffffffff810a6988 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023c37040 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=3471 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=74, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28510,0xffff800020b28a10 process=0xffff800020b7ce00 user=0xffff800023c32000, vmspace=0xfffffd807f00c450 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 10298 359569 53683 0 2 0 syz-executor.1 10298 259941 53683 0 3 0x4000080 fsleep syz-executor.1 82458 235264 43188 0 7 0 syz-executor.0 *82458 3471 43188 0 7 0x4000000 syz-executor.0 82458 122243 43188 0 3 0x4000080 fsleep syz-executor.0 91027 382938 1 0 3 0x100083 ttyin getty 17921 228986 0 0 3 0x14200 bored sosplice 53683 521826 3730 0 3 0x82 nanosleep syz-executor.1 43188 278275 3730 0 3 0x82 nanosleep syz-executor.0 3730 206054 18501 0 3 0x82 kqread syz-fuzzer 3730 513473 18501 0 3 0x4000082 nanosleep syz-fuzzer 3730 33846 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 35285 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 228773 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 261652 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 423234 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 11129 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 454315 18501 0 3 0x4000082 thrsleep syz-fuzzer 3730 14451 18501 0 3 0x4000082 thrsleep syz-fuzzer 18501 455298 68369 0 3 0x10008a pause ksh 68369 462963 21251 0 3 0x92 select sshd 21251 390078 1 0 3 0x80 select sshd 98684 321846 67309 74 3 0x100092 bpf pflogd 67309 47468 1 0 3 0x80 netio pflogd 51471 352345 25275 73 3 0x100090 kqread syslogd 25275 234927 1 0 3 0x100082 netio syslogd 53182 91390 1 77 3 0x100090 poll dhclient 33547 332045 1 0 3 0x80 poll dhclient 37695 142959 0 0 2 0x14200 zerothread 31487 118757 0 0 3 0x14200 aiodoned aiodoned 23177 171679 0 0 3 0x14200 syncer update 84189 99791 0 0 3 0x14200 cleaner cleaner 57126 259045 0 0 3 0x14200 reaper reaper 65945 175959 0 0 3 0x14200 pgdaemon pagedaemon 66103 118125 0 0 3 0x14200 bored crynlk 66415 121227 0 0 3 0x14200 bored crypto 48870 382879 0 0 3 0x40014200 acpi0 acpi0 60532 205918 0 0 3 0x40014200 idle1 6329 494509 0 0 3 0x14200 bored softnet 63325 45478 0 0 3 0x14200 bored systqmp 10619 25348 0 0 3 0x14200 bored systq 94806 156014 0 0 3 0x40014200 bored softclock 92811 118102 0 0 3 0x40014200 idle0 64490 59529 0 0 3 0x14200 bored smr 1 157216 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 82458 (syz-executor.0) thread 0xffff800020b29b48 (3471) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82363570) #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 9563 6571K 7080K 78643K 14357 0 0 pcb 13 8K 8K 78643K 123 0 0 rtable 108 4K 4K 78643K 430 0 0 ifaddr 69 15K 15K 78643K 184 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1541 0 0 iov 0 0K 24K 78643K 197 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1213 76K 77K 78643K 2537 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 25 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 174 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 1415 0 0 sigio 0 0K 0K 78643K 13 0 0 proc 54 51K 83K 78643K 588 0 0 subproc 32 2K 2K 78643K 36 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 97 0 0 in_multi 33 2K 2K 78643K 59 0 0 ether_multi 1 0K 0K 78643K 1 0 0 mrt 0 0K 0K 78643K 9 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 362 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 30K 78643K 5518 0 0 UVM aobj 56 3K 3K 78643K 64 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 66 0 0 NDP 15 0K 0K 78643K 48 0 0 temp 193 2748K 2816K 78643K 7655 0 0 kqueue 0 0K 0K 78643K 18 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 61 0 59 1 0 1 1 0 8 0 rtentry 112 49 0 5 2 0 2 2 0 8 0 unpcb 120 421 0 409 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 8042 0 8042 3 3 0 2 0 8 0 tcpcb 544 270 0 266 1 0 1 1 0 8 0 inpcb 280 692 0 684 1 0 1 1 0 8 0 rttmr 72 4 0 4 2 1 1 1 0 8 1 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 4 0 4 1 1 0 1 0 8 0 ppxss 1128 25 0 25 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 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 34 0 15 1 0 1 1 0 8 0 pfstkey 112 34 0 15 1 0 1 1 0 8 0 pfstate 328 34 0 15 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 48 0 8 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 3 1 0 1 1 0 8 0 semapl 112 172 0 162 1 0 1 1 0 8 0 shmpl 112 62 0 8 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3692 0 2274 47 0 47 47 0 8 0 ffsino 272 3692 0 2274 96 0 96 96 0 8 0 nchpl 144 5912 0 4264 62 0 62 62 0 8 0 uvmvnodes 72 4636 0 0 85 0 85 85 0 8 0 vnodes 200 4636 0 0 244 0 244 244 0 8 0 namei 1024 18122 0 18122 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 2 1 1 1 0 8 1 scxspl 192 17580 0 17580 14 13 1 6 0 8 1 plimitpl 152 137 0 129 1 0 1 1 0 8 0 sigapl 432 1617 0 1601 3 1 2 3 0 8 0 futexpl 56 17773 0 17771 1 0 1 1 0 8 0 knotepl 112 283 0 264 1 0 1 1 0 8 0 kqueuepl 104 286 0 284 1 0 1 1 0 8 0 pipepl 112 938 0 919 3 1 2 2 0 8 1 fdescpl 488 1618 0 1601 3 0 3 3 0 8 0 filepl 152 9490 0 9388 8 3 5 7 0 8 1 lockfpl 104 452 0 452 2 1 1 1 0 8 1 lockfspl 48 159 0 159 2 1 1 1 0 8 1 sessionpl 112 20 0 9 1 0 1 1 0 8 0 pgrppl 48 31 0 20 1 0 1 1 0 8 0 ucredpl 96 1821 0 1812 1 0 1 1 0 8 0 zombiepl 144 1601 0 1601 2 1 1 1 0 8 1 processpl 896 1634 0 1601 4 0 4 4 0 8 0 procpl 632 4697 0 4652 8 3 5 5 0 8 1 srpgc 64 4 0 4 2 1 1 1 0 8 1 sosppl 128 21 0 21 4 4 0 1 0 8 0 sockpl 384 1190 0 1168 5 2 3 4 0 8 0 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 15 0 0 2 0 2 2 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 9 0 0 2 0 2 2 0 8 0 mcl4k 4096 13 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 209 0 0 24 0 24 24 0 8 0 mtagpl 80 26 0 0 1 0 1 1 0 8 0 mbufpl 256 227 0 0 13 0 13 13 0 8 0 bufpl 256 8987 0 1958 440 0 440 440 0 8 0 anonpl 16 143447 0 131673 84 26 58 64 0 125 10 amapchunkpl 152 9153 0 9039 20 1 19 19 0 158 12 amappl16 192 7472 0 6826 56 21 35 45 0 8 2 amappl14 176 52 0 46 1 0 1 1 0 8 0 amappl13 168 682 0 680 2 1 1 1 0 8 0 amappl12 160 713 0 710 1 0 1 1 0 8 0 amappl11 152 60 0 45 1 0 1 1 0 8 0 amappl10 144 83 0 80 1 0 1 1 0 8 0 amappl9 136 599 0 596 1 0 1 1 0 8 0 amappl8 128 157 0 136 1 0 1 1 0 8 0 amappl7 120 36 0 32 1 0 1 1 0 8 0 amappl6 112 60 0 53 1 0 1 1 0 8 0 amappl5 104 842 0 826 1 0 1 1 0 8 0 amappl4 96 1892 0 1859 2 1 1 2 0 8 0 amappl3 88 219 0 209 1 0 1 1 0 8 0 amappl2 80 12803 0 12722 3 1 2 3 0 8 0 amappl1 72 44014 0 43557 25 15 10 20 0 8 0 amappl 80 4964 0 4922 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 63 0 8 1 0 1 1 0 8 0 uaddrrnd 24 1618 0 1601 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1618 0 1601 1 0 1 1 0 8 0 vmmpekpl 168 15500 0 15469 2 0 2 2 0 8 0 vmmpepl 168 201244 0 199355 138 54 84 100 0 357 1 vmsppl 368 1617 0 1601 2 0 2 2 0 8 0 pdppl 4096 3243 0 3202 7 1 6 6 0 8 0 pvpl 32 433167 0 418141 195 44 151 157 0 265 28 pmappl 232 1617 0 1601 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 611 0 5 18 0 18 18 0 8 0