panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *177627 73550 32767 0x10 0x4000000 0K syz-executor.0 47180 72358 32767 0x10 0 1 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e6725c8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4af0,3,ffff8000ffff5500) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6142f0,40287401,ffff8000256d4af0,3,fffffd807f7b77e0,ffff8000ffff5500) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065c53da8,40287401,ffff8000256d4af0,ffff8000ffff5500) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff5500,ffff8000256d4c00,ffff8000256d4c50) at sys_ioctl+0x4b0 syscall(ffff8000256d4cd0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4cd0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6c3747ecae0, 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(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e6725c8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4af0,3,ffff8000ffff5500) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6142f0,40287401,ffff8000256d4af0,3,fffffd807f7b77e0,ffff8000ffff5500) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065c53da8,40287401,ffff8000256d4af0,ffff8000ffff5500) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff5500,ffff8000256d4c00,ffff8000256d4c50) at sys_ioctl+0x4b0 syscall(ffff8000256d4cd0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4cd0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6c3747ecae0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256d4530 rbx 0xffff8000256d4540 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xe2adaa102af19cb8 r11 0xe89392dbb382f5f8 r12 0x3000000008 r13 0xffff8000256d45e0 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256d4520 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=177627 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=52, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff47e0,0xffffffff828cbbd0 process=0xffff8000ffff1da8 user=0xffff8000256cf000, vmspace=0xfffffd807effa000 estcpu=4, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 73550 321416 6077 32767 2 0x10 syz-executor.0 *73550 177627 6077 32767 7 0x4000010 syz-executor.0 1193 262717 0 0 3 0x14200 bored sosplice 72358 47180 39366 32767 7 0x10 syz-executor.1 6077 175475 74063 32767 2 0x490 syz-executor.0 39366 65287 80680 0 3 0x82 wait syz-executor.1 74063 524172 80680 0 3 0x82 wait syz-executor.0 80680 196740 36944 0 3 0x82 thrsleep syz-fuzzer 80680 8947 36944 0 2 0x4000482 syz-fuzzer 80680 404653 36944 0 3 0x4000082 kqread syz-fuzzer 80680 207186 36944 0 2 0x4000002 syz-fuzzer 80680 362128 36944 0 3 0x4000082 thrsleep syz-fuzzer 80680 50818 36944 0 3 0x4000082 thrsleep syz-fuzzer 80680 302691 36944 0 3 0x4000082 thrsleep syz-fuzzer 80680 483935 36944 0 3 0x4000082 thrsleep syz-fuzzer 36944 335522 14567 0 3 0x10008a sigsusp ksh 14567 44084 84499 0 3 0x92 select sshd 20431 275057 1 0 3 0x100083 ttyin getty 84499 252227 1 0 3 0x80 select sshd 64981 130823 96246 73 2 0x100090 syslogd 96246 266372 1 0 3 0x100082 netio syslogd 20591 166992 1 77 3 0x100090 poll dhclient 95210 379743 1 0 3 0x80 poll dhclient 96509 54096 0 0 3 0x14200 bored smr 54319 362319 0 0 2 0x14200 zerothread 81595 39558 0 0 3 0x14200 aiodoned aiodoned 32961 502748 0 0 3 0x14200 syncer update 56576 172517 0 0 3 0x14200 cleaner cleaner 8668 440296 0 0 3 0x14200 reaper reaper 25435 116129 0 0 3 0x14200 pgdaemon pagedaemon 79301 325632 0 0 3 0x14200 bored crynlk 61978 249163 0 0 3 0x14200 bored crypto 90042 488412 0 0 3 0x14200 bored viomb 53298 146426 0 0 3 0x40014200 acpi0 acpi0 74534 250302 0 0 3 0x40014200 idle1 84696 98167 0 0 3 0x14200 bored softnet 27719 441824 0 0 3 0x14200 bored systqmp 96591 150760 0 0 3 0x14200 bored systq 59577 340849 0 0 3 0x40014200 bored softclock 60201 139443 0 0 3 0x40014200 idle0 1 487054 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 73550 (syz-executor.0) thread 0xffff8000ffff5500 (177627) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828cdd98) #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 9479 6350K 6350K 78643K 10569 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 191 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 15 0 iov 0 0K 0K 78643K 2 0 mount 1 1K 1K 78643K 1 0 vnodes 1216 76K 76K 78643K 1221 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 74 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 164 0 proc 48 50K 70K 78643K 365 0 subproc 34 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 8 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 324 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 152 28K 28K 78643K 1086 0 UVM aobj 10 2K 2K 78643K 10 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 9 0 temp 76 3975K 4039K 78643K 2070 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 21 0 19 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 55 0 47 1 0 1 1 0 8 0 syncache 296 7 0 7 2 1 1 1 0 8 1 tcpqe 32 710 0 710 1 0 1 1 0 8 1 tcpcb 736 40 0 36 3 0 3 3 0 8 2 inpcb 304 75 0 68 2 0 2 2 0 8 1 nd6 48 6 0 0 1 0 1 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 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 9 0 5 1 0 1 1 0 8 0 semupl 112 2 0 2 1 0 1 1 0 8 1 semapl 112 68 0 58 1 0 1 1 0 8 0 shmpl 112 7 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1553 0 158 88 0 88 88 0 8 0 ffsino 272 1553 0 158 94 0 94 94 0 8 0 nchpl 144 1953 0 357 60 0 60 60 0 8 0 uvmvnodes 72 1596 0 0 30 0 30 30 0 8 0 vnodes 224 1596 0 0 94 0 94 94 0 8 0 namei 1024 4811 0 4811 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5587 0 5587 10 2 8 8 0 8 8 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 353 0 320 4 0 4 4 0 8 0 futexpl 56 1521 0 1521 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 146 0 144 1 0 1 1 0 8 0 pipepl 336 78 0 67 2 0 2 2 0 8 1 fdescpl 496 336 0 320 3 0 3 3 0 8 0 filepl 152 1424 0 1321 6 1 5 5 0 8 0 lockfpl 104 8 0 7 1 0 1 1 0 8 0 lockfspl 48 4 0 3 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 93 0 84 1 0 1 1 0 8 0 zombiepl 144 320 0 320 2 1 1 1 0 8 1 processpl 1080 353 0 320 5 2 3 3 0 8 0 procpl 672 536 0 495 4 0 4 4 0 8 0 sosppl 168 1 0 1 1 0 1 1 0 8 1 sockpl 432 151 0 134 4 1 3 3 0 8 1 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 225 0 0 28 0 28 28 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 254 0 0 16 0 16 16 0 8 0 bufpl 280 3388 0 173 230 0 230 230 0 8 0 anonpl 24 51847 0 28221 145 2 143 143 0 186 0 amapchunkpl 152 2043 0 1473 25 0 25 25 0 158 2 amappl16 200 1297 0 370 49 0 49 49 0 8 0 amappl15 192 5 0 3 1 0 1 1 0 8 0 amappl14 184 92 0 86 1 0 1 1 0 8 0 amappl13 176 24 0 22 1 0 1 1 0 8 0 amappl12 168 11 0 9 1 0 1 1 0 8 0 amappl11 160 129 0 117 1 0 1 1 0 8 0 amappl10 152 26 0 20 1 0 1 1 0 8 0 amappl9 144 289 0 287 1 0 1 1 0 8 0 amappl8 136 120 0 88 2 0 2 2 0 8 0 amappl7 128 222 0 213 1 0 1 1 0 8 0 amappl6 120 57 0 49 1 0 1 1 0 8 0 amappl5 112 396 0 381 1 0 1 1 0 8 0 amappl4 104 378 0 349 1 0 1 1 0 8 0 amappl3 96 116 0 107 1 0 1 1 0 8 0 amappl2 88 1966 0 1894 3 1 2 3 0 8 0 amappl1 80 17950 0 17489 25 13 12 20 0 8 1 amappl 88 821 0 717 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 9 0 0 1 0 1 1 0 8 0 uaddrrnd 24 336 0 320 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 336 0 320 1 0 1 1 0 8 0 vmmpekpl 168 6355 0 6331 2 0 2 2 0 8 0 vmmpepl 168 50759 0 48510 136 8 128 128 0 357 24 vmsppl 368 335 0 320 2 0 2 2 0 8 0 rwobjpl 56 12880 0 11262 30 5 25 25 0 8 1 pdppl 4096 679 0 640 61 16 45 45 0 8 6 pvpl 32 172390 0 145599 219 0 219 219 0 265 0 pmappl 232 335 0 320 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 316 0 19 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(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e6725c8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4af0,3,ffff8000ffff5500) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6142f0,40287401,ffff8000256d4af0,3,fffffd807f7b77e0,ffff8000ffff5500) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065c53da8,40287401,ffff8000256d4af0,ffff8000ffff5500) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff5500,ffff8000256d4c00,ffff8000256d4c50) at sys_ioctl+0x4b0 syscall(ffff8000256d4cd0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4cd0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6c3747ecae0, 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(ffffffff828cdb90) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x129 sys/kern/kern_lock.c:147 upageflttrap(ffff8000256c2b50,7f7ffffd5ed0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000256c2b50) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffd6680, count: 8 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(ffffffff828cdb90) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x129 sys/kern/kern_lock.c:147 upageflttrap(ffff8000256c2b50,7f7ffffd5ed0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000256c2b50) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffd6680, count: -7