panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *447926 40799 0 0 0x4000000 0K syz-executor.1 223559 77380 0 0x2 0x480 1 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(fffffd806e67e6b8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021e070b0,1,ffff800020b28ee8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab8198,c0106477,ffff800021e070b0,1,fffffd807f7c6a80,ffff800020b28ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066f7de40,c0106477,ffff800021e070b0,ffff800020b28ee8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b28ee8,ffff800021e071c8,ffff800021e07230) at sys_ioctl+0x5b8 syscall(ffff800021e072a0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021e072a0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,4e9cfbe1010) at Xsyscall+0x128 end of kernel end trace frame: 0x4ec7ef72160, 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(fffffd806e67e6b8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021e070b0,1,ffff800020b28ee8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab8198,c0106477,ffff800021e070b0,1,fffffd807f7c6a80,ffff800020b28ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066f7de40,c0106477,ffff800021e070b0,ffff800020b28ee8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b28ee8,ffff800021e071c8,ffff800021e07230) at sys_ioctl+0x5b8 syscall(ffff800021e072a0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021e072a0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,4e9cfbe1010) at Xsyscall+0x128 end of kernel end trace frame: 0x4ec7ef72160, count: -9 ddb{0}> show registers rdi 0xffffffff818591d7 db_enter+0x17 rsi 0x65d1 __ALIGN_SIZE+0x55d1 rbp 0xffff800021e06c70 rbx 0xffff800021e06d20 rdx 0x65d2 __ALIGN_SIZE+0x55d2 rcx 0xffff800023c3a000 rax 0xffff800023c3a000 r8 0xffffffff81a72513 kprintf+0x173 r9 0x1 r10 0x25 r11 0x4cfaf0b92b59a51a r12 0x3000000008 r13 0xffff800021e06c80 r14 0x100 r15 0x1 rip 0xffffffff818591d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021e06c60 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=447926 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b29160,0xffff800020b60788 process=0xffff800020b7d180 user=0xffff800021e02000, vmspace=0xfffffd807effe450 estcpu=36, cpticks=3, pctcpu=0.0 user=0, sys=3, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 40799 51901 71480 0 2 0 syz-executor.1 *40799 447926 71480 0 7 0x4000000 syz-executor.1 40799 523568 71480 0 2 0x4000000 syz-executor.1 31179 321639 1 0 3 0x100083 ttyin getty 71480 102433 14747 0 2 0x482 syz-executor.1 77380 223559 14747 0 7 0x482 syz-executor.0 15514 457331 0 0 3 0x14200 bored sosplice 14747 229704 32855 0 3 0x82 thrsleep syz-fuzzer 14747 299041 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 59387 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 296352 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 463150 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 97757 32855 0 3 0x4000082 kqread syz-fuzzer 14747 305073 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 236975 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 219376 32855 0 3 0x4000082 thrsleep syz-fuzzer 14747 214396 32855 0 3 0x4000082 thrsleep syz-fuzzer 32855 427841 77799 0 3 0x10008a pause ksh 77799 456110 95945 0 3 0x92 select sshd 95945 457706 1 0 3 0x80 select sshd 85195 323535 89887 74 3 0x100092 bpf pflogd 89887 297752 1 0 3 0x80 netio pflogd 9959 160149 89262 73 2 0x100090 syslogd 89262 170368 1 0 3 0x100082 netio syslogd 31251 522209 1 77 3 0x100090 poll dhclient 64830 229949 1 0 3 0x80 poll dhclient 41232 411637 0 0 3 0x14200 pgzero zerothread 14816 517982 0 0 3 0x14200 aiodoned aiodoned 44100 269450 0 0 3 0x14200 syncer update 39863 393669 0 0 3 0x14200 cleaner cleaner 98656 513755 0 0 3 0x14200 reaper reaper 19801 323139 0 0 3 0x14200 pgdaemon pagedaemon 66480 474286 0 0 3 0x14200 bored crynlk 71917 508984 0 0 3 0x14200 bored crypto 60842 334132 0 0 3 0x40014200 acpi0 acpi0 77230 179387 0 0 3 0x40014200 idle1 9311 139982 0 0 3 0x14200 bored softnet 58394 139165 0 0 3 0x14200 bored systqmp 73586 118751 0 0 3 0x14200 bored systq 25208 436416 0 0 3 0x40014200 bored softclock 80709 187571 0 0 3 0x40014200 idle0 66846 236448 0 0 2 0x14200 smr 1 427355 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 40799 (syz-executor.1) thread 0xffff800020b28ee8 (447926) 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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9612 6609K 7131K 78643K 23737 0 0 pcb 13 8K 8K 78643K 394 0 0 rtable 117 12K 13K 78643K 1267 0 0 ifaddr 84 19K 21K 78643K 560 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1718 0 0 iov 0 0K 28K 78643K 612 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1207 76K 77K 78643K 5887 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 77 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 554 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 5262 0 0 sigio 1 0K 0K 78643K 66 0 0 proc 54 51K 83K 78643K 1146 0 0 subproc 32 2K 2K 78643K 118 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 496 0 0 in_multi 33 2K 2K 78643K 273 0 0 ether_multi 1 0K 0K 78643K 30 0 0 mrt 0 0K 0K 78643K 38 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 108 477K 477K 78643K 108 0 0 exec 0 0K 1K 78643K 685 0 0 pfkey data 0 0K 4K 78643K 2 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 105 21K 31K 78643K 18370 0 0 UVM aobj 130 5K 5K 78643K 153 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 308 0 0 NDP 20 0K 0K 78643K 153 0 0 temp 228 2749K 3388K 78643K 19770 0 0 kqueue 0 0K 0K 78643K 50 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 14 0 8 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 226 0 224 1 0 1 1 0 8 0 rtentry 112 107 0 63 2 0 2 2 0 8 0 unpcb 120 1721 0 1709 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 8316 0 8316 2 2 0 2 0 8 0 tcpcb 544 728 0 724 1 0 1 1 0 8 0 inpcb 280 2260 0 2253 1 0 1 1 0 8 0 rttmr 72 13 0 13 7 7 0 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 48 2 0 2 1 1 0 1 0 8 0 nd6 48 18 0 12 1 0 1 1 0 8 0 pkpcb 40 49 0 49 18 18 0 1 0 8 0 swfcl 56 1 0 0 1 0 1 1 0 8 0 ppxss 1128 105 0 105 14 13 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 846 5 5 0 5 0 8 0 pfosfpen 112 1428 0 1428 21 15 6 21 0 8 6 pfstitem 24 84 0 73 1 0 1 1 0 8 0 pfstkey 112 84 0 73 1 0 1 1 0 8 0 pfstate 328 84 0 73 3 0 3 3 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 394 0 199 15 2 13 14 0 8 0 art_table 32 395 0 199 2 0 2 2 0 8 0 art_node 16 99 0 59 1 0 1 1 0 8 0 sysvmsgpl 40 23 0 13 1 0 1 1 0 8 0 semapl 112 552 0 542 1 0 1 1 0 8 0 shmpl 112 151 0 23 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 9814 0 8401 47 0 47 47 0 8 0 ffsino 272 9814 0 8401 96 0 96 96 0 8 0 nchpl 144 17280 0 15645 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 54377 0 54377 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 7 0 7 6 5 1 1 0 8 1 scxspl 192 53467 0 53467 31 28 3 6 0 8 3 plimitpl 152 500 0 492 1 0 1 1 0 8 0 sigapl 432 5453 0 5438 3 1 2 3 0 8 0 futexpl 56 61329 0 61329 1 0 1 1 0 8 1 knotepl 112 995 0 976 2 1 1 2 0 8 0 kqueuepl 104 1192 0 1190 1 0 1 1 0 8 0 pipepl 112 3232 0 3213 12 11 1 2 0 8 0 fdescpl 488 5454 0 5438 3 0 3 3 0 8 0 filepl 152 31595 0 31494 15 10 5 6 0 8 0 lockfpl 104 1759 0 1759 4 3 1 1 0 8 1 lockfspl 48 652 0 652 4 3 1 1 0 8 1 sessionpl 112 25 0 14 1 0 1 1 0 8 0 pgrppl 48 81 0 70 1 0 1 1 0 8 0 ucredpl 96 6019 0 6010 1 0 1 1 0 8 0 zombiepl 144 5438 0 5437 2 1 1 1 0 8 0 processpl 896 5470 0 5437 4 0 4 4 0 8 0 procpl 632 17214 0 17170 17 12 5 5 0 8 1 srpgc 64 17 0 17 9 9 0 1 0 8 0 sosppl 128 72 0 72 17 16 1 1 0 8 1 sockpl 384 4304 0 4283 12 9 3 4 0 8 0 mcl64k 65536 556 0 0 67 12 55 65 0 8 1 mcl16k 16384 9 0 0 2 0 2 2 0 8 0 mcl12k 12288 32 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 11 0 0 2 0 2 2 0 8 0 mcl2k2 2112 8 0 0 1 0 1 1 0 8 0 mcl2k 2048 260 0 0 29 12 17 29 0 8 0 mtagpl 80 45 0 0 1 0 1 1 0 8 0 mbufpl 256 755 0 0 36 0 36 36 0 8 0 bufpl 256 18727 0 11698 440 0 440 440 0 8 0 anonpl 16 480359 0 468770 170 116 54 66 0 125 1 amapchunkpl 152 32484 0 32379 44 35 9 18 0 158 2 amappl16 192 26246 0 25587 145 111 34 46 0 8 0 amappl15 184 1734 0 1732 2 1 1 1 0 8 0 amappl14 176 1292 0 1285 1 0 1 1 0 8 0 amappl13 168 696 0 695 1 0 1 1 0 8 0 amappl12 160 1228 0 1226 2 1 1 1 0 8 0 amappl11 152 71 0 56 1 0 1 1 0 8 0 amappl10 144 94 0 90 1 0 1 1 0 8 0 amappl9 136 2178 0 2175 1 0 1 1 0 8 0 amappl8 128 1740 0 1714 1 0 1 1 0 8 0 amappl7 120 61 0 54 1 0 1 1 0 8 0 amappl6 112 62 0 55 1 0 1 1 0 8 0 amappl5 104 1412 0 1397 1 0 1 1 0 8 0 amappl4 96 5768 0 5732 2 1 1 2 0 8 0 amappl3 88 372 0 361 1 0 1 1 0 8 0 amappl2 80 44401 0 44326 3 1 2 3 0 8 0 amappl1 72 126252 0 125813 26 16 10 20 0 8 0 amappl 80 17565 0 17528 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 152 0 23 3 0 3 3 0 8 0 uaddrrnd 24 5454 0 5438 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 5454 0 5438 1 0 1 1 0 8 0 vmmpekpl 168 45525 0 45489 2 0 2 2 0 8 0 vmmpepl 168 660028 0 658228 225 139 86 102 0 357 0 vmsppl 368 5453 0 5438 2 0 2 2 0 8 0 pdppl 4096 10916 0 10876 6 0 6 6 0 8 0 pvpl 32 1321566 0 1306763 334 193 141 165 0 265 10 pmappl 232 5453 0 5438 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 710 0 31 20 0 20 20 0 8 0