panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 156664 36912 0 0x2 0 1 syz-executor6022 *481199 36912 0 0x2 0x4000000 0K syz-executor6022 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e85a870) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800021263860,3,ffff8000ffff6a90) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2c0838,40287401,ffff800021263860,3,fffffd807f7b7840,ffff8000ffff6a90) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806d1f5bf0,40287401,ffff800021263860,ffff8000ffff6a90) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff6a90,ffff800021263970,ffff8000212639c0) at sys_ioctl+0x4b0 syscall(ffff800021263a40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021263a40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83a8ea95d10, 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e85a870) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800021263860,3,ffff8000ffff6a90) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2c0838,40287401,ffff800021263860,3,fffffd807f7b7840,ffff8000ffff6a90) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806d1f5bf0,40287401,ffff800021263860,ffff8000ffff6a90) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff6a90,ffff800021263970,ffff8000212639c0) at sys_ioctl+0x4b0 syscall(ffff800021263a40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021263a40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83a8ea95d10, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000212632a0 rbx 0xffff8000212632b0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0xd79a8ac55581a74f r11 0x734275e47ec65dc7 r12 0x3000000008 r13 0xffff800021263350 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021263290 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor6022) pid=481199 stat=onproc flags process=2 proc=4000000 pri=52, usrpri=53, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff7a50,0xffffffff828c76b0 process=0xffff800021237b20 user=0xffff80002125e000, vmspace=0xfffffd806e9605c8 estcpu=3, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 36912 156664 61480 0 7 0x2 syz-executor6022 36912 277976 61480 0 3 0x4000082 fsleep syz-executor6022 *36912 481199 61480 0 7 0x4000002 syz-executor6022 61480 358942 40834 0 3 0x10008a sigsusp ksh 40834 183422 37382 0 3 0x92 select sshd 38471 439023 1 0 3 0x100083 ttyin getty 37382 346506 1 0 3 0x80 select sshd 2583 109319 37986 74 3 0x100092 bpf pflogd 37986 152025 1 0 3 0x80 netio pflogd 45521 255942 4455 73 3 0x100090 kqread syslogd 4455 12650 1 0 3 0x100082 netio syslogd 85648 250595 1 77 3 0x100090 poll dhclient 93153 138657 1 0 3 0x80 poll dhclient 87023 8762 0 0 3 0x14200 bored smr 53516 35952 0 0 3 0x14200 pgzero zerothread 56638 378284 0 0 3 0x14200 aiodoned aiodoned 91892 66361 0 0 3 0x14200 syncer update 36564 48584 0 0 3 0x14200 cleaner cleaner 72481 123448 0 0 3 0x14200 reaper reaper 48761 143765 0 0 3 0x14200 pgdaemon pagedaemon 81421 197349 0 0 3 0x14200 bored crynlk 21208 113589 0 0 3 0x14200 bored crypto 12120 475674 0 0 3 0x14200 bored viomb 9983 417220 0 0 3 0x40014200 acpi0 acpi0 60340 138797 0 0 3 0x40014200 idle1 20010 4661 0 0 3 0x14200 bored softnet 95827 229614 0 0 3 0x14200 bored systqmp 95812 1421 0 0 3 0x14200 bored systq 52556 412768 0 0 3 0x40014200 bored softclock 72478 181498 0 0 3 0x40014200 idle0 1 491036 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 36912 (syz-executor6022) thread 0xffff8000ffff6a90 (481199) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828d4128) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 vn_ioctl+0x40 sys/kern/vfs_vnops.c:514 #2 sys_ioctl+0x4b0 #3 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #4 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9478 6412K 6412K 78643K 10568 0 pcb 13 8K 8K 78643K 13 0 rtable 61 2K 2K 78643K 127 0 ifaddr 29 8K 8K 78643K 30 0 counters 40 33K 33K 78643K 40 0 ioctlops 0 0K 4K 78643K 1467 0 mount 1 1K 1K 78643K 1 0 vnodes 1183 74K 75K 78643K 1188 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 2 0K 0K 78643K 2 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 1 0K 0K 78643K 1 0 proc 59 63K 71K 78643K 367 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 11 0K 0K 78643K 11 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 37 175K 175K 78643K 37 0 exec 0 0K 2K 78643K 302 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 38 2K 2K 78643K 595 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 4 0K 0K 78643K 4 0 temp 23 3969K 4033K 78643K 1688 0 kqueue 2 2K 2K 78643K 2 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 2 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 120 15 0 13 1 0 1 1 0 8 0 rtentry 112 23 0 1 1 0 1 1 0 8 0 unpcb 120 29 0 19 1 0 1 1 0 8 0 syncache 296 5 0 5 2 1 1 1 0 8 1 tcpcb 736 8 0 5 1 0 1 1 0 8 0 inpcb 304 29 0 23 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 9 0 2 1 0 1 1 0 8 0 pfstkey 112 9 0 2 1 0 1 1 0 8 0 pfstate 320 9 0 2 1 0 1 1 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 97 0 0 7 0 7 7 0 8 0 art_table 32 98 0 0 1 0 1 1 0 8 0 art_node 16 22 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1398 0 16 87 0 87 87 0 8 0 ffsino 272 1398 0 16 93 0 93 93 0 8 0 nchpl 144 1572 0 33 59 1 58 58 0 8 0 uvmvnodes 72 1408 0 0 26 0 26 26 0 8 0 vnodes 224 1408 0 0 83 0 83 83 0 8 0 namei 1024 3792 0 3792 2 1 1 1 0 8 1 percpumem 16 31 0 0 1 0 1 1 0 8 0 scxspl 216 3626 0 3626 10 9 1 8 0 8 1 plimitpl 152 16 0 9 1 0 1 1 0 8 0 sigapl 424 221 0 192 4 0 4 4 0 8 0 futexpl 56 1 0 0 1 0 1 1 0 8 0 knotepl 112 5 0 0 1 0 1 1 0 8 0 kqueuepl 168 1 0 0 1 0 1 1 0 8 0 pipepl 336 64 0 60 2 1 1 1 0 8 0 fdescpl 496 205 0 192 3 0 3 3 0 8 0 filepl 152 965 0 912 3 0 3 3 0 8 0 lockfpl 104 5 0 4 1 0 1 1 0 8 0 lockfspl 48 3 0 2 1 0 1 1 0 8 0 sessionpl 144 18 0 9 1 0 1 1 0 8 0 pgrppl 48 18 0 9 1 0 1 1 0 8 0 ucredpl 96 71 0 62 1 0 1 1 0 8 0 zombiepl 144 192 0 192 2 1 1 1 0 8 1 processpl 1080 221 0 192 3 0 3 3 0 8 0 procpl 672 223 0 192 3 0 3 3 0 8 0 sockpl 432 73 0 55 4 1 3 3 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 92 0 0 11 0 11 11 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 107 0 0 6 0 6 6 0 8 0 bufpl 280 2005 0 112 136 0 136 136 0 8 0 anonpl 24 20082 0 18809 11 2 9 10 0 186 1 amapchunkpl 152 515 0 474 2 0 2 2 0 158 0 amappl16 200 84 0 79 1 0 1 1 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 22 0 19 1 0 1 1 0 8 0 amappl13 176 14 0 13 2 1 1 1 0 8 0 amappl12 168 4 0 4 2 1 1 1 0 8 1 amappl11 160 56 0 41 1 0 1 1 0 8 0 amappl10 152 11 0 9 1 0 1 1 0 8 0 amappl9 144 236 0 236 2 1 1 1 0 8 1 amappl8 136 61 0 59 1 0 1 1 0 8 0 amappl7 128 210 0 209 1 0 1 1 0 8 0 amappl6 120 59 0 51 1 0 1 1 0 8 0 amappl5 112 358 0 342 1 0 1 1 0 8 0 amappl4 104 277 0 255 1 0 1 1 0 8 0 amappl3 96 105 0 98 1 0 1 1 0 8 0 amappl2 88 859 0 799 2 0 2 2 0 8 0 amappl1 80 14175 0 13736 17 5 12 17 0 8 0 amappl 88 404 0 382 1 0 1 1 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 64 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 205 0 192 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 205 0 192 1 0 1 1 0 8 0 vmmpekpl 168 5582 0 5564 1 0 1 1 0 8 0 vmmpepl 168 30060 0 29183 50 11 39 48 0 357 0 vmsppl 368 204 0 192 2 0 2 2 0 8 0 rwobjpl 56 7783 0 7208 14 5 9 13 0 8 0 pdppl 4096 417 0 384 51 18 33 39 0 8 0 pvpl 32 81141 0 78068 35 6 29 29 0 265 4 pmappl 232 204 0 192 1 0 1 1 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 272 0 23 8 0 8 8 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e85a870) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800021263860,3,ffff8000ffff6a90) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2c0838,40287401,ffff800021263860,3,fffffd807f7b7840,ffff8000ffff6a90) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806d1f5bf0,40287401,ffff800021263860,ffff8000ffff6a90) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff6a90,ffff800021263970,ffff8000212639c0) at sys_ioctl+0x4b0 syscall(ffff800021263a40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021263a40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x83a8ea95d10, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020d68ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x5f sys/dev/kcov.c:149 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffca980, count: 10 ddb{1}> trace x86_ipi_db(ffff800020d68ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x5f sys/dev/kcov.c:149 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffca980, count: -5 ddb{1}>