panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *170208 64029 0 0 0x4000000 1K syz-executor.1 210899 15580 0 0x2 0x4000000 0 syz-fuzzer 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(fffffd80644908e8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800022e1d170,1,ffff800020afe4f8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fac3198,c0106477,ffff800022e1d170,1,fffffd807f7c65a0,ffff800020afe4f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8064403c80,c0106477,ffff800022e1d170,ffff800020afe4f8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020afe4f8,ffff800022e1d288,ffff800022e1d2f0) at sys_ioctl+0x5b8 syscall(ffff800022e1d360) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022e1d360) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,c655d771010) at Xsyscall+0x128 end of kernel end trace frame: 0xc677b9d3ba0, 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(fffffd80644908e8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800022e1d170,1,ffff800020afe4f8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fac3198,c0106477,ffff800022e1d170,1,fffffd807f7c65a0,ffff800020afe4f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8064403c80,c0106477,ffff800022e1d170,ffff800020afe4f8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020afe4f8,ffff800022e1d288,ffff800022e1d2f0) at sys_ioctl+0x5b8 syscall(ffff800022e1d360) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022e1d360) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,c655d771010) at Xsyscall+0x128 end of kernel end trace frame: 0xc677b9d3ba0, count: -9 ddb{1}> show registers rdi 0xffffffff810a6987 db_enter+0x17 rsi 0x84a7 __ALIGN_SIZE+0x74a7 rbp 0xffff800022e1cd30 rbx 0xffff800022e1cde0 rdx 0x84a8 __ALIGN_SIZE+0x74a8 rcx 0xffff800022e2e000 rax 0xffff800022e2e000 r8 0xffffffff81491283 kprintf+0x173 r9 0x1 r10 0x25 r11 0xb0523e0758c9cfe9 r12 0x3000000008 r13 0xffff800022e1cd40 r14 0x100 r15 0x1 rip 0xffffffff810a6988 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022e1cd20 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=170208 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=85, nice=20 forw=0xffffffffffffffff, list=0xffff800020aff150,0xffff800020b50790 process=0xffff800020b7d880 user=0xffff800022e18000, vmspace=0xfffffd807f00c450 estcpu=35, cpticks=3, pctcpu=0.0 user=0, sys=3, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 64029 515087 63156 0 2 0 syz-executor.1 *64029 170208 63156 0 7 0x4000000 syz-executor.1 64029 155962 63156 0 2 0x4000000 syz-executor.1 89378 440123 0 0 3 0x14200 bored sosplice 63156 137487 15580 0 3 0x82 nanosleep syz-executor.1 93959 457781 15580 0 3 0x2 biowait syz-executor.0 15580 502849 68018 0 3 0x82 thrsleep syz-fuzzer 15580 464798 68018 0 3 0x4000082 nanosleep syz-fuzzer 15580 260416 68018 0 3 0x4000082 thrsleep syz-fuzzer 15580 463098 68018 0 3 0x4000082 thrsleep syz-fuzzer 15580 310102 68018 0 3 0x4000082 thrsleep syz-fuzzer 15580 52365 68018 0 3 0x4000082 thrsleep syz-fuzzer 15580 210899 68018 0 7 0x4000002 syz-fuzzer 15580 455959 68018 0 3 0x4000082 thrsleep syz-fuzzer 15580 238359 68018 0 3 0x4000082 thrsleep syz-fuzzer 15580 209453 68018 0 3 0x4000082 kqread syz-fuzzer 68018 110346 8724 0 3 0x10008a pause ksh 8724 174970 99717 0 3 0x92 select sshd 8334 267185 1 0 3 0x100083 ttyin getty 99717 144048 1 0 3 0x80 select sshd 36846 486162 94888 74 3 0x100092 bpf pflogd 94888 559 1 0 3 0x80 netio pflogd 50331 514898 53744 73 3 0x100090 kqread syslogd 53744 278709 1 0 3 0x100082 netio syslogd 21679 47233 1 77 3 0x100090 poll dhclient 53424 14478 1 0 3 0x80 poll dhclient 76746 50699 0 0 3 0x14200 pgzero zerothread 84418 4246 0 0 3 0x14200 aiodoned aiodoned 390 185282 0 0 3 0x14200 syncer update 23171 106108 0 0 3 0x14200 cleaner cleaner 42665 83024 0 0 3 0x14200 reaper reaper 14923 498588 0 0 3 0x14200 pgdaemon pagedaemon 88434 110552 0 0 3 0x14200 bored crynlk 29866 57385 0 0 3 0x14200 bored crypto 38429 17333 0 0 3 0x40014200 acpi0 acpi0 85303 58428 0 0 3 0x40014200 idle1 54800 290101 0 0 3 0x14200 bored softnet 32285 221494 0 0 3 0x14200 bored systqmp 53644 296623 0 0 3 0x14200 bored systq 28632 59422 0 0 3 0x40014200 bored softclock 6246 383423 0 0 3 0x40014200 idle0 94027 223354 0 0 3 0x14200 bored smr 1 382420 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 64029 (syz-executor.1) thread 0xffff800020afe4f8 (170208) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82363570) #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 Process 93959 (syz-executor.0) thread 0xffff800020b51160 (457781) exclusive rrwlock inode r = 0 (0xfffffd806e306e78) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:556 #5 vget+0x1c3 sys/kern/vfs_subr.c:672 #6 ufs_ihashget+0x141 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x74 sys/ufs/ffs/ffs_vfsops.c:1323 #8 ufs_lookup+0x1575 sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #10 vfs_lookup+0x7a5 sys/kern/vfs_lookup.c:567 #11 namei+0x61c sys/kern/vfs_lookup.c:248 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1768 #13 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #13 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd8066077d68) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:556 #5 vget+0x1c3 sys/kern/vfs_subr.c:672 #6 cache_lookup+0x2cf sys/kern/vfs_cache.c:224 #7 ufs_lookup+0x1ad sys/ufs/ufs/ufs_lookup.c:162 #8 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #9 vfs_lookup+0x7a5 sys/kern/vfs_lookup.c:567 #10 namei+0x61c sys/kern/vfs_lookup.c:248 #11 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1768 #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 9567 6560K 7198K 78643K 14650 0 0 pcb 13 8K 8K 78643K 152 0 0 rtable 110 4K 4K 78643K 464 0 0 ifaddr 72 15K 16K 78643K 198 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1537 0 0 iov 0 0K 24K 78643K 163 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1208 76K 77K 78643K 2473 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 25 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 41 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 5 13K 25K 78643K 1547 0 0 sigio 0 0K 0K 78643K 29 0 0 proc 54 51K 83K 78643K 629 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 123 0 0 in_multi 33 2K 2K 78643K 91 0 0 ether_multi 1 0K 0K 78643K 8 0 0 mrt 0 0K 0K 78643K 22 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 78 344K 344K 78643K 78 0 0 exec 0 0K 1K 78643K 312 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 103 21K 31K 78643K 5751 0 0 UVM aobj 66 3K 3K 78643K 71 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 74 0 0 NDP 16 0K 0K 78643K 52 0 0 temp 200 2748K 2816K 78643K 8039 0 0 kqueue 0 0K 0K 78643K 14 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 6 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 77 0 75 1 0 1 1 0 8 0 rtentry 112 54 0 9 2 0 2 2 0 8 0 unpcb 120 403 0 391 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 9520 0 9520 2 2 0 2 0 8 0 tcpcb 544 244 0 240 1 0 1 1 0 8 0 inpcb 280 686 0 679 1 0 1 1 0 8 0 rttmr 72 10 0 10 5 5 0 1 0 8 0 nd6 48 7 0 0 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 1 0 1 0 8 0 ppxss 1128 29 0 29 11 11 0 1 0 8 0 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 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 40 0 32 1 0 1 1 0 8 0 pfstkey 112 40 0 32 1 0 1 1 0 8 0 pfstate 328 40 0 32 2 1 1 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 191 0 0 12 0 12 12 0 8 0 art_table 32 192 0 0 2 0 2 2 0 8 0 art_node 16 53 0 12 1 0 1 1 0 8 0 sysvmsgpl 40 14 0 4 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 37 0 27 1 0 1 1 0 8 0 shmpl 112 69 0 5 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3813 0 2388 47 0 47 47 0 8 0 ffsino 272 3813 0 2388 96 0 96 96 0 8 0 nchpl 144 6231 0 4579 62 0 62 62 0 8 0 uvmvnodes 72 4763 0 0 87 0 87 87 0 8 0 vnodes 200 4763 0 0 251 0 251 251 0 8 0 namei 1024 18422 0 18422 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 5 0 5 3 3 0 1 0 8 0 scxspl 192 19501 0 19500 14 13 1 6 0 8 0 plimitpl 152 134 0 126 1 0 1 1 0 8 0 sigapl 432 1747 0 1732 3 1 2 3 0 8 0 futexpl 56 27319 0 27319 1 0 1 1 0 8 1 knotepl 112 269 0 250 1 0 1 1 0 8 0 kqueuepl 104 285 0 283 1 0 1 1 0 8 0 pipepl 112 990 0 967 2 0 2 2 0 8 1 fdescpl 488 1748 0 1732 3 0 3 3 0 8 0 filepl 152 9557 0 9448 7 2 5 6 0 8 0 lockfpl 104 529 0 529 6 5 1 1 0 8 1 lockfspl 48 192 0 192 6 5 1 1 0 8 1 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 36 0 25 1 0 1 1 0 8 0 ucredpl 96 1546 0 1537 1 0 1 1 0 8 0 zombiepl 144 1732 0 1732 2 1 1 1 0 8 1 processpl 896 1764 0 1732 4 0 4 4 0 8 0 procpl 632 4906 0 4863 6 2 4 5 0 8 0 srpgc 64 6 0 6 5 5 0 1 0 8 0 sosppl 128 11 0 11 6 6 0 1 0 8 0 sockpl 384 1171 0 1150 4 1 3 3 0 8 0 mcl64k 65536 10 0 0 2 0 2 2 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 13 0 0 2 0 2 2 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 5 0 0 1 0 1 1 0 8 0 mcl4k 4096 11 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 194 0 0 23 2 21 23 0 8 0 mtagpl 80 21 0 0 1 0 1 1 0 8 0 mbufpl 256 273 0 0 14 0 14 14 0 8 0 bufpl 256 9155 0 2126 440 0 440 440 0 8 0 anonpl 16 165708 0 153410 118 67 51 67 0 125 0 amapchunkpl 152 10087 0 9978 27 20 7 12 0 158 0 amappl16 192 8666 0 7992 96 62 34 46 0 8 0 amappl15 184 727 0 725 2 1 1 1 0 8 0 amappl14 176 59 0 53 1 0 1 1 0 8 0 amappl13 168 11 0 9 1 0 1 1 0 8 0 amappl12 160 5 0 3 2 1 1 1 0 8 0 amappl11 152 57 0 42 1 0 1 1 0 8 0 amappl10 144 76 0 70 1 0 1 1 0 8 0 amappl9 136 1388 0 1384 1 0 1 1 0 8 0 amappl8 128 947 0 924 1 0 1 1 0 8 0 amappl7 120 43 0 38 1 0 1 1 0 8 0 amappl6 112 60 0 52 1 0 1 1 0 8 0 amappl5 104 137 0 123 1 0 1 1 0 8 0 amappl4 96 2014 0 1982 2 1 1 2 0 8 0 amappl3 88 217 0 207 1 0 1 1 0 8 0 amappl2 80 13798 0 13724 3 0 3 3 0 8 0 amappl1 72 45928 0 45484 26 16 10 20 0 8 0 amappl 80 5180 0 5142 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 70 0 5 2 0 2 2 0 8 0 uaddrrnd 24 1748 0 1732 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1748 0 1732 1 0 1 1 0 8 0 vmmpekpl 168 16735 0 16706 2 0 2 2 0 8 0 vmmpepl 168 217935 0 216125 173 88 85 95 0 357 3 vmsppl 368 1747 0 1732 2 0 2 2 0 8 0 pdppl 4096 3503 0 3464 7 1 6 6 0 8 1 pvpl 32 488405 0 472936 273 143 130 166 0 265 3 pmappl 232 1747 0 1732 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 611 0 7 18 0 18 18 0 8 0