panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 446609 84916 0 0 0 1 syz-executor.1 *336467 84916 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(fffffd8066af2688) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800022e18fa0,1,ffff800020b28018) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab7198,c0106477,ffff800022e18fa0,1,fffffd807f7c6840,ffff800020b28018) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80665ebab0,c0106477,ffff800022e18fa0,ffff800020b28018) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020b28018,ffff800022e190b8,ffff800022e19120) at sys_ioctl+0x5b8 syscall(ffff800022e19190) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022e19190) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,2dea7137010) at Xsyscall+0x128 end of kernel end trace frame: 0x2e17d10eef0, 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(fffffd8066af2688) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800022e18fa0,1,ffff800020b28018) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab7198,c0106477,ffff800022e18fa0,1,fffffd807f7c6840,ffff800020b28018) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80665ebab0,c0106477,ffff800022e18fa0,ffff800020b28018) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:524 sys_ioctl(ffff800020b28018,ffff800022e190b8,ffff800022e19120) at sys_ioctl+0x5b8 syscall(ffff800022e19190) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022e19190) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,2dea7137010) at Xsyscall+0x128 end of kernel end trace frame: 0x2e17d10eef0, count: -9 ddb{0}> show registers rdi 0xffffffff812b5187 db_enter+0x17 rsi 0x6950 __ALIGN_SIZE+0x5950 rbp 0xffff800022e18b60 rbx 0xffff800022e18c10 rdx 0x6951 __ALIGN_SIZE+0x5951 rcx 0xffff800021c04000 rax 0xffff800021c04000 r8 0xffffffff8116f7e3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x2c79afffff4de87b r12 0x3000000008 r13 0xffff800022e18b70 r14 0x100 r15 0x1 rip 0xffffffff812b5188 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022e18b50 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=336467 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=81, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28c70,0xffff800020b282a0 process=0xffff800020b7dc00 user=0xffff800022e14000, vmspace=0xfffffd807effd2e0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 20425 390803 8270 0 2 0 syz-executor.0 20425 239211 8270 0 3 0x4000080 fsleep syz-executor.0 84916 446609 48910 0 7 0 syz-executor.1 *84916 336467 48910 0 7 0x4000000 syz-executor.1 84916 272236 48910 0 3 0x4000080 fsleep syz-executor.1 17712 456947 1 0 3 0x100083 ttyin getty 3711 116020 0 0 3 0x14200 bored sosplice 48910 285327 11094 0 2 0x482 syz-executor.1 8270 473127 11094 0 2 0x482 syz-executor.0 11094 19689 48384 0 3 0x82 thrsleep syz-fuzzer 11094 396394 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 246650 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 130496 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 393323 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 272142 48384 0 3 0x4000082 kqread syz-fuzzer 11094 93831 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 343805 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 331064 48384 0 3 0x4000082 thrsleep syz-fuzzer 11094 9276 48384 0 3 0x4000082 thrsleep syz-fuzzer 48384 266377 26268 0 3 0x10008a pause ksh 26268 110061 26466 0 3 0x92 select sshd 26466 516136 1 0 3 0x80 select sshd 99271 62078 95331 74 3 0x100092 bpf pflogd 95331 226188 1 0 3 0x80 netio pflogd 76209 328737 39947 73 2 0x100090 syslogd 39947 3871 1 0 3 0x100082 netio syslogd 71611 433215 1 77 3 0x100090 poll dhclient 27164 403316 1 0 3 0x80 poll dhclient 34343 25196 0 0 2 0x14200 zerothread 7282 410625 0 0 3 0x14200 aiodoned aiodoned 34456 208156 0 0 3 0x14200 syncer update 48840 403002 0 0 3 0x14200 cleaner cleaner 64321 94578 0 0 3 0x14200 reaper reaper 85252 34312 0 0 3 0x14200 pgdaemon pagedaemon 6376 34798 0 0 3 0x14200 bored crynlk 94797 233201 0 0 3 0x14200 bored crypto 12351 4279 0 0 3 0x40014200 acpi0 acpi0 53232 252819 0 0 3 0x40014200 idle1 34617 447500 0 0 3 0x14200 bored softnet 34931 368586 0 0 3 0x14200 bored systqmp 87742 191993 0 0 3 0x14200 bored systq 68736 349247 0 0 3 0x40014200 bored softclock 91512 32336 0 0 3 0x40014200 idle0 55730 518105 0 0 2 0x14200 smr 1 160077 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 84916 (syz-executor.1) thread 0xffff800020b28018 (336467) 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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9516 6538K 6838K 78643K 11736 0 0 pcb 13 8K 8K 78643K 54 0 0 rtable 111 4K 4K 78643K 320 0 0 ifaddr 56 13K 13K 78643K 113 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1491 0 0 iov 0 0K 16K 78643K 44 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1216 76K 77K 78643K 1621 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 8 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 58 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 462 0 0 sigio 0 0K 0K 78643K 5 0 0 proc 53 50K 71K 78643K 457 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 32 0 0 in_multi 33 2K 2K 78643K 37 0 0 ether_multi 1 0K 0K 78643K 1 0 0 mrt 0 0K 0K 78643K 2 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 261 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 108 21K 26K 78643K 2462 0 0 UVM aobj 19 2K 2K 78643K 19 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 25 0 0 NDP 11 0K 0K 78643K 29 0 0 temp 157 2745K 2809K 78643K 4712 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 35 0 33 1 0 1 1 0 8 0 rtentry 112 46 0 2 2 0 2 2 0 8 0 unpcb 120 130 0 118 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 7143 0 7143 3 3 0 2 0 8 0 tcpcb 544 84 0 80 1 0 1 1 0 8 0 inpcb 280 243 0 236 1 0 1 1 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 ppxss 1128 12 0 12 3 2 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 19 0 10 1 0 1 1 0 8 0 pfstkey 112 19 0 10 1 0 1 1 0 8 0 pfstate 328 19 0 10 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 45 0 5 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 1 1 0 1 1 0 8 0 semapl 112 56 0 46 1 0 1 1 0 8 0 shmpl 112 17 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2142 0 720 47 0 47 47 0 8 0 ffsino 272 2142 0 720 96 0 96 96 0 8 0 nchpl 144 2989 0 1341 62 0 62 62 0 8 0 uvmvnodes 72 2457 0 0 45 0 45 45 0 8 0 vnodes 200 2457 0 0 130 0 130 130 0 8 0 namei 1024 8412 0 8412 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 8611 0 8611 10 9 1 6 0 8 1 plimitpl 152 54 0 46 1 0 1 1 0 8 0 sigapl 432 663 0 647 3 1 2 3 0 8 0 futexpl 56 5380 0 5378 1 0 1 1 0 8 0 knotepl 112 97 0 78 1 0 1 1 0 8 0 kqueuepl 104 87 0 85 1 0 1 1 0 8 0 pipepl 112 386 0 367 1 0 1 1 0 8 0 fdescpl 488 664 0 647 3 0 3 3 0 8 0 filepl 152 3636 0 3535 6 1 5 5 0 8 0 lockfpl 104 179 0 179 2 1 1 1 0 8 1 lockfspl 48 65 0 65 2 1 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 539 0 530 1 0 1 1 0 8 0 zombiepl 144 647 0 647 2 1 1 1 0 8 1 processpl 896 680 0 647 4 0 4 4 0 8 0 procpl 632 1683 0 1638 6 1 5 5 0 8 1 srpgc 64 1 0 1 1 1 0 1 0 8 0 sosppl 128 14 0 14 2 1 1 1 0 8 1 sockpl 384 410 0 389 4 1 3 3 0 8 0 mcl64k 65536 5 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 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 5 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 262 0 0 30 0 30 30 0 8 0 mtagpl 80 10 0 0 1 0 1 1 0 8 0 mbufpl 256 283 0 0 17 0 17 17 0 8 0 bufpl 256 6642 0 1168 343 0 343 343 0 8 0 anonpl 16 78701 0 66962 72 21 51 64 0 125 2 amapchunkpl 152 3748 0 3606 12 5 7 11 0 158 0 amappl16 192 3014 0 2399 51 19 32 43 0 8 0 amappl15 184 209 0 207 1 0 1 1 0 8 0 amappl14 176 265 0 255 1 0 1 1 0 8 0 amappl13 168 14 0 13 2 1 1 1 0 8 0 amappl12 160 13 0 12 1 0 1 1 0 8 0 amappl11 152 59 0 44 1 0 1 1 0 8 0 amappl10 144 75 0 71 1 0 1 1 0 8 0 amappl9 136 819 0 814 1 0 1 1 0 8 0 amappl8 128 379 0 359 1 0 1 1 0 8 0 amappl7 120 35 0 32 1 0 1 1 0 8 0 amappl6 112 60 0 51 1 0 1 1 0 8 0 amappl5 104 132 0 117 1 0 1 1 0 8 0 amappl4 96 937 0 903 2 1 1 2 0 8 0 amappl3 88 197 0 185 1 0 1 1 0 8 0 amappl2 80 4583 0 4501 3 1 2 3 0 8 0 amappl1 72 24414 0 23960 27 17 10 20 0 8 0 amappl 80 1944 0 1897 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 18 0 0 1 0 1 1 0 8 0 uaddrrnd 24 664 0 647 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 664 0 647 1 0 1 1 0 8 0 vmmpekpl 168 8637 0 8605 2 0 2 2 0 8 0 vmmpepl 168 87624 0 85761 134 51 83 99 0 357 2 vmsppl 368 663 0 647 2 0 2 2 0 8 0 pdppl 4096 1336 0 1294 6 0 6 6 0 8 0 pvpl 32 245281 0 230307 189 41 148 161 0 265 26 pmappl 232 663 0 647 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 521 0 4 15 0 15 15 0 8 0