panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *271843 44155 0 0 0x4000000 1K syz-executor.1 456260 44155 0 0 0x4000000 0 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(fffffd806e582cf8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800022e14e50,1,ffff800020b28018) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab5648,c0106477,ffff800022e14e50,1,fffffd807f7c6720,ffff800020b28018) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067fa8ef0,c0106477,ffff800022e14e50,ffff800020b28018) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b28018,ffff800022e14f68,ffff800022e14fd0) at sys_ioctl+0x5b8 syscall(ffff800022e15040) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022e15040) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,6c3ea78b010) at Xsyscall+0x128 end of kernel end trace frame: 0x6c6cd28ff00, 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(fffffd806e582cf8) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800022e14e50,1,ffff800020b28018) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fab5648,c0106477,ffff800022e14e50,1,fffffd807f7c6720,ffff800020b28018) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067fa8ef0,c0106477,ffff800022e14e50,ffff800020b28018) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b28018,ffff800022e14f68,ffff800022e14fd0) at sys_ioctl+0x5b8 syscall(ffff800022e15040) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800022e15040) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,6c3ea78b010) at Xsyscall+0x128 end of kernel end trace frame: 0x6c6cd28ff00, count: -9 ddb{1}> show registers rdi 0xffffffff818591d7 db_enter+0x17 rsi 0x6a3c __ALIGN_SIZE+0x5a3c rbp 0xffff800022e14a10 rbx 0xffff800022e14ac0 rdx 0x6a3d __ALIGN_SIZE+0x5a3d rcx 0xffff8000217e8000 rax 0xffff8000217e8000 r8 0xffffffff81a72513 kprintf+0x173 r9 0x1 r10 0x25 r11 0xf60acb67774d6b19 r12 0x3000000008 r13 0xffff800022e14a20 r14 0x100 r15 0x1 rip 0xffffffff818591d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022e14a00 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=271843 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=76, nice=20 forw=0xffffffffffffffff, list=0xffff800020b29650,0xffff800020b29b50 process=0xffff800020b7c380 user=0xffff800022e10000, vmspace=0xfffffd807effeb80 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 83885 367649 30499 0 2 0 syz-executor.0 83885 458928 30499 0 3 0x4000080 fsleep syz-executor.0 83885 413077 30499 0 3 0x4000080 fsleep syz-executor.0 83885 48580 30499 0 2 0x4000000 syz-executor.0 44155 256968 73160 0 2 0 syz-executor.1 *44155 271843 73160 0 7 0x4000000 syz-executor.1 44155 456260 73160 0 7 0x4000000 syz-executor.1 68066 366199 1 0 3 0x100083 ttyin getty 73160 221239 13024 0 3 0x82 nanosleep syz-executor.1 30499 347745 13024 0 3 0x82 nanosleep syz-executor.0 88246 227050 0 0 3 0x14200 bored sosplice 13024 289834 67045 0 3 0x82 thrsleep syz-fuzzer 13024 128489 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 288403 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 390600 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 6643 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 372989 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 307849 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 476296 67045 0 3 0x4000082 kqread syz-fuzzer 13024 278998 67045 0 3 0x4000082 thrsleep syz-fuzzer 13024 244784 67045 0 3 0x4000082 thrsleep syz-fuzzer 67045 79156 42076 0 3 0x10008a pause ksh 42076 326943 92868 0 3 0x92 select sshd 92868 196017 1 0 3 0x80 select sshd 12188 475557 11843 74 3 0x100092 bpf pflogd 11843 439020 1 0 3 0x80 netio pflogd 93167 107355 77392 73 3 0x100090 kqread syslogd 77392 46890 1 0 3 0x100082 netio syslogd 59899 262473 1 77 3 0x100090 poll dhclient 24747 308307 1 0 3 0x80 poll dhclient 85898 67691 0 0 2 0x14200 zerothread 80663 30219 0 0 3 0x14200 aiodoned aiodoned 87859 451475 0 0 3 0x14200 syncer update 21271 136083 0 0 3 0x14200 cleaner cleaner 24629 52491 0 0 3 0x14200 reaper reaper 13137 382670 0 0 3 0x14200 pgdaemon pagedaemon 64504 47813 0 0 3 0x14200 bored crynlk 86103 459183 0 0 3 0x14200 bored crypto 16170 411581 0 0 3 0x40014200 acpi0 acpi0 74072 319364 0 0 3 0x40014200 idle1 62144 369105 0 0 3 0x14200 bored softnet 71605 495929 0 0 3 0x14200 bored systqmp 12779 89393 0 0 3 0x14200 bored systq 54619 382488 0 0 3 0x40014200 bored softclock 77751 446007 0 0 3 0x40014200 idle0 74046 193608 0 0 3 0x14200 bored smr 1 137486 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 44155 (syz-executor.1) thread 0xffff800020b28018 (271843) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9641 7120K 14600K 78643K 48514 0 0 pcb 13 8K 8K 78643K 1101 0 0 rtable 119 12K 13K 78643K 2989 0 0 ifaddr 97 25K 28K 78643K 1407 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 2168 0 0 iov 0 0K 32K 78643K 1733 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1193 75K 77K 78643K 14530 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 200 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1635 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 14583 0 0 sigio 1 0K 0K 78643K 159 0 0 proc 55 51K 83K 78643K 2217 0 0 subproc 32 2K 2K 78643K 172 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 1258 0 0 in_multi 33 2K 2K 78643K 602 0 0 ether_multi 1 0K 0K 78643K 82 0 0 mrt 0 0K 0K 78643K 52 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 126 556K 556K 78643K 126 0 0 exec 0 0K 1K 78643K 1493 0 0 pfkey data 0 0K 0K 78643K 3 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 117 22K 31K 78643K 49423 0 0 UVM aobj 129 8K 8K 78643K 145 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 756 0 0 NDP 24 0K 0K 78643K 386 0 0 temp 256 2749K 3389K 78643K 48965 0 0 kqueue 0 0K 0K 78643K 138 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 31 0 24 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 546 0 544 1 0 1 1 0 8 0 rtentry 112 169 0 124 2 0 2 2 0 8 0 unpcb 120 4696 0 4684 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 7383 0 7383 3 3 0 2 0 8 0 tcpcb 544 2304 0 2300 1 0 1 1 0 8 0 inpcb 280 6303 0 6292 19 17 2 2 0 8 1 rttmr 72 4 0 4 4 4 0 1 0 8 0 ip6q 72 10 0 10 6 6 0 1 0 8 0 ip6af 48 20 0 20 6 6 0 1 0 8 0 nd6 48 30 0 24 1 0 1 1 0 8 0 pkpcb 40 54 0 54 22 22 0 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 276 0 276 40 39 1 1 0 8 1 pffrag 232 3 0 3 2 2 0 1 0 482 0 pffrnode 88 3 0 3 2 2 0 1 0 8 0 pffrent 40 8 0 8 3 3 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 236 0 216 1 0 1 1 0 8 0 pfstkey 112 236 0 216 1 0 1 1 0 8 0 pfstate 328 236 0 216 4 2 2 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 571 0 373 16 3 13 13 0 8 0 art_table 32 572 0 373 2 0 2 2 0 8 0 art_node 16 145 0 104 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 3 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 1633 0 1623 1 0 1 1 0 8 0 shmpl 112 143 0 16 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 24763 0 23325 47 0 47 47 0 8 0 ffsino 272 24763 0 23325 97 0 97 97 0 8 0 nchpl 144 45511 0 43882 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 145971 0 145971 6 5 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 20 0 20 12 12 0 1 0 8 0 scxspl 192 140387 0 140387 63 62 1 6 0 8 1 plimitpl 152 1375 0 1366 1 0 1 1 0 8 0 sigapl 432 14765 0 14749 3 1 2 3 0 8 0 futexpl 56 174742 0 174740 3 2 1 1 0 8 0 knotepl 112 2554 0 2535 1 0 1 1 0 8 0 kqueuepl 104 3221 0 3219 1 0 1 1 0 8 0 pipepl 112 8346 0 8327 20 19 1 2 0 8 0 fdescpl 488 14766 0 14749 3 0 3 3 0 8 0 filepl 152 88637 0 88536 29 24 5 7 0 8 1 lockfpl 104 5693 0 5693 6 5 1 1 0 8 1 lockfspl 48 1969 0 1969 6 5 1 1 0 8 1 sessionpl 112 32 0 21 1 0 1 1 0 8 0 pgrppl 48 220 0 209 1 0 1 1 0 8 0 ucredpl 96 18265 0 18256 1 0 1 1 0 8 0 zombiepl 144 14749 0 14749 6 5 1 1 0 8 1 processpl 896 14782 0 14749 4 0 4 4 0 8 0 procpl 632 47759 0 47712 34 29 5 5 0 8 1 srpgc 64 20 0 20 8 8 0 1 0 8 0 sosppl 128 207 0 207 46 46 0 1 0 8 0 sockpl 384 11711 0 11690 19 16 3 4 0 8 0 mcl64k 65536 862 0 0 72 43 29 34 0 8 1 mcl16k 16384 24 0 0 3 1 2 3 0 8 0 mcl12k 12288 49 0 0 3 1 2 2 0 8 0 mcl9k 9216 33 0 0 3 1 2 2 0 8 0 mcl8k 8192 31 0 0 4 1 3 3 0 8 0 mcl4k 4096 30 0 0 3 1 2 3 0 8 0 mcl2k2 2112 10 0 0 1 0 1 1 0 8 0 mcl2k 2048 262 0 0 29 9 20 29 0 8 0 mtagpl 80 101 0 0 2 0 2 2 0 8 0 mbufpl 256 1206 0 0 34 0 34 34 0 8 0 bufpl 256 44704 0 37675 440 0 440 440 0 8 0 anonpl 16 1264831 0 1253017 361 297 64 67 0 125 11 amapchunkpl 152 87885 0 87746 110 101 9 19 0 158 1 amappl16 192 73780 0 73140 342 302 40 45 0 8 7 amappl15 184 10 0 10 3 3 0 1 0 8 0 amappl14 176 721 0 711 1 0 1 1 0 8 0 amappl13 168 6020 0 6018 4 3 1 1 0 8 0 amappl12 160 1601 0 1598 2 1 1 1 0 8 0 amappl11 152 84 0 69 1 0 1 1 0 8 0 amappl10 144 154 0 152 1 0 1 1 0 8 0 amappl9 136 6868 0 6865 1 0 1 1 0 8 0 amappl8 128 6436 0 6406 5 3 2 2 0 8 0 amappl7 120 134 0 128 1 0 1 1 0 8 0 amappl6 112 65 0 57 1 0 1 1 0 8 0 amappl5 104 1892 0 1876 1 0 1 1 0 8 0 amappl4 96 13574 0 13543 2 1 1 2 0 8 0 amappl3 88 2855 0 2843 1 0 1 1 0 8 0 amappl2 80 124416 0 124333 3 1 2 3 0 8 0 amappl1 72 324910 0 324454 26 16 10 20 0 8 0 amappl 80 48231 0 48184 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 144 0 16 3 0 3 3 0 8 0 uaddrrnd 24 14766 0 14749 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 14766 0 14749 1 0 1 1 0 8 0 vmmpekpl 168 104545 0 104514 2 0 2 2 0 8 0 vmmpepl 168 1785577 0 1783684 394 303 91 100 0 357 8 vmsppl 368 14765 0 14749 2 0 2 2 0 8 0 pdppl 4096 29540 0 29498 6 0 6 6 0 8 0 pvpl 32 3394729 0 3379584 698 538 160 168 0 265 32 pmappl 232 14765 0 14749 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 721 0 66 19 0 19 19 0 8 0