panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *372532 61615 0 0 0x4000000 0K syz-executor.1 110478 71316 0 0x2 0 1 syz-executor.0 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(fffffd806e2775d0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000244e30d0,3,ffff80002123c2a8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ed3ec98,40287401,ffff8000244e30d0,3,fffffd807f7b77e0,ffff80002123c2a8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80679fba18,40287401,ffff8000244e30d0,ffff80002123c2a8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123c2a8,ffff8000244e31e0,ffff8000244e3230) at sys_ioctl+0x4b0 syscall(ffff8000244e32b0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000244e32b0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x31c1d9984b0, 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(fffffd806e2775d0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000244e30d0,3,ffff80002123c2a8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ed3ec98,40287401,ffff8000244e30d0,3,fffffd807f7b77e0,ffff80002123c2a8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80679fba18,40287401,ffff8000244e30d0,ffff80002123c2a8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123c2a8,ffff8000244e31e0,ffff8000244e3230) at sys_ioctl+0x4b0 syscall(ffff8000244e32b0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000244e32b0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x31c1d9984b0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000244e2b10 rbx 0xffff8000244e2b20 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x37cf1cd34bf14909 r11 0xa0363f3e6d30d3f r12 0x3000000008 r13 0xffff8000244e2bc0 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000244e2b00 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=372532 stat=onproc flags process=0 proc=4000000 pri=62, usrpri=62, nice=20 forw=0xffffffffffffffff, list=0xffff80002123cd28,0xffffffff828c76b0 process=0xffff800021234cb8 user=0xffff8000244de000, vmspace=0xfffffd807eff9a10 estcpu=12, cpticks=2, pctcpu=0.1 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 61615 68871 48373 0 2 0 syz-executor.1 *61615 372532 48373 0 7 0x4000000 syz-executor.1 48373 295467 23573 0 2 0x482 syz-executor.1 71316 110478 23573 0 7 0x2 syz-executor.0 23573 242156 23403 0 3 0x82 thrsleep syz-fuzzer 23573 337334 23403 0 3 0x4000082 thrsleep syz-fuzzer 23573 362210 23403 0 3 0x4000082 thrsleep syz-fuzzer 23573 500286 23403 0 3 0x4000082 kqread syz-fuzzer 23573 350973 23403 0 3 0x4000082 thrsleep syz-fuzzer 23573 425276 23403 0 3 0x4000082 thrsleep syz-fuzzer 23573 345265 23403 0 3 0x4000082 thrsleep syz-fuzzer 23573 203577 23403 0 3 0x4000082 thrsleep syz-fuzzer 23403 468760 57552 0 3 0x10008a sigsusp ksh 57552 27646 13702 0 3 0x92 select sshd 56805 113006 1 0 3 0x100083 ttyin getty 13702 86102 1 0 3 0x80 select sshd 7250 187258 49787 74 3 0x100092 bpf pflogd 49787 435441 1 0 3 0x80 netio pflogd 55677 368648 85433 73 2 0x100090 syslogd 85433 10179 1 0 3 0x100082 netio syslogd 2896 192084 1 77 3 0x100090 poll dhclient 49767 212667 1 0 3 0x80 poll dhclient 6480 482478 0 0 3 0x14200 bored smr 45954 184875 0 0 3 0x14200 pgzero zerothread 79024 485353 0 0 3 0x14200 aiodoned aiodoned 86777 167682 0 0 3 0x14200 syncer update 60000 30893 0 0 3 0x14200 cleaner cleaner 7802 92087 0 0 3 0x14200 reaper reaper 41255 292883 0 0 3 0x14200 pgdaemon pagedaemon 49294 422066 0 0 3 0x14200 bored crynlk 68688 114616 0 0 3 0x14200 bored crypto 19134 291500 0 0 3 0x14200 bored viomb 7565 226236 0 0 3 0x40014200 acpi0 acpi0 37288 282170 0 0 3 0x40014200 idle1 87747 449606 0 0 3 0x14200 bored softnet 52127 432411 0 0 3 0x14200 bored systqmp 29733 188137 0 0 3 0x14200 bored systq 42890 388686 0 0 3 0x40014200 bored softclock 71761 39633 0 0 3 0x40014200 idle0 1 509815 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 61615 (syz-executor.1) thread 0xffff80002123c2a8 (372532) 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 Process 71316 (syz-executor.0) thread 0xffff80002123d508 (110478) exclusive rwlock pipelk r = 0 (0xfffffd806f834520) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 pipe_write+0x36f sys/kern/sys_pipe.c:560 #2 dofilewritev+0x1ab sys/kern/sys_generic.c:365 #3 sys_write+0x83 sys/kern/sys_generic.c:285 #4 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #4 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #5 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9484 6416K 6416K 78643K 10574 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 199 0 ifaddr 44 10K 10K 78643K 45 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1469 0 mount 1 1K 1K 78643K 1 0 vnodes 1216 76K 76K 78643K 1222 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 5 13K 25K 78643K 36 0 proc 59 63K 95K 78643K 447 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 33 2K 2K 78643K 33 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 358 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 153 28K 29K 78643K 833 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 10 0K 0K 78643K 10 0 temp 65 3971K 4033K 78643K 2042 0 kqueue 3 4K 4K 78643K 3 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 6 0 0 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 120 19 0 17 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 25 0 15 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 549 0 549 1 0 1 1 0 8 1 tcpcb 736 10 0 6 1 0 1 1 0 8 0 inpcb 304 39 0 32 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 kcovpl 48 2 0 0 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 12 0 0 1 0 1 1 0 8 0 pfstkey 112 12 0 0 1 0 1 1 0 8 0 pfstate 320 12 0 0 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 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1426 0 22 88 0 88 88 0 8 0 ffsino 272 1426 0 22 95 1 94 94 0 8 0 nchpl 144 1645 0 38 60 0 60 60 0 8 0 uvmvnodes 72 1470 0 0 27 0 27 27 0 8 0 vnodes 224 1470 0 0 87 0 87 87 0 8 0 namei 1024 4273 0 4273 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 4673 0 4673 3 2 1 2 0 8 1 plimitpl 152 17 0 8 1 0 1 1 0 8 0 sigapl 424 252 0 220 4 0 4 4 0 8 0 futexpl 56 13 0 13 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 2 0 0 1 0 1 1 0 8 0 pipepl 336 76 0 65 1 0 1 1 0 8 0 fdescpl 496 236 0 220 3 0 3 3 0 8 0 filepl 152 1103 0 997 6 1 5 5 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 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 62 0 53 1 0 1 1 0 8 0 zombiepl 144 220 0 220 2 1 1 1 0 8 1 processpl 1080 252 0 220 3 0 3 3 0 8 0 procpl 672 262 0 222 5 1 4 4 0 8 0 sockpl 432 83 0 64 3 0 3 3 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 217 0 0 27 0 27 27 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 219 0 0 14 0 14 14 0 8 0 bufpl 280 3336 0 181 226 0 226 226 0 8 0 anonpl 24 37753 0 22479 96 2 94 94 0 186 1 amapchunkpl 152 1341 0 1007 17 1 16 16 0 158 0 amappl16 200 748 0 111 34 0 34 34 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 26 0 20 1 0 1 1 0 8 0 amappl13 176 34 0 30 1 0 1 1 0 8 0 amappl12 168 6 0 6 2 2 0 1 0 8 0 amappl11 160 55 0 38 1 0 1 1 0 8 0 amappl10 152 18 0 12 1 0 1 1 0 8 0 amappl9 144 277 0 277 1 1 0 1 0 8 0 amappl8 136 190 0 127 3 0 3 3 0 8 0 amappl7 128 241 0 235 1 0 1 1 0 8 0 amappl6 120 69 0 59 1 0 1 1 0 8 0 amappl5 112 396 0 380 1 0 1 1 0 8 0 amappl4 104 279 0 256 1 0 1 1 0 8 0 amappl3 96 126 0 114 1 0 1 1 0 8 0 amappl2 88 997 0 930 3 1 2 3 0 8 0 amappl1 80 15790 0 15313 27 9 18 21 0 8 6 amappl 88 556 0 475 2 0 2 2 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 236 0 220 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 236 0 220 1 0 1 1 0 8 0 vmmpekpl 168 6074 0 6043 3 1 2 2 0 8 0 vmmpepl 168 37013 0 35130 122 10 112 112 0 357 26 vmsppl 368 235 0 220 2 0 2 2 0 8 0 rwobjpl 56 10037 0 8665 29 7 22 22 0 8 1 pdppl 4096 479 0 440 60 15 45 45 0 8 6 pvpl 32 134804 0 116018 153 0 153 153 0 265 1 pmappl 232 235 0 220 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 312 0 20 9 0 9 9 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(fffffd806e2775d0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000244e30d0,3,ffff80002123c2a8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ed3ec98,40287401,ffff8000244e30d0,3,fffffd807f7b77e0,ffff80002123c2a8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80679fba18,40287401,ffff8000244e30d0,ffff80002123c2a8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123c2a8,ffff8000244e31e0,ffff8000244e3230) at sys_ioctl+0x4b0 syscall(ffff8000244e32b0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000244e32b0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x31c1d9984b0, 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+0x43 sys/dev/kcov.c:149 __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 sys/kern/kern_lock.c:147 pipeselwakeup(fffffd806f834480) at pipeselwakeup+0x4e sys/kern/sys_pipe.c:366 pipe_write(fffffd80683c03a8,ffff8000212ace88,0) at pipe_write+0x785 dofilewritev(ffff80002123d508,f8,ffff8000212ace88,0,ffff8000212acf70) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80002123d508,ffff8000212acf20,ffff8000212acf70) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff8000212acff0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212acff0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc1570, count: 4 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+0x43 sys/dev/kcov.c:149 __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 sys/kern/kern_lock.c:147 pipeselwakeup(fffffd806f834480) at pipeselwakeup+0x4e sys/kern/sys_pipe.c:366 pipe_write(fffffd80683c03a8,ffff8000212ace88,0) at pipe_write+0x785 dofilewritev(ffff80002123d508,f8,ffff8000212ace88,0,ffff8000212acf70) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff80002123d508,ffff8000212acf20,ffff8000212acf70) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff8000212acff0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212acff0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc1570, count: -11