panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 153857 58906 0 0 0 0 syz-executor.1 *315184 48870 0 0 0x4000000 1K 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(fffffd806ed3b950) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234c8f30,3,ffff80002123cd20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e25cc98,40287401,ffff8000234c8f30,3,fffffd807f7b7900,ffff80002123cd20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8069b33a38,40287401,ffff8000234c8f30,ffff80002123cd20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cd20,ffff8000234c9040,ffff8000234c9090) at sys_ioctl+0x4b0 syscall(ffff8000234c9110) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234c9110) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x45fd8ce650, 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ed3b950) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234c8f30,3,ffff80002123cd20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e25cc98,40287401,ffff8000234c8f30,3,fffffd807f7b7900,ffff80002123cd20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8069b33a38,40287401,ffff8000234c8f30,ffff80002123cd20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cd20,ffff8000234c9040,ffff8000234c9090) at sys_ioctl+0x4b0 syscall(ffff8000234c9110) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234c9110) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x45fd8ce650, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000234c8970 rbx 0xffff8000234c8980 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0xbeb8e991237a59a7 r11 0xeffce70da16ab778 r12 0x3000000008 r13 0xffff8000234c8a20 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000234c8960 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=315184 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff80002123d260,0xffff80002123cfd0 process=0xffff800021234880 user=0xffff8000234c4000, vmspace=0xfffffd807eff98a0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 58906 153857 17352 0 7 0 syz-executor.1 58906 342614 17352 0 2 0x4000000 syz-executor.1 48870 310420 20703 0 2 0 syz-executor.0 *48870 315184 20703 0 7 0x4000000 syz-executor.0 50078 112987 0 0 3 0x14200 bored sosplice 17352 216820 48840 0 3 0x82 nanoslp syz-executor.1 20703 84666 48840 0 3 0x82 nanoslp syz-executor.0 48840 485747 48012 0 3 0x82 thrsleep syz-fuzzer 48840 82142 48012 0 3 0x4000082 nanoslp syz-fuzzer 48840 507297 48012 0 3 0x4000082 thrsleep syz-fuzzer 48840 140172 48012 0 3 0x4000082 thrsleep syz-fuzzer 48840 287297 48012 0 3 0x4000082 thrsleep syz-fuzzer 48840 414176 48012 0 3 0x4000082 thrsleep syz-fuzzer 48840 187273 48012 0 3 0x4000082 kqread syz-fuzzer 48840 417209 48012 0 3 0x4000082 nanoslp syz-fuzzer 48012 360764 90550 0 3 0x10008a sigsusp ksh 90550 22358 36154 0 3 0x92 select sshd 2937 165905 1 0 3 0x100083 ttyin getty 36154 188583 1 0 3 0x80 select sshd 4676 483358 33451 74 3 0x100092 bpf pflogd 33451 350386 1 0 3 0x80 netio pflogd 20825 266537 97135 73 3 0x100090 kqread syslogd 97135 457256 1 0 3 0x100082 netio syslogd 47088 96909 1 77 3 0x100090 poll dhclient 65221 336325 1 0 3 0x80 poll dhclient 61433 294696 0 0 3 0x14200 bored smr 20384 149035 0 0 2 0x14200 zerothread 58535 497496 0 0 3 0x14200 aiodoned aiodoned 93719 321807 0 0 3 0x14200 syncer update 83838 69623 0 0 3 0x14200 cleaner cleaner 10436 345074 0 0 3 0x14200 reaper reaper 95422 335577 0 0 3 0x14200 pgdaemon pagedaemon 84948 167852 0 0 3 0x14200 bored crynlk 45350 111337 0 0 3 0x14200 bored crypto 31876 71612 0 0 3 0x14200 bored viomb 29440 123465 0 0 3 0x40014200 acpi0 acpi0 37882 117334 0 0 3 0x40014200 idle1 33043 287550 0 0 3 0x14200 bored softnet 52509 29684 0 0 3 0x14200 bored systqmp 30981 241251 0 0 3 0x14200 bored systq 36090 487011 0 0 3 0x40014200 bored softclock 47692 379493 0 0 3 0x40014200 idle0 1 38552 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 48870 (syz-executor.0) thread 0xffff80002123cd20 (315184) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9487 6421K 7389K 78643K 11607 0 pcb 13 8K 8K 78643K 47 0 rtable 105 3K 3K 78643K 235 0 ifaddr 44 10K 11K 78643K 70 0 counters 44 34K 34K 78643K 56 0 ioctlops 0 0K 4K 78643K 1487 0 iov 0 0K 12K 78643K 16 0 mount 1 1K 1K 78643K 1 0 vnodes 1224 77K 77K 78643K 1541 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 12 0K 0K 78643K 37 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 508 0 sigio 0 0K 0K 78643K 23 0 proc 60 63K 95K 78643K 448 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 43 201K 201K 78643K 43 0 exec 0 0K 2K 78643K 372 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 92 22K 22K 78643K 1830 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 59 0 NDP 6 0K 0K 78643K 16 0 temp 83 3976K 4040K 78643K 3936 0 kqueue 3 4K 6K 78643K 48 0 SYN cache 2 16K 16K 78643K 2 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 120 36 0 34 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 136 0 126 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 30 0 30 1 1 0 1 0 8 0 tcpcb 736 37 0 33 2 0 2 2 0 8 1 inpcb 304 229 0 222 2 0 2 2 0 8 1 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 8 0 8 1 0 1 1 0 8 1 kcovpl 48 2 0 0 1 0 1 1 0 8 0 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 5 0 4 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 11 0 5 1 0 1 1 0 8 0 pfstkey 112 11 0 5 1 0 1 1 0 8 0 pfstate 320 11 0 5 1 0 1 1 0 8 0 pfrule 1360 31 0 26 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 sysvmsgpl 40 48 0 16 1 0 1 1 0 8 0 semupl 112 9 0 9 1 0 1 1 0 8 1 semapl 112 25 0 15 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2052 0 648 89 0 89 89 0 8 1 ffsino 272 2052 0 648 94 0 94 94 0 8 0 nchpl 144 2774 0 1169 60 0 60 60 0 8 0 uvmvnodes 72 2340 0 0 43 0 43 43 0 8 0 vnodes 224 2340 0 0 138 0 138 138 0 8 0 namei 1024 6938 0 6938 1 0 1 1 0 8 1 percpumem 16 39 0 6 1 0 1 1 0 8 0 scxspl 216 7981 0 7981 9 8 1 8 0 8 1 plimitpl 152 17 0 8 1 0 1 1 0 8 0 sigapl 424 725 0 691 4 0 4 4 0 8 0 futexpl 56 3385 0 3385 1 0 1 1 0 8 1 knotepl 112 108 0 88 1 0 1 1 0 8 0 kqueuepl 168 190 0 188 1 0 1 1 0 8 0 pipepl 336 99 0 88 2 1 1 2 0 8 0 fdescpl 496 708 0 691 3 0 3 3 0 8 0 filepl 152 2590 0 2484 5 0 5 5 0 8 0 lockfpl 104 55 0 54 1 0 1 1 0 8 0 lockfspl 48 27 0 26 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 123 0 114 1 0 1 1 0 8 0 zombiepl 144 691 0 691 1 0 1 1 0 8 1 processpl 1080 725 0 691 3 0 3 3 0 8 0 procpl 672 1295 0 1252 4 0 4 4 0 8 0 sosppl 168 40 0 40 1 0 1 1 0 8 1 sockpl 432 409 0 390 3 0 3 3 0 8 0 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 1 0 0 1 0 1 1 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 102 0 0 12 0 12 12 0 8 0 mtagpl 96 139 0 0 4 0 4 4 0 8 0 mbufpl 256 475 0 0 29 0 29 29 0 8 0 bufpl 280 3830 0 181 261 0 261 261 0 8 0 anonpl 24 61201 0 57073 28 2 26 26 0 186 0 amapchunkpl 152 2715 0 2569 7 0 7 7 0 158 0 amappl16 200 2034 0 1903 8 1 7 8 0 8 0 amappl15 192 2 0 0 1 0 1 1 0 8 0 amappl14 184 271 0 266 1 0 1 1 0 8 0 amappl13 176 259 0 255 1 0 1 1 0 8 0 amappl12 168 2 0 0 1 0 1 1 0 8 0 amappl11 160 56 0 39 1 0 1 1 0 8 0 amappl10 152 17 0 12 1 0 1 1 0 8 0 amappl9 144 22 0 19 1 0 1 1 0 8 0 amappl8 136 128 0 99 2 0 2 2 0 8 0 amappl7 128 246 0 238 1 0 1 1 0 8 0 amappl6 120 65 0 54 1 0 1 1 0 8 0 amappl5 112 1145 0 1127 1 0 1 1 0 8 0 amappl4 104 520 0 496 1 0 1 1 0 8 0 amappl3 96 361 0 353 1 0 1 1 0 8 0 amappl2 88 5029 0 4945 3 1 2 3 0 8 0 amappl1 80 28558 0 28070 27 15 12 21 0 8 0 amappl 88 1549 0 1500 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 708 0 691 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 708 0 691 1 0 1 1 0 8 0 vmmpekpl 168 8137 0 8111 2 0 2 2 0 8 0 vmmpepl 168 93889 0 92462 83 19 64 76 0 357 1 vmsppl 368 707 0 691 2 0 2 2 0 8 0 rwobjpl 56 21572 0 20755 25 12 13 19 0 8 1 pdppl 4096 1423 0 1382 57 16 41 45 0 8 0 pvpl 32 277106 0 269599 117 23 94 117 0 265 33 pmappl 232 707 0 691 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 311 0 20 9 0 9 9 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff826d1ff0) 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 intr_handler(ffff8000222b71f0,ffff800000255c80) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge19_untramp() at Xintr_ioapic_edge19_untramp+0x18f end of kernel end trace frame: 0x7f7ffffd7250, count: 9 ddb{0}> trace x86_ipi_db(ffffffff826d1ff0) 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 intr_handler(ffff8000222b71f0,ffff800000255c80) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge19_untramp() at Xintr_ioapic_edge19_untramp+0x18f end of kernel end trace frame: 0x7f7ffffd7250, count: -6 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp 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(fffffd806ed3b950) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234c8f30,3,ffff80002123cd20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e25cc98,40287401,ffff8000234c8f30,3,fffffd807f7b7900,ffff80002123cd20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8069b33a38,40287401,ffff8000234c8f30,ffff80002123cd20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cd20,ffff8000234c9040,ffff8000234c9090) at sys_ioctl+0x4b0 syscall(ffff8000234c9110) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234c9110) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x45fd8ce650, count: 6 ddb{1}> 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(fffffd806ed3b950) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234c8f30,3,ffff80002123cd20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e25cc98,40287401,ffff8000234c8f30,3,fffffd807f7b7900,ffff80002123cd20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8069b33a38,40287401,ffff8000234c8f30,ffff80002123cd20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cd20,ffff8000234c9040,ffff8000234c9090) at sys_ioctl+0x4b0 syscall(ffff8000234c9110) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234c9110) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x45fd8ce650, count: -9