panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 214039 69700 0 0 0 1 syz-executor.0 *112058 69700 0 0 0x4000000 0K 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(fffffd806e450790) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000230c34e0,3,ffff8000212827e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2ddbb8,40287401,ffff8000230c34e0,3,fffffd807f7b7960,ffff8000212827e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806838a850,40287401,ffff8000230c34e0,ffff8000212827e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212827e0,ffff8000230c35f0,ffff8000230c3640) at sys_ioctl+0x4b0 syscall(ffff8000230c36c0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000230c36c0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2c027d40270, 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(fffffd806e450790) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000230c34e0,3,ffff8000212827e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2ddbb8,40287401,ffff8000230c34e0,3,fffffd807f7b7960,ffff8000212827e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806838a850,40287401,ffff8000230c34e0,ffff8000212827e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212827e0,ffff8000230c35f0,ffff8000230c3640) at sys_ioctl+0x4b0 syscall(ffff8000230c36c0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000230c36c0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2c027d40270, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000230c2f20 rbx 0xffff8000230c2f30 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0xe62e7bf2f83b7756 r11 0xa402f1da678c5d16 r12 0x3000000008 r13 0xffff8000230c2fd0 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000230c2f10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=112058 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=62, nice=20 forw=0xffffffffffffffff, list=0xffff8000212822a0,0xffff800021282d30 process=0xffff800021234448 user=0xffff8000230be000, vmspace=0xfffffd807eff92e0 estcpu=12, cpticks=5, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 4903 447599 98426 0 2 0 syz-executor.1 4903 362022 98426 0 3 0x4000080 semwait syz-executor.1 69700 214039 96457 0 7 0 syz-executor.0 *69700 112058 96457 0 7 0x4000000 syz-executor.0 98426 344961 42012 0 2 0x482 syz-executor.1 96457 199625 42012 0 2 0x482 syz-executor.0 42012 326052 4408 0 3 0x82 thrsleep syz-fuzzer 42012 330918 4408 0 3 0x4000082 thrsleep syz-fuzzer 42012 183651 4408 0 3 0x4000082 thrsleep syz-fuzzer 42012 110645 4408 0 3 0x4000082 thrsleep syz-fuzzer 42012 179195 4408 0 3 0x4000082 kqread syz-fuzzer 42012 294395 4408 0 3 0x4000082 thrsleep syz-fuzzer 42012 257310 4408 0 3 0x4000082 thrsleep syz-fuzzer 42012 464508 4408 0 3 0x4000082 thrsleep syz-fuzzer 4408 232444 13462 0 3 0x10008a sigsusp ksh 13462 148776 31290 0 3 0x92 select sshd 97545 41755 1 0 3 0x100083 ttyin getty 31290 483423 1 0 3 0x80 select sshd 87129 239162 71570 74 3 0x100092 bpf pflogd 71570 69428 1 0 3 0x80 netio pflogd 2031 10734 68486 73 2 0x100090 syslogd 68486 505171 1 0 3 0x100082 netio syslogd 20569 40611 1 77 3 0x100090 poll dhclient 81634 165116 1 0 3 0x80 poll dhclient 20627 165154 0 0 3 0x14200 bored smr 2926 363294 0 0 2 0x14200 zerothread 30234 479542 0 0 3 0x14200 aiodoned aiodoned 19907 409703 0 0 3 0x14200 syncer update 85880 27619 0 0 3 0x14200 cleaner cleaner 40256 422767 0 0 3 0x14200 reaper reaper 91068 359132 0 0 3 0x14200 pgdaemon pagedaemon 89697 222067 0 0 3 0x14200 bored crynlk 9353 374653 0 0 3 0x14200 bored crypto 25572 101781 0 0 3 0x14200 bored viomb 22700 370699 0 0 3 0x40014200 acpi0 acpi0 39381 15932 0 0 3 0x40014200 idle1 71628 485253 0 0 3 0x14200 bored softnet 74240 439682 0 0 3 0x14200 bored systqmp 58241 363748 0 0 3 0x14200 bored systq 32560 478560 0 0 3 0x40014200 bored softclock 55334 366249 0 0 3 0x40014200 idle0 1 371405 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 69700 (syz-executor.0) thread 0xffff8000212827e0 (112058) 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 9484 6416K 6547K 78643K 10588 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 199 0 ifaddr 45 10K 10K 78643K 46 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1471 0 mount 1 1K 1K 78643K 1 0 vnodes 1218 77K 77K 78643K 1228 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 5 0K 0K 78643K 7 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 61 0 proc 59 63K 83K 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 ip_moptions 0 0K 0K 78643K 4 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 360 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 142 28K 28K 78643K 877 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 6 0K 0K 78643K 10 0 temp 65 3971K 4035K 78643K 2100 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 29 0 19 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 896 0 896 2 0 2 2 0 8 2 tcpcb 736 14 0 8 1 0 1 1 0 8 0 inpcb 304 49 0 42 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 pftag 88 1 0 0 1 0 1 1 0 8 0 pfqueue 264 2 0 0 1 0 1 1 0 8 0 pfstitem 24 12 0 2 1 0 1 1 0 8 0 pfstkey 112 12 0 2 1 0 1 1 0 8 0 pfstate 320 12 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 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 semupl 112 5 0 4 1 0 1 1 0 8 0 semapl 112 3 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1452 0 48 88 0 88 88 0 8 0 ffsino 272 1452 0 48 95 1 94 94 0 8 0 nchpl 144 1697 0 92 60 0 60 60 0 8 0 uvmvnodes 72 1502 0 0 28 0 28 28 0 8 0 vnodes 224 1502 0 0 89 0 89 89 0 8 0 namei 1024 4387 0 4387 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5031 0 5031 10 2 8 8 0 8 8 plimitpl 152 17 0 8 1 0 1 1 0 8 0 sigapl 424 277 0 244 4 0 4 4 0 8 0 futexpl 56 165 0 165 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 23 0 21 1 0 1 1 0 8 0 pipepl 336 76 0 65 1 0 1 1 0 8 0 fdescpl 496 261 0 244 3 0 3 3 0 8 0 filepl 152 1173 0 1067 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 244 0 244 2 1 1 1 0 8 1 processpl 1080 277 0 244 3 0 3 3 0 8 0 procpl 672 323 0 281 4 0 4 4 0 8 0 sockpl 432 97 0 78 3 0 3 3 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 297 0 0 37 0 37 37 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 313 0 0 20 0 20 20 0 8 0 bufpl 280 3363 0 181 228 0 228 228 0 8 0 anonpl 24 39265 0 24006 95 2 93 93 0 186 1 amapchunkpl 152 1473 0 1120 17 1 16 16 0 158 1 amappl16 200 795 0 175 33 0 33 33 0 8 0 amappl15 192 2 0 1 1 0 1 1 0 8 0 amappl14 184 34 0 30 1 0 1 1 0 8 0 amappl13 176 28 0 24 1 0 1 1 0 8 0 amappl12 168 6 0 4 2 1 1 1 0 8 0 amappl11 160 54 0 37 1 0 1 1 0 8 0 amappl10 152 41 0 34 1 0 1 1 0 8 0 amappl9 144 203 0 201 1 0 1 1 0 8 0 amappl8 136 156 0 112 2 0 2 2 0 8 0 amappl7 128 244 0 237 1 0 1 1 0 8 0 amappl6 120 79 0 68 1 0 1 1 0 8 0 amappl5 112 569 0 551 1 0 1 1 0 8 0 amappl4 104 285 0 256 1 0 1 1 0 8 0 amappl3 96 127 0 117 1 0 1 1 0 8 0 amappl2 88 1219 0 1141 3 1 2 3 0 8 0 amappl1 80 16270 0 15773 27 15 12 21 0 8 0 amappl 88 612 0 528 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 261 0 244 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 261 0 244 1 0 1 1 0 8 0 vmmpekpl 168 6146 0 6115 2 0 2 2 0 8 0 vmmpepl 168 40143 0 38177 124 16 108 108 0 357 22 vmsppl 368 260 0 244 2 0 2 2 0 8 0 rwobjpl 56 10681 0 9327 29 8 21 21 0 8 1 pdppl 4096 529 0 488 64 19 45 45 0 8 4 pvpl 32 144933 0 126027 156 3 153 153 0 265 0 pmappl 232 260 0 244 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 332 0 24 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(fffffd806e450790) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000230c34e0,3,ffff8000212827e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2ddbb8,40287401,ffff8000230c34e0,3,fffffd807f7b7960,ffff8000212827e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806838a850,40287401,ffff8000230c34e0,ffff8000212827e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212827e0,ffff8000230c35f0,ffff8000230c3640) at sys_ioctl+0x4b0 syscall(ffff8000230c36c0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000230c36c0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2c027d40270, 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 __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 sys/kern/kern_lock.c:147 syscall(ffff8000234d1750) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000234d1750) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7f90, count: 9 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 __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 sys/kern/kern_lock.c:147 syscall(ffff8000234d1750) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000234d1750) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7f90, count: -6