panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *230780 23524 0 0 0x4000000 1K syz-executor.0 451486 23524 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(fffffd80668712a0) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021c0f2e0,1,ffff800020b6f418) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab9580,c0106477,ffff800021c0f2e0,1,fffffd807f7c6840,ffff800020b6f418) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066fdad30,c0106477,ffff800021c0f2e0,ffff800020b6f418) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b6f418,ffff800021c0f3f8,ffff800021c0f460) at sys_ioctl+0x5b8 syscall(ffff800021c0f4d0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021c0f4d0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,3ced5e1e010) at Xsyscall+0x128 end of kernel end trace frame: 0x3d1c332a790, 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(fffffd80668712a0) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021c0f2e0,1,ffff800020b6f418) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab9580,c0106477,ffff800021c0f2e0,1,fffffd807f7c6840,ffff800020b6f418) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066fdad30,c0106477,ffff800021c0f2e0,ffff800020b6f418) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b6f418,ffff800021c0f3f8,ffff800021c0f460) at sys_ioctl+0x5b8 syscall(ffff800021c0f4d0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021c0f4d0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,3ced5e1e010) at Xsyscall+0x128 end of kernel end trace frame: 0x3d1c332a790, count: -9 ddb{1}> show registers rdi 0xffffffff818591d7 db_enter+0x17 rsi 0x6d8f __ALIGN_SIZE+0x5d8f rbp 0xffff800021c0eea0 rbx 0xffff800021c0ef50 rdx 0x6d90 __ALIGN_SIZE+0x5d90 rcx 0xffff800020bfe000 rax 0xffff800020bfe000 r8 0xffffffff81a72513 kprintf+0x173 r9 0x1 r10 0x25 r11 0xbe845226d2d66bf r12 0x3000000008 r13 0xffff800021c0eeb0 r14 0x100 r15 0x1 rip 0xffffffff818591d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021c0ee90 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=230780 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b6fb80,0xffff800020b6e558 process=0xffff800020b7d500 user=0xffff800021c0a000, vmspace=0xfffffd807effea10 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 23088 291840 71819 0 3 0x80 nanosleep syz-executor.1 23088 224098 71819 0 3 0x4000080 fsleep syz-executor.1 23088 385745 71819 0 3 0x4000080 fsleep syz-executor.1 23524 361842 61152 0 2 0 syz-executor.0 *23524 230780 61152 0 7 0x4000000 syz-executor.0 23524 451486 61152 0 7 0x4000000 syz-executor.0 71819 203545 76245 0 3 0x82 nanosleep syz-executor.1 61152 173496 76245 0 3 0x82 nanosleep syz-executor.0 323 163842 1 0 3 0x100083 ttyin getty 28039 76683 0 0 3 0x14200 bored sosplice 76245 149422 13983 0 3 0x82 thrsleep syz-fuzzer 76245 347107 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 456661 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 58896 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 281179 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 475668 13983 0 3 0x4000082 kqread syz-fuzzer 76245 396008 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 108740 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 223397 13983 0 3 0x4000082 thrsleep syz-fuzzer 76245 159823 13983 0 3 0x4000082 thrsleep syz-fuzzer 13983 232201 4423 0 3 0x10008a pause ksh 4423 147676 69262 0 3 0x92 select sshd 69262 109402 1 0 3 0x80 select sshd 75913 24674 38267 74 3 0x100092 bpf pflogd 38267 232084 1 0 3 0x80 netio pflogd 77127 145245 6636 73 3 0x100090 kqread syslogd 6636 434361 1 0 3 0x100082 netio syslogd 93943 114222 1 77 3 0x100090 poll dhclient 38091 151649 1 0 3 0x80 poll dhclient 74156 245962 0 0 2 0x14200 zerothread 84337 520492 0 0 3 0x14200 aiodoned aiodoned 57919 60630 0 0 3 0x14200 syncer update 843 478291 0 0 3 0x14200 cleaner cleaner 56919 329288 0 0 3 0x14200 reaper reaper 16974 314362 0 0 3 0x14200 pgdaemon pagedaemon 16797 164265 0 0 3 0x14200 bored crynlk 3573 274330 0 0 3 0x14200 bored crypto 64945 325539 0 0 3 0x40014200 acpi0 acpi0 60068 156530 0 0 3 0x40014200 idle1 13956 491237 0 0 3 0x14200 bored softnet 85642 274587 0 0 3 0x14200 bored systqmp 31518 520724 0 0 3 0x14200 bored systq 95608 428062 0 0 3 0x40014200 bored softclock 46836 372669 0 0 3 0x40014200 idle0 98165 176608 0 0 3 0x14200 bored smr 1 114377 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 23524 (syz-executor.0) thread 0xffff800020b6f418 (230780) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff823b2e88) #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 9628 6483K 14912K 78643K 34830 0 0 pcb 13 8K 8K 78643K 662 0 0 rtable 93 12K 13K 78643K 2174 0 0 ifaddr 88 19K 21K 78643K 941 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1989 0 0 iov 0 0K 28K 78643K 1166 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1201 75K 77K 78643K 10242 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 136 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 1019 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 9724 0 0 sigio 2 0K 0K 78643K 110 0 0 proc 54 51K 83K 78643K 1911 0 0 subproc 32 2K 2K 78643K 208 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 917 0 0 in_multi 22 1K 2K 78643K 471 0 0 ether_multi 1 0K 0K 78643K 37 0 0 mrt 0 0K 0K 78643K 27 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 132 583K 583K 78643K 132 0 0 exec 0 0K 1K 78643K 1159 0 0 pfkey data 0 0K 4K 78643K 7 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 130 23K 32K 78643K 32847 0 0 UVM aobj 130 6K 6K 78643K 144 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 463 0 0 NDP 22 0K 0K 78643K 266 0 0 temp 242 2749K 3390K 78643K 34054 0 0 kqueue 0 0K 0K 78643K 65 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 31 0 27 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 383 0 381 1 0 1 1 0 8 0 rtentry 112 168 0 135 2 0 2 2 0 8 0 unpcb 120 2930 0 2918 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 7285 0 7285 2 2 0 1 0 8 0 tcpcb 544 1662 0 1658 1 0 1 1 0 8 0 inpcb 280 4373 0 4361 21 19 2 2 0 8 1 nd6 48 36 0 33 1 0 1 1 0 8 0 pkpcb 40 72 0 72 23 23 0 1 0 8 0 swfcl 56 9 0 0 1 0 1 1 0 8 0 ppxss 1128 173 0 173 29 29 0 1 0 8 0 pffrag 232 4 0 4 3 3 0 1 0 482 0 pffrnode 88 4 0 4 3 3 0 1 0 8 0 pffrent 40 10 0 10 4 4 0 1 0 8 0 pfosfp 40 846 0 846 5 5 0 5 0 8 0 pfosfpen 112 1428 0 1428 21 21 0 21 0 8 0 pfstitem 24 156 0 150 1 0 1 1 0 8 0 pfstkey 112 156 0 150 1 0 1 1 0 8 0 pfstate 328 156 0 150 3 1 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 660 0 513 17 4 13 13 0 8 0 art_table 32 661 0 513 2 0 2 2 0 8 0 art_node 16 159 0 129 1 0 1 1 0 8 0 sysvmsgpl 40 60 0 42 1 0 1 1 0 8 0 semapl 112 1017 0 1007 1 0 1 1 0 8 0 shmpl 112 142 0 14 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 16826 0 15402 47 0 47 47 0 8 0 ffsino 272 16826 0 15402 96 0 96 96 0 8 0 nchpl 144 30475 0 28837 62 0 62 62 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 97655 0 97655 4 3 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 19 0 19 13 13 0 1 0 8 0 scxspl 192 91811 0 91811 38 37 1 6 0 8 1 plimitpl 152 833 0 825 1 0 1 1 0 8 0 sigapl 432 9903 0 9887 3 1 2 3 0 8 0 futexpl 56 122826 0 122824 3 2 1 1 0 8 0 knotepl 112 1683 0 1664 2 1 1 2 0 8 0 kqueuepl 104 2020 0 2018 1 0 1 1 0 8 0 pipepl 112 5788 0 5769 17 16 1 2 0 8 0 fdescpl 488 9904 0 9887 3 0 3 3 0 8 0 filepl 152 58770 0 58668 21 16 5 7 0 8 1 lockfpl 104 3313 0 3313 5 4 1 1 0 8 1 lockfspl 48 1138 0 1138 5 4 1 1 0 8 1 sessionpl 112 37 0 26 1 0 1 1 0 8 0 pgrppl 48 147 0 136 1 0 1 1 0 8 0 ucredpl 96 11958 0 11949 1 0 1 1 0 8 0 zombiepl 144 9887 0 9887 3 2 1 1 0 8 1 processpl 896 9920 0 9887 4 0 4 4 0 8 0 procpl 632 31251 0 31205 12 7 5 5 0 8 0 srpgc 64 22 0 22 6 6 0 1 0 8 0 sosppl 128 137 0 137 30 30 0 1 0 8 0 sockpl 384 7853 0 7831 16 13 3 4 0 8 0 mcl64k 65536 647 0 0 68 45 23 34 0 8 1 mcl16k 16384 14 0 0 2 0 2 2 0 8 0 mcl12k 12288 36 0 0 2 0 2 2 0 8 0 mcl9k 9216 33 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 3 0 3 3 0 8 0 mcl4k 4096 25 0 0 4 1 3 3 0 8 0 mcl2k2 2112 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 215 0 0 21 10 11 21 0 8 0 mtagpl 80 44 0 0 1 0 1 1 0 8 0 mbufpl 256 928 0 0 25 0 25 25 0 8 0 bufpl 256 29382 0 22353 440 0 440 440 0 8 0 anonpl 16 920330 0 908230 243 177 66 66 0 125 9 amapchunkpl 152 59745 0 59614 86 80 6 19 0 158 0 amappl16 192 50163 0 49516 316 276 40 45 0 8 7 amappl15 184 2590 0 2588 4 3 1 1 0 8 0 amappl14 176 2701 0 2693 1 0 1 1 0 8 0 amappl13 168 325 0 325 3 3 0 1 0 8 0 amappl12 160 4890 0 4888 2 1 1 1 0 8 0 amappl11 152 85 0 69 1 0 1 1 0 8 0 amappl10 144 112 0 105 1 0 1 1 0 8 0 amappl9 136 2484 0 2481 1 0 1 1 0 8 0 amappl8 128 2049 0 2014 2 0 2 2 0 8 0 amappl7 120 83 0 75 1 0 1 1 0 8 0 amappl6 112 61 0 54 1 0 1 1 0 8 0 amappl5 104 5173 0 5158 1 0 1 1 0 8 0 amappl4 96 6963 0 6929 2 1 1 2 0 8 0 amappl3 88 4105 0 4095 1 0 1 1 0 8 0 amappl2 80 80238 0 80156 3 1 2 3 0 8 0 amappl1 72 222499 0 222031 26 16 10 20 0 8 0 amappl 80 31763 0 31718 4 2 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 143 0 14 3 0 3 3 0 8 0 uaddrrnd 24 9904 0 9887 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 9904 0 9887 1 0 1 1 0 8 0 vmmpekpl 168 69752 0 69720 2 0 2 2 0 8 0 vmmpepl 168 1209041 0 1207120 330 236 94 100 0 357 10 vmsppl 368 9903 0 9887 2 0 2 2 0 8 0 pdppl 4096 19816 0 19774 6 0 6 6 0 8 0 pvpl 32 2376436 0 2361027 494 332 162 164 0 265 29 pmappl 232 9903 0 9887 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 697 0 66 19 0 19 19 0 8 0