panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 421893 44222 0 0 0x4000000 1 syz-executor.0 *330848 72070 0 0 0x4000000 0K 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(fffffd807c4965d0) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800020b5b180,1,ffff800020b28ee8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fabd8a0,c0106477,ffff800020b5b180,1,fffffd807f7c6840,ffff800020b28ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067e81b68,c0106477,ffff800020b5b180,ffff800020b28ee8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b28ee8,ffff800020b5b298,ffff800020b5b300) at sys_ioctl+0x5b8 syscall(ffff800020b5b370) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800020b5b370) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,43c571e9010) at Xsyscall+0x128 end of kernel end trace frame: 0x43f0dbe3930, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic vrele: v_writecount != 0 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 vrele(fffffd807c4965d0) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800020b5b180,1,ffff800020b28ee8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fabd8a0,c0106477,ffff800020b5b180,1,fffffd807f7c6840,ffff800020b28ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067e81b68,c0106477,ffff800020b5b180,ffff800020b28ee8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b28ee8,ffff800020b5b298,ffff800020b5b300) at sys_ioctl+0x5b8 syscall(ffff800020b5b370) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800020b5b370) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,43c571e9010) at Xsyscall+0x128 end of kernel end trace frame: 0x43f0dbe3930, count: -9 ddb{0}> show registers rdi 0xffffffff81b7cd57 db_enter+0x17 rsi 0x61cc __ALIGN_SIZE+0x51cc rbp 0xffff800020b5ad40 rbx 0xffff800020b5adf0 rdx 0x61cd __ALIGN_SIZE+0x51cd rcx 0xffff800021a26000 rax 0xffff800021a26000 r8 0xffffffff81ecbab3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x4f5bc2efe6ef6b7 r12 0x3000000008 r13 0xffff800020b5ad50 r14 0x100 r15 0x1 rip 0xffffffff81b7cd58 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020b5ad30 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=330848 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28780,0xffff800020b28a08 process=0xffff800020b7c700 user=0xffff800020b56000, vmspace=0xfffffd807effe170 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 44222 155878 98349 0 2 0 syz-executor.0 44222 301749 98349 0 3 0x4000080 fsleep syz-executor.0 44222 490632 98349 0 3 0x4000080 fsleep syz-executor.0 44222 421893 98349 0 7 0x4000000 syz-executor.0 72070 163948 90571 0 2 0 syz-executor.1 *72070 330848 90571 0 7 0x4000000 syz-executor.1 72070 282120 90571 0 2 0x4000000 syz-executor.1 89009 141890 1 0 3 0x100083 ttyin getty 7592 515353 0 0 3 0x14200 bored sosplice 90571 445055 99650 0 2 0x482 syz-executor.1 98349 233678 99650 0 2 0x482 syz-executor.0 99650 373244 64860 0 3 0x82 thrsleep syz-fuzzer 99650 10526 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 241574 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 91863 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 166257 64860 0 3 0x4000082 kqread syz-fuzzer 99650 276210 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 326955 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 62320 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 470612 64860 0 3 0x4000082 thrsleep syz-fuzzer 99650 168852 64860 0 3 0x4000082 thrsleep syz-fuzzer 64860 77216 15024 0 3 0x10008a pause ksh 15024 445171 84085 0 3 0x92 select sshd 84085 290760 1 0 3 0x80 select sshd 84357 169572 40341 74 3 0x100092 bpf pflogd 40341 128615 1 0 3 0x80 netio pflogd 70398 190491 2376 73 2 0x100090 syslogd 2376 175943 1 0 3 0x100082 netio syslogd 33754 460162 1 77 3 0x100090 poll dhclient 75740 270142 1 0 3 0x80 poll dhclient 37962 212493 0 0 2 0x14200 zerothread 28549 129491 0 0 3 0x14200 aiodoned aiodoned 74807 316259 0 0 3 0x14200 syncer update 30711 115117 0 0 3 0x14200 cleaner cleaner 88528 16737 0 0 3 0x14200 reaper reaper 22974 165911 0 0 3 0x14200 pgdaemon pagedaemon 6122 131843 0 0 3 0x14200 bored crynlk 20515 121104 0 0 3 0x14200 bored crypto 30519 309749 0 0 3 0x40014200 acpi0 acpi0 76282 379252 0 0 3 0x40014200 idle1 15611 283618 0 0 3 0x14200 bored softnet 18914 522646 0 0 3 0x14200 bored systqmp 46263 92702 0 0 3 0x14200 bored systq 46655 178339 0 0 2 0x40014200 softclock 45467 50513 0 0 3 0x40014200 idle0 37814 162682 0 0 3 0x14200 bored smr 1 370080 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 72070 (syz-executor.1) thread 0xffff800020b28ee8 (330848) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8239e0c8) #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9542 6418K 6936K 78643K 13534 0 0 pcb 15 8K 8K 78643K 105 0 0 rtable 108 4K 4K 78643K 384 0 0 ifaddr 65 14K 15K 78643K 160 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1525 0 0 iov 0 0K 16K 78643K 121 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1208 76K 77K 78643K 2201 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 16 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 108 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 1069 0 0 sigio 0 0K 0K 78643K 21 0 0 proc 54 51K 83K 78643K 561 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 88 0 0 in_multi 33 2K 2K 78643K 74 0 0 ether_multi 1 0K 0K 78643K 6 0 0 mrt 0 0K 0K 78643K 8 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 266 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 111 22K 31K 78643K 4510 0 0 UVM aobj 50 2K 2K 78643K 60 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 62 0 0 NDP 14 0K 0K 78643K 42 0 0 temp 186 2747K 2813K 78643K 6695 0 0 kqueue 0 0K 0K 78643K 14 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 6 0 0 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 50 0 6 2 0 2 2 0 8 0 unpcb 120 311 0 299 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 6882 0 6882 3 3 0 2 0 8 0 tcpcb 544 148 0 144 1 0 1 1 0 8 0 inpcb 280 480 0 471 1 0 1 1 0 8 0 rttmr 72 3 0 3 3 3 0 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 10 0 10 4 3 1 1 0 8 1 ppxss 1128 23 0 23 4 3 1 1 0 8 1 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 28 0 12 1 0 1 1 0 8 0 pfstkey 112 28 0 12 1 0 1 1 0 8 0 pfstate 328 28 0 12 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 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 47 0 7 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 6 3 2 1 1 0 8 0 semapl 112 106 0 96 1 0 1 1 0 8 0 shmpl 112 58 0 10 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3116 0 1700 47 0 47 47 0 8 0 ffsino 272 3116 0 1700 96 0 96 96 0 8 0 nchpl 144 4775 0 3122 62 0 62 62 0 8 0 uvmvnodes 72 3865 0 0 71 0 71 71 0 8 0 vnodes 200 3865 0 0 204 0 204 204 0 8 0 namei 1024 14215 0 14215 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 1 0 1 1 0 8 1 scxspl 192 14680 0 14680 15 14 1 6 0 8 1 plimitpl 152 103 0 95 1 0 1 1 0 8 0 sigapl 432 1270 0 1254 3 1 2 3 0 8 0 futexpl 56 12404 0 12402 1 0 1 1 0 8 0 knotepl 112 259 0 240 1 0 1 1 0 8 0 kqueuepl 104 209 0 207 1 0 1 1 0 8 0 pipepl 112 668 0 649 3 1 2 2 0 8 1 fdescpl 488 1271 0 1254 3 0 3 3 0 8 0 filepl 152 7086 0 6981 6 1 5 5 0 8 0 lockfpl 104 485 0 485 3 2 1 1 0 8 1 lockfspl 48 157 0 157 3 2 1 1 0 8 1 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 25 0 14 1 0 1 1 0 8 0 ucredpl 96 1192 0 1183 1 0 1 1 0 8 0 zombiepl 144 1254 0 1254 3 2 1 1 0 8 1 processpl 896 1287 0 1254 4 0 4 4 0 8 0 procpl 632 3694 0 3647 6 1 5 5 0 8 1 srpgc 64 3 0 3 3 3 0 1 0 8 0 sosppl 128 22 0 22 3 3 0 1 0 8 0 sockpl 384 862 0 839 4 1 3 3 0 8 0 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 10 0 0 2 0 2 2 0 8 0 mcl4k 4096 7 0 0 1 0 1 1 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 231 0 0 27 0 27 27 0 8 0 mtagpl 80 31 0 0 1 0 1 1 0 8 0 mbufpl 256 285 0 0 16 0 16 16 0 8 0 bufpl 256 8593 0 1564 440 0 440 440 0 8 0 anonpl 16 119922 0 108222 84 29 55 64 0 125 7 amapchunkpl 152 7544 0 7402 26 16 10 11 0 158 4 amappl16 192 5902 0 5285 54 22 32 43 0 8 1 amappl15 184 18 0 16 1 0 1 1 0 8 0 amappl14 176 55 0 49 1 0 1 1 0 8 0 amappl13 168 7 0 7 1 1 0 1 0 8 0 amappl12 160 4 0 3 2 1 1 1 0 8 0 amappl11 152 60 0 45 1 0 1 1 0 8 0 amappl10 144 1109 0 1101 1 0 1 1 0 8 0 amappl9 136 602 0 599 1 0 1 1 0 8 0 amappl8 128 154 0 133 1 0 1 1 0 8 0 amappl7 120 1074 0 1064 1 0 1 1 0 8 0 amappl6 112 60 0 52 1 0 1 1 0 8 0 amappl5 104 137 0 123 1 0 1 1 0 8 0 amappl4 96 1539 0 1507 2 1 1 2 0 8 0 amappl3 88 207 0 194 1 0 1 1 0 8 0 amappl2 80 9283 0 9202 3 0 3 3 0 8 0 amappl1 72 36868 0 36415 26 16 10 20 0 8 0 amappl 80 3954 0 3905 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 59 0 10 1 0 1 1 0 8 0 uaddrrnd 24 1271 0 1254 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1271 0 1254 1 0 1 1 0 8 0 vmmpekpl 168 13893 0 13865 2 0 2 2 0 8 0 vmmpepl 168 159167 0 157297 144 60 84 93 0 357 2 vmsppl 368 1270 0 1254 2 0 2 2 0 8 0 pdppl 4096 2550 0 2508 6 0 6 6 0 8 0 pvpl 32 366567 0 351534 200 59 141 157 0 265 17 pmappl 232 1270 0 1254 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 615 0 4 18 0 18 18 0 8 0