panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *207511 63326 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(fffffd802b8e2568) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800015a09710,1,ffff800014940ee8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd8037406648,c0106477,ffff800015a09710,1,fffffd803f7c6c00,ffff800014940ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f857d30,c0106477,ffff800015a09710,ffff800014940ee8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800014940ee8,ffff800015a09828,ffff800015a09890) at sys_ioctl+0x5b8 syscall(ffff800015a098f0) at syscall+0x508 Xsyscall(6,0,ffffffffffffff1f,0,3,70085a71010) at Xsyscall+0x128 end of kernel end trace frame: 0x703345ba310, 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic vrele: v_writecount != 0 ddb> 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(fffffd802b8e2568) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800015a09710,1,ffff800014940ee8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd8037406648,c0106477,ffff800015a09710,1,fffffd803f7c6c00,ffff800014940ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f857d30,c0106477,ffff800015a09710,ffff800014940ee8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800014940ee8,ffff800015a09828,ffff800015a09890) at sys_ioctl+0x5b8 syscall(ffff800015a098f0) at syscall+0x508 Xsyscall(6,0,ffffffffffffff1f,0,3,70085a71010) at Xsyscall+0x128 end of kernel end trace frame: 0x703345ba310, count: -9 ddb> show registers rdi 0xffffffff818b9067 db_enter+0x17 rsi 0x7062 __ALIGN_SIZE+0x6062 rbp 0xffff800015a092d0 rbx 0xffff800015a09380 rdx 0x7063 __ALIGN_SIZE+0x6063 rcx 0xffff800016be9000 rax 0xffff800016be9000 r8 0xffff800015a09290 r9 0x1 r10 0xffff800000997c80 r11 0xf1e394fba527b146 r12 0x3000000008 r13 0xffff800015a092e0 r14 0x100 r15 0x1 rip 0xffffffff818b9068 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800015a092c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=207511 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000149413d8,0xffff800014940518 process=0xffff8000ffff6a30 user=0xffff800015a04000, vmspace=0xfffffd803f00cdd0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 63326 505721 79372 0 2 0 syz-executor.0 *63326 207511 79372 0 7 0x4000000 syz-executor.0 63326 105977 79372 0 2 0x4000000 syz-executor.0 24415 301623 1 0 3 0x100083 ttyin getty 38697 496351 0 0 3 0x14200 bored sosplice 79372 333408 36786 0 2 0x482 syz-executor.0 10947 490435 36786 0 2 0x482 syz-executor.1 36786 248613 20615 0 3 0x82 thrsleep syz-fuzzer 36786 235342 20615 0 3 0x4000082 thrsleep syz-fuzzer 36786 272813 20615 0 3 0x4000082 thrsleep syz-fuzzer 36786 264045 20615 0 3 0x4000082 thrsleep syz-fuzzer 36786 12280 20615 0 3 0x4000082 kqread syz-fuzzer 36786 48246 20615 0 3 0x4000082 thrsleep syz-fuzzer 36786 153052 20615 0 3 0x4000082 thrsleep syz-fuzzer 20615 384763 25808 0 3 0x10008a pause ksh 25808 188064 10941 0 3 0x92 select sshd 10941 398290 1 0 3 0x80 select sshd 89938 21410 76500 73 2 0x100090 syslogd 76500 471931 1 0 3 0x100082 netio syslogd 56729 228333 1 77 3 0x100090 poll dhclient 76514 497878 1 0 3 0x80 poll dhclient 76932 503478 0 0 2 0x14200 zerothread 49325 314325 0 0 3 0x14200 aiodoned aiodoned 84831 63174 0 0 3 0x14200 syncer update 12653 213063 0 0 3 0x14200 cleaner cleaner 45904 54243 0 0 3 0x14200 reaper reaper 49671 263162 0 0 3 0x14200 pgdaemon pagedaemon 71050 226925 0 0 3 0x14200 bored crynlk 8396 472917 0 0 3 0x14200 bored crypto 35578 243900 0 0 3 0x40014200 acpi0 acpi0 47889 73671 0 0 3 0x14200 bored softnet 8274 183819 0 0 3 0x14200 bored systqmp 80710 130321 0 0 3 0x14200 bored systq 70210 2874 0 0 3 0x40014200 bored softclock 95081 267840 0 0 3 0x40014200 idle0 3083 143492 0 0 3 0x14200 bored smr 1 54968 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9532 6365K 7640K 78643K 17568 0 0 pcb 13 8K 8K 78643K 185 0 0 rtable 114 4K 4K 78643K 549 0 0 ifaddr 64 14K 15K 78643K 227 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 144 0 0 iov 0 0K 32K 78643K 369 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1204 76K 77K 78643K 3683 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 35 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 1K 1K 78643K 326 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 5 13K 25K 78643K 2665 0 0 sigio 0 0K 0K 78643K 30 0 0 proc 42 30K 54K 78643K 602 0 0 subproc 32 2K 2K 78643K 36 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 299 0 0 in_multi 33 2K 2K 78643K 110 0 0 ether_multi 1 0K 0K 78643K 10 0 0 mrt 0 0K 0K 78643K 11 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 96 424K 424K 78643K 96 0 0 exec 0 0K 1K 78643K 416 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 82 20K 29K 78643K 7102 0 0 UVM aobj 112 3K 4K 78643K 134 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 116 0 0 NDP 14 0K 0K 78643K 62 0 0 temp 185 2727K 3367K 78643K 11142 0 0 kqueue 0 0K 0K 78643K 19 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> 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 rtpcb 80 116 0 114 1 0 1 1 0 8 0 rtentry 112 49 0 4 2 0 2 2 0 8 0 unpcb 120 915 0 905 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 585 0 585 1 1 0 1 0 8 0 tcpcb 544 440 0 436 1 0 1 1 0 8 0 inpcb 280 1176 0 1169 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 14 0 14 5 5 0 1 0 8 0 ppxss 1128 30 0 30 14 13 1 1 0 8 1 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 24 0 16 2 1 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 324 0 314 1 0 1 1 0 8 0 shmpl 112 132 0 22 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 5714 0 4311 46 0 46 46 0 8 0 ffsino 240 5714 0 4311 84 0 84 84 0 8 0 nchpl 144 9633 0 8002 62 0 62 62 0 8 1 uvmvnodes 72 6827 0 0 125 0 125 125 0 8 0 vnodes 200 6827 0 0 360 0 360 360 0 8 0 namei 1024 30392 0 30392 2 1 1 1 0 8 1 scsiplug 64 7 0 7 4 4 0 1 0 8 0 scxspl 192 30195 0 30195 24 23 1 6 0 8 1 plimitpl 152 231 0 224 1 0 1 1 0 8 0 sigapl 432 2837 0 2824 2 0 2 2 0 8 0 futexpl 56 45027 0 45027 1 0 1 1 0 8 1 knotepl 112 511 0 492 1 0 1 1 0 8 0 kqueuepl 104 664 0 662 1 0 1 1 0 8 0 pipepl 112 1488 0 1469 5 4 1 2 0 8 0 fdescpl 424 2838 0 2824 2 0 2 2 0 8 0 filepl 120 17070 0 16974 5 1 4 5 0 8 1 lockfpl 104 911 0 911 5 4 1 1 0 8 1 lockfspl 48 324 0 324 5 4 1 1 0 8 1 sessionpl 112 18 0 8 1 0 1 1 0 8 0 pgrppl 48 31 0 21 1 0 1 1 0 8 0 ucredpl 96 3507 0 3500 1 0 1 1 0 8 0 zombiepl 144 2824 0 2823 2 1 1 1 0 8 0 processpl 864 2853 0 2823 4 0 4 4 0 8 0 procpl 632 6308 0 6270 4 0 4 4 0 8 0 sosppl 128 23 0 23 8 8 0 1 0 8 0 sockpl 384 2250 0 2231 6 3 3 3 0 8 1 mcl64k 65536 350 0 350 40 39 1 32 0 8 1 mcl16k 16384 13 0 13 8 7 1 1 0 8 1 mcl12k 12288 51 0 51 8 7 1 1 0 8 1 mcl9k 9216 40 0 40 6 6 0 1 0 8 0 mcl8k 8192 39 0 39 12 11 1 1 0 8 1 mcl4k 4096 114 0 114 7 6 1 1 0 8 1 mcl2k2 2112 28 0 27 8 7 1 1 0 8 0 mcl2k 2048 59120 0 59077 21 15 6 12 0 8 0 mtagpl 80 72 0 28 2 1 1 1 0 8 0 mbufpl 256 105650 0 105492 29 17 12 21 0 8 0 bufpl 256 16069 0 9207 430 1 429 430 0 8 0 anonpl 16 261827 0 250021 133 69 64 66 0 62 15 amapchunkpl 152 11637 0 11531 25 20 5 14 0 158 0 amappl16 192 16761 0 16112 128 87 41 46 0 8 8 amappl15 184 1337 0 1335 1 0 1 1 0 8 0 amappl14 176 52 0 46 1 0 1 1 0 8 0 amappl13 168 7 0 7 1 1 0 1 0 8 0 amappl12 160 9 0 8 1 0 1 1 0 8 0 amappl11 152 53 0 42 1 0 1 1 0 8 0 amappl10 144 62 0 61 2 1 1 1 0 8 0 amappl9 136 526 0 523 1 0 1 1 0 8 0 amappl8 128 129 0 113 1 0 1 1 0 8 0 amappl7 120 38 0 33 1 0 1 1 0 8 0 amappl6 112 59 0 53 1 0 1 1 0 8 0 amappl5 104 220 0 209 1 0 1 1 0 8 0 amappl4 96 3079 0 3055 1 0 1 1 0 8 0 amappl3 88 267 0 256 1 0 1 1 0 8 0 amappl2 80 23336 0 23267 4 2 2 3 0 8 0 amappl1 72 58696 0 58278 26 17 9 19 0 8 0 amappl 80 6550 0 6514 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 133 0 22 3 1 2 2 0 8 0 uaddrrnd 24 2838 0 2824 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2838 0 2824 1 0 1 1 0 8 0 vmmpekpl 168 19165 0 19140 2 0 2 2 0 8 0 vmmpepl 168 329991 0 328293 159 74 85 93 0 357 8 vmsppl 272 2837 0 2824 2 1 1 2 0 8 0 pdppl 4096 5683 0 5648 6 1 5 6 0 8 0 pvpl 32 753180 0 738333 311 150 161 242 0 265 39 pmappl 200 2837 0 2824 1 0 1 1 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 660 0 101 17 1 16 17 0 8 0