panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *233702 9179 0 0 0x4000000 1K 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(fffffd80677f8aa0) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800020c15810,1,ffff800020b289f8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab9648,c0106477,ffff800020c15810,1,fffffd807f7c6ae0,ffff800020b289f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067d44e60,c0106477,ffff800020c15810,ffff800020b289f8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b289f8,ffff800020c15928,ffff800020c15990) at sys_ioctl+0x5b8 syscall(ffff800020c15a00) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800020c15a00) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,fb8c4150010) at Xsyscall+0x128 end of kernel end trace frame: 0xfbadf7493f0, 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(fffffd80677f8aa0) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800020c15810,1,ffff800020b289f8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab9648,c0106477,ffff800020c15810,1,fffffd807f7c6ae0,ffff800020b289f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067d44e60,c0106477,ffff800020c15810,ffff800020b289f8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b289f8,ffff800020c15928,ffff800020c15990) at sys_ioctl+0x5b8 syscall(ffff800020c15a00) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800020c15a00) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,fb8c4150010) at Xsyscall+0x128 end of kernel end trace frame: 0xfbadf7493f0, count: -9 ddb{1}> show registers rdi 0xffffffff81b7cd57 db_enter+0x17 rsi 0x1b1ba acpi_pdirpa+0x7022 rbp 0xffff800020c153d0 rbx 0xffff800020c15480 rdx 0x1b1bb acpi_pdirpa+0x7023 rcx 0xffff800021622000 rax 0xffff800021622000 r8 0xffffffff81ecbab3 kprintf+0x173 r9 0x1 r10 0x25 r11 0xbcad544fb311a31c r12 0x3000000008 r13 0xffff800020c153e0 r14 0x100 r15 0x1 rip 0xffffffff81b7cd58 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c153c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=233702 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b28018,0xffff800020b29b50 process=0xffff800020b7dc00 user=0xffff800020c10000, vmspace=0xfffffd807effe5c0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 9179 426670 15477 0 2 0 syz-executor.1 * 9179 233702 15477 0 7 0x4000000 syz-executor.1 9179 18214 15477 0 2 0x4000000 syz-executor.1 15477 41111 86092 0 3 0x82 nanosleep syz-executor.1 99882 200265 0 0 3 0x14200 bored sosplice 73427 273822 86092 0 3 0x82 nanosleep syz-executor.0 86092 139243 47056 0 3 0x82 kqread syz-fuzzer 86092 4470 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 134527 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 32559 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 131992 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 68974 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 488515 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 42424 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 438391 47056 0 3 0x4000082 thrsleep syz-fuzzer 86092 440913 47056 0 3 0x4000082 thrsleep syz-fuzzer 47056 128344 64547 0 3 0x10008a pause ksh 64547 451264 11018 0 3 0x92 select sshd 50217 127263 1 0 3 0x100083 ttyopn getty 11018 424236 1 0 3 0x80 select sshd 89902 504848 59193 74 3 0x100092 bpf pflogd 59193 34903 1 0 3 0x80 netio pflogd 86059 156775 96659 73 3 0x100090 kqread syslogd 96659 53139 1 0 3 0x100082 netio syslogd 34315 258349 1 77 3 0x100090 poll dhclient 28979 436468 1 0 3 0x80 poll dhclient 28918 344769 0 0 3 0x14200 pgzero zerothread 80245 330304 0 0 3 0x14200 aiodoned aiodoned 4286 301281 0 0 3 0x14200 syncer update 39520 373009 0 0 3 0x14200 cleaner cleaner 62274 315410 0 0 3 0x14200 reaper reaper 95863 424797 0 0 3 0x14200 pgdaemon pagedaemon 53436 17477 0 0 3 0x14200 bored crynlk 64880 260825 0 0 3 0x14200 bored crypto 60876 60352 0 0 3 0x40014200 acpi0 acpi0 88427 87038 0 0 3 0x40014200 idle1 9267 467365 0 0 3 0x14200 bored softnet 5270 405276 0 0 3 0x14200 bored systqmp 15742 235047 0 0 3 0x14200 bored systq 91446 435230 0 0 3 0x40014200 bored softclock 52512 169921 0 0 3 0x40014200 idle0 22956 478969 0 0 3 0x14200 bored smr 1 227989 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 9179 (syz-executor.1) thread 0xffff800020b289f8 (233702) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9508 6595K 6789K 78643K 11817 0 0 pcb 13 8K 8K 78643K 43 0 0 rtable 108 4K 4K 78643K 359 0 0 ifaddr 50 12K 12K 78643K 111 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1489 0 0 iov 0 0K 24K 78643K 62 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1214 76K 77K 78643K 2276 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 7 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 8 1K 1K 78643K 10 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 1077 0 0 sigio 0 0K 0K 78643K 8 0 0 proc 53 50K 83K 78643K 490 0 0 subproc 32 2K 2K 78643K 51 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 35 0 0 in_multi 33 2K 2K 78643K 57 0 0 ether_multi 1 0K 0K 78643K 2 0 0 mrt 0 0K 0K 78643K 6 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 60 265K 265K 78643K 60 0 0 exec 0 0K 1K 78643K 264 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 114 22K 26K 78643K 4050 0 0 UVM aobj 29 2K 2K 78643K 31 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 7 0 0 NDP 9 0K 0K 78643K 31 0 0 temp 138 2740K 2805K 78643K 6012 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 8 0 2 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 31 0 29 1 0 1 1 0 8 0 rtentry 112 58 0 14 2 0 2 2 0 8 0 unpcb 120 544 0 532 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 7922 0 7922 3 3 0 2 0 8 0 tcpcb 544 72 0 68 1 0 1 1 0 8 0 inpcb 280 207 0 200 1 0 1 1 0 8 0 rttmr 72 2 0 2 1 1 0 1 0 8 0 nd6 48 9 0 3 1 0 1 1 0 8 0 ppxss 1128 7 0 7 2 2 0 1 0 8 0 pffrag 232 2 0 2 1 1 0 1 0 482 0 pffrnode 88 2 0 2 1 1 0 1 0 8 0 pffrent 40 4 0 4 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 20 0 14 1 0 1 1 0 8 0 pfstkey 112 20 0 14 1 0 1 1 0 8 0 pfstate 328 20 0 14 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 236 0 44 12 0 12 12 0 8 0 art_table 32 237 0 44 2 0 2 2 0 8 0 art_node 16 57 0 17 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 6 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 8 0 2 1 0 1 1 0 8 0 shmpl 112 29 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4086 0 2668 47 0 47 47 0 8 0 ffsino 272 4086 0 2668 96 0 96 96 0 8 0 nchpl 144 5549 0 3915 62 0 62 62 0 8 0 uvmvnodes 72 4399 0 0 80 0 80 80 0 8 0 vnodes 200 4399 0 0 232 0 232 232 0 8 0 namei 1024 14370 0 14370 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 1 1 0 1 0 8 0 scxspl 192 14388 0 14388 14 13 1 6 0 8 1 plimitpl 152 658 0 650 1 0 1 1 0 8 0 sigapl 432 1274 0 1258 3 1 2 3 0 8 0 futexpl 56 15684 0 15684 1 0 1 1 0 8 1 knotepl 112 149 0 130 1 0 1 1 0 8 0 kqueuepl 104 92 0 90 1 0 1 1 0 8 0 pipepl 112 438 0 417 2 1 1 1 0 8 0 fdescpl 488 1275 0 1258 3 0 3 3 0 8 0 filepl 152 5606 0 5501 7 2 5 5 0 8 0 lockfpl 104 235 0 235 3 2 1 1 0 8 1 lockfspl 48 78 0 78 3 2 1 1 0 8 1 sessionpl 112 19 0 8 1 0 1 1 0 8 0 pgrppl 48 30 0 19 1 0 1 1 0 8 0 ucredpl 96 539 0 530 1 0 1 1 0 8 0 zombiepl 144 1259 0 1258 3 2 1 1 0 8 0 processpl 896 1291 0 1258 4 0 4 4 0 8 0 procpl 632 3219 0 3175 6 1 5 5 0 8 1 srpgc 64 4 0 4 1 1 0 1 0 8 0 sosppl 128 5 0 5 2 2 0 1 0 8 0 sockpl 384 787 0 766 5 2 3 3 0 8 0 mcl64k 65536 258 0 0 33 3 30 33 0 8 1 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 219 0 0 25 0 25 25 0 8 0 mtagpl 80 4 0 0 1 0 1 1 0 8 0 mbufpl 256 366 0 0 20 0 20 20 0 8 0 bufpl 256 7704 0 1168 409 0 409 409 0 8 0 anonpl 16 112975 0 102432 66 18 48 63 0 125 0 amapchunkpl 152 6354 0 6215 13 7 6 9 0 158 0 amappl16 192 5604 0 4984 44 12 32 43 0 8 1 amappl15 184 594 0 592 1 0 1 1 0 8 0 amappl14 176 59 0 54 1 0 1 1 0 8 0 amappl13 168 7 0 7 1 1 0 1 0 8 0 amappl12 160 398 0 398 2 2 0 1 0 8 0 amappl11 152 65 0 50 1 0 1 1 0 8 0 amappl10 144 84 0 79 1 0 1 1 0 8 0 amappl9 136 617 0 613 1 0 1 1 0 8 0 amappl8 128 171 0 144 2 1 1 2 0 8 0 amappl7 120 47 0 42 1 0 1 1 0 8 0 amappl6 112 69 0 59 1 0 1 1 0 8 0 amappl5 104 532 0 517 1 0 1 1 0 8 0 amappl4 96 1142 0 1110 2 1 1 2 0 8 0 amappl3 88 598 0 587 1 0 1 1 0 8 0 amappl2 80 10326 0 10245 4 2 2 3 0 8 0 amappl1 72 35626 0 35160 25 15 10 20 0 8 0 amappl 80 3496 0 3448 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 30 0 2 1 0 1 1 0 8 0 uaddrrnd 24 1275 0 1258 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1275 0 1258 1 0 1 1 0 8 0 vmmpekpl 168 12466 0 12439 2 0 2 2 0 8 0 vmmpepl 168 159701 0 157819 146 48 98 99 0 357 16 vmsppl 368 1274 0 1258 2 0 2 2 0 8 0 pdppl 4096 2558 0 2516 6 0 6 6 0 8 0 pvpl 32 339236 0 325430 180 59 121 155 0 265 0 pmappl 232 1274 0 1258 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 620 0 8 18 0 18 18 0 8 0