panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *234093 10039 0 0 0x4000000 0K syz-executor.1 177470 6799 0 0 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(fffffd806f1106b0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222cb2f0,3,ffff80002123cfc8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7fcc98,40287401,ffff8000222cb2f0,3,fffffd807f7b7ae0,ffff80002123cfc8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066ffc000,40287401,ffff8000222cb2f0,ffff80002123cfc8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cfc8,ffff8000222cb400,ffff8000222cb450) at sys_ioctl+0x4b0 syscall(ffff8000222cb4d0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222cb4d0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x706679262e0, 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(fffffd806f1106b0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222cb2f0,3,ffff80002123cfc8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7fcc98,40287401,ffff8000222cb2f0,3,fffffd807f7b7ae0,ffff80002123cfc8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066ffc000,40287401,ffff8000222cb2f0,ffff80002123cfc8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cfc8,ffff8000222cb400,ffff8000222cb450) at sys_ioctl+0x4b0 syscall(ffff8000222cb4d0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222cb4d0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x706679262e0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000222cad30 rbx 0xffff8000222cad40 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x14f3eb3ddf984f29 r11 0x68a1c2a7b46fdbd4 r12 0x3000000008 r13 0xffff8000222cade0 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222cad20 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=234093 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=70, nice=20 forw=0xffffffffffffffff, list=0xffff80002123c2a8,0xffffffff828c76b0 process=0xffff800021236608 user=0xffff8000222c6000, vmspace=0xfffffd807eff9730 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 10039 9005 97679 0 2 0 syz-executor.1 *10039 234093 97679 0 7 0x4000000 syz-executor.1 6799 177470 88454 0 7 0 syz-executor.0 6799 433587 88454 0 3 0x4000080 fsleep syz-executor.0 97679 318621 41576 0 2 0x482 syz-executor.1 88454 418983 41576 0 2 0x482 syz-executor.0 41576 471858 89688 0 3 0x82 thrsleep syz-fuzzer 41576 433968 89688 0 3 0x4000082 thrsleep syz-fuzzer 41576 196774 89688 0 3 0x4000082 thrsleep syz-fuzzer 41576 98713 89688 0 3 0x4000082 thrsleep syz-fuzzer 41576 516642 89688 0 3 0x4000082 thrsleep syz-fuzzer 41576 435326 89688 0 3 0x4000082 thrsleep syz-fuzzer 41576 257195 89688 0 3 0x4000082 thrsleep syz-fuzzer 41576 236810 89688 0 3 0x4000082 kqread syz-fuzzer 89688 256066 20654 0 3 0x10008a sigsusp ksh 20654 417291 86901 0 3 0x92 select sshd 79981 410879 1 0 3 0x100083 ttyin getty 86901 293340 1 0 3 0x80 select sshd 45833 464457 66298 74 3 0x100092 bpf pflogd 66298 284196 1 0 3 0x80 netio pflogd 65111 38283 5791 73 2 0x100090 syslogd 5791 312216 1 0 3 0x100082 netio syslogd 43528 336927 1 77 3 0x100090 poll dhclient 70228 196896 1 0 3 0x80 poll dhclient 7592 390120 0 0 3 0x14200 bored smr 87117 401543 0 0 2 0x14200 zerothread 39689 91584 0 0 3 0x14200 aiodoned aiodoned 48677 502239 0 0 3 0x14200 syncer update 40915 304068 0 0 3 0x14200 cleaner cleaner 9357 259429 0 0 3 0x14200 reaper reaper 19906 455428 0 0 3 0x14200 pgdaemon pagedaemon 13716 265563 0 0 3 0x14200 bored crynlk 66589 225086 0 0 3 0x14200 bored crypto 68273 26692 0 0 3 0x14200 bored viomb 86919 403978 0 0 3 0x40014200 acpi0 acpi0 952 192483 0 0 3 0x40014200 idle1 44098 125933 0 0 3 0x14200 bored softnet 25694 255782 0 0 3 0x14200 bored systqmp 95809 146952 0 0 3 0x14200 bored systq 33669 237158 0 0 3 0x40014200 bored softclock 15057 20790 0 0 3 0x40014200 idle0 1 197748 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 10039 (syz-executor.1) thread 0xffff80002123cfc8 (234093) 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 9494 6545K 6739K 78643K 10727 0 pcb 13 8K 8K 78643K 15 0 rtable 109 4K 4K 78643K 213 0 ifaddr 44 10K 10K 78643K 45 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1482 0 mount 1 1K 1K 78643K 1 0 vnodes 1218 77K 77K 78643K 1278 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 6 0K 0K 78643K 6 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 279 0 proc 61 63K 95K 78643K 452 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 12 0 in_multi 33 2K 2K 78643K 38 0 ether_multi 1 0K 0K 78643K 3 0 mrt 0 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 368 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 156 29K 29K 78643K 1408 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 10 0 NDP 6 0K 0K 78643K 10 0 temp 69 3972K 4036K 78643K 2588 0 kqueue 3 4K 8K 78643K 9 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 27 0 25 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 41 0 31 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 441 0 441 3 3 0 2 0 8 0 tcpcb 736 35 0 21 2 0 2 2 0 8 0 inpcb 304 82 0 75 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 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 pfrktable 1344 1 0 0 1 0 1 1 0 8 0 pftag 88 1 0 0 1 0 1 1 0 8 0 pfstitem 24 13 0 2 1 0 1 1 0 8 0 pfstkey 112 13 0 2 1 0 1 1 0 8 0 pfstate 320 13 0 2 1 0 1 1 0 8 0 pfrule 1360 34 0 23 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 188 0 0 12 0 12 12 0 8 0 art_table 32 189 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 1 1 0 1 1 0 8 0 semupl 112 3 0 3 1 0 1 1 0 8 1 semapl 112 4 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1692 0 289 88 0 88 88 0 8 0 ffsino 272 1692 0 289 95 1 94 94 0 8 0 nchpl 144 2155 0 550 60 0 60 60 0 8 0 uvmvnodes 72 1780 0 0 33 0 33 33 0 8 0 vnodes 224 1780 0 0 105 0 105 105 0 8 0 namei 1024 5472 0 5472 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 6391 0 6391 10 9 1 8 0 8 1 plimitpl 152 24 0 15 1 0 1 1 0 8 0 sigapl 424 495 0 462 4 0 4 4 0 8 0 futexpl 56 1480 0 1479 1 0 1 1 0 8 0 knotepl 112 69 0 49 1 0 1 1 0 8 0 kqueuepl 168 194 0 191 1 0 1 1 0 8 0 pipepl 336 76 0 65 1 0 1 1 0 8 0 fdescpl 496 479 0 462 3 0 3 3 0 8 0 filepl 152 1752 0 1645 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 124 0 115 1 0 1 1 0 8 0 zombiepl 144 462 0 462 2 1 1 1 0 8 1 processpl 1080 495 0 462 3 0 3 3 0 8 0 procpl 672 825 0 783 5 1 4 4 0 8 0 sockpl 432 152 0 133 3 0 3 3 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 297 0 0 35 0 35 35 0 8 0 mtagpl 96 9 0 0 1 0 1 1 0 8 0 mbufpl 256 314 0 0 18 0 18 18 0 8 0 bufpl 280 3586 0 181 244 0 244 244 0 8 0 anonpl 24 54506 0 37693 103 1 102 102 0 186 0 amapchunkpl 152 2264 0 1856 18 0 18 18 0 158 2 amappl16 200 1420 0 758 35 0 35 35 0 8 0 amappl15 192 126 0 125 2 1 1 1 0 8 0 amappl14 184 22 0 19 1 0 1 1 0 8 0 amappl13 176 153 0 149 1 0 1 1 0 8 0 amappl12 168 6 0 5 2 1 1 1 0 8 0 amappl11 160 57 0 40 1 0 1 1 0 8 0 amappl10 152 18 0 13 1 0 1 1 0 8 0 amappl9 144 249 0 249 1 1 0 1 0 8 0 amappl8 136 156 0 114 2 0 2 2 0 8 0 amappl7 128 244 0 236 1 0 1 1 0 8 0 amappl6 120 69 0 58 1 0 1 1 0 8 0 amappl5 112 570 0 553 1 0 1 1 0 8 0 amappl4 104 281 0 256 1 0 1 1 0 8 0 amappl3 96 375 0 361 1 0 1 1 0 8 0 amappl2 88 2929 0 2853 3 1 2 3 0 8 0 amappl1 80 22593 0 22090 26 14 12 21 0 8 0 amappl 88 1132 0 1032 3 0 3 3 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 479 0 462 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 479 0 462 1 0 1 1 0 8 0 vmmpekpl 168 6888 0 6855 3 1 2 2 0 8 0 vmmpepl 168 67302 0 65275 122 20 102 102 0 357 13 vmsppl 368 478 0 462 2 0 2 2 0 8 0 rwobjpl 56 16347 0 14934 30 9 21 21 0 8 0 pdppl 4096 965 0 924 65 20 45 45 0 8 4 pvpl 32 247662 0 227694 177 9 168 168 0 265 5 pmappl 232 478 0 462 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 330 0 25 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(fffffd806f1106b0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222cb2f0,3,ffff80002123cfc8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7fcc98,40287401,ffff8000222cb2f0,3,fffffd807f7b7ae0,ffff80002123cfc8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066ffc000,40287401,ffff8000222cb2f0,ffff80002123cfc8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cfc8,ffff8000222cb400,ffff8000222cb450) at sys_ioctl+0x4b0 syscall(ffff8000222cb4d0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222cb4d0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x706679262e0, 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+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x129 sys/kern/kern_lock.c:147 syscall(ffff8000234d37c0) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000234d37c0) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd7e90, 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+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x129 sys/kern/kern_lock.c:147 syscall(ffff8000234d37c0) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000234d37c0) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd7e90, count: -6