panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 505768 22950 32767 0x10 0 0 syz-executor.1 *113644 22950 32767 0x10 0x4000000 1K 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(fffffd806e60b088) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e6090,3,ffff800021cac7e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e555210,40287401,ffff8000256e6090,3,fffffd807f7b7960,ffff800021cac7e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806a260010,40287401,ffff8000256e6090,ffff800021cac7e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021cac7e0,ffff8000256e61a0,ffff8000256e61f0) at sys_ioctl+0x4b0 syscall(ffff8000256e6270) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e6270) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9475af38390, 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(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e60b088) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e6090,3,ffff800021cac7e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e555210,40287401,ffff8000256e6090,3,fffffd807f7b7960,ffff800021cac7e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806a260010,40287401,ffff8000256e6090,ffff800021cac7e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021cac7e0,ffff8000256e61a0,ffff8000256e61f0) at sys_ioctl+0x4b0 syscall(ffff8000256e6270) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e6270) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9475af38390, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256e5ad0 rbx 0xffff8000256e5ae0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0x400c8627b250b07d r11 0x64ef91aee881f69d r12 0x3000000008 r13 0xffff8000256e5b80 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256e5ac0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=113644 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021cac2a0,0xffffffff828cbbd0 process=0xffff8000ffff1100 user=0xffff8000256e1000, vmspace=0xfffffd807effa730 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 22950 505768 35891 32767 7 0x10 syz-executor.1 *22950 113644 35891 32767 7 0x4000010 syz-executor.1 74418 9051 49827 32767 3 0x90 nanoslp syz-executor.0 74418 339096 49827 32767 3 0x4000090 netio syz-executor.0 49827 309860 65666 32767 3 0x90 nanoslp syz-executor.0 65666 213984 19145 0 3 0x82 wait syz-executor.0 35891 24910 94501 32767 3 0x90 nanoslp syz-executor.1 94501 178338 19145 0 3 0x82 wait syz-executor.1 19145 150183 1714 0 3 0x82 thrsleep syz-fuzzer 19145 185793 1714 0 3 0x4000082 nanoslp syz-fuzzer 19145 232305 1714 0 3 0x4000082 kqread syz-fuzzer 19145 449456 1714 0 3 0x4000082 thrsleep syz-fuzzer 19145 253072 1714 0 3 0x4000082 thrsleep syz-fuzzer 19145 204633 1714 0 3 0x4000082 thrsleep syz-fuzzer 19145 436872 1714 0 3 0x4000082 thrsleep syz-fuzzer 19145 201663 1714 0 3 0x4000082 thrsleep syz-fuzzer 1714 436423 6835 0 3 0x10008a sigsusp ksh 6835 247764 47851 0 3 0x92 select sshd 86590 322198 1 0 3 0x100083 ttyin getty 47851 336500 1 0 3 0x80 select sshd 70343 159931 7591 73 3 0x100090 kqread syslogd 7591 496965 1 0 3 0x100082 netio syslogd 76626 214692 1 77 3 0x100090 poll dhclient 27898 485108 1 0 3 0x80 poll dhclient 13359 404191 0 0 3 0x14200 bored smr 73361 495639 0 0 3 0x14200 pgzero zerothread 66753 287001 0 0 3 0x14200 aiodoned aiodoned 80460 325827 0 0 3 0x14200 syncer update 69510 235717 0 0 3 0x14200 cleaner cleaner 83707 303573 0 0 3 0x14200 reaper reaper 24602 491707 0 0 3 0x14200 pgdaemon pagedaemon 66451 308800 0 0 3 0x14200 bored crynlk 33617 85239 0 0 3 0x14200 bored crypto 40337 239767 0 0 3 0x14200 bored viomb 85891 191973 0 0 3 0x40014200 acpi0 acpi0 74318 151532 0 0 3 0x40014200 idle1 88491 399658 0 0 3 0x14200 bored softnet 38655 27752 0 0 3 0x14200 bored systqmp 81421 450464 0 0 3 0x14200 bored systq 51960 64856 0 0 3 0x40014200 bored softclock 33059 157048 0 0 3 0x40014200 idle0 1 64337 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 22950 (syz-executor.1) thread 0xffff800021cac7e0 (113644) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9479 6350K 6350K 78643K 10572 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 233 0 ifaddr 39 10K 10K 78643K 46 0 counters 44 34K 34K 78643K 46 0 ioctlops 0 0K 2K 78643K 22 0 iov 0 0K 0K 78643K 1784 0 mount 1 1K 1K 78643K 1 0 vnodes 1216 76K 76K 78643K 1240 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 4 0 VM map 2 1K 1K 78643K 2 0 sem 9 1K 1K 78643K 15 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 15634 0 sigio 0 0K 0K 78643K 5 0 proc 48 50K 83K 78643K 419 0 subproc 34 2K 2K 78643K 51 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 44 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 348 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 561 68K 68K 78643K 34132 0 UVM aobj 6 2K 2K 78643K 6 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 12 0 temp 101 3981K 4045K 78643K 33138 0 kqueue 3 4K 7K 78643K 10 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 8 0 2 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 57 0 13 2 0 2 2 0 8 0 unpcb 120 7363 0 7353 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 233 0 233 1 1 0 1 0 8 0 tcpcb 736 18 0 14 1 0 1 1 0 8 0 inpcb 304 48 0 41 1 0 1 1 0 8 0 nd6 48 10 0 4 1 0 1 1 0 8 0 kcovpl 48 3 0 1 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 237 0 49 13 1 12 13 0 8 0 art_table 32 238 0 49 2 0 2 2 0 8 0 art_node 16 56 0 16 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 7 0 0 1 0 1 1 0 8 0 shmpl 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 17054 0 15658 88 0 88 88 0 8 0 ffsino 272 17054 0 15658 94 0 94 94 0 8 0 nchpl 144 33045 0 31460 60 0 60 60 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 67540 0 67540 2 1 1 1 0 8 1 percpumem 16 34 0 1 1 0 1 1 0 8 0 scxspl 216 98622 0 98622 9 8 1 8 0 8 1 plimitpl 152 19 0 9 1 0 1 1 0 8 0 sigapl 424 15819 0 15786 4 0 4 4 0 8 0 futexpl 56 95862 0 95862 1 0 1 1 0 8 1 knotepl 112 81 0 61 1 0 1 1 0 8 0 kqueuepl 168 18558 0 18551 1 0 1 1 0 8 0 pipepl 336 144 0 133 7 5 2 2 0 8 1 fdescpl 496 15803 0 15786 3 0 3 3 0 8 0 filepl 152 43519 0 43410 8 3 5 5 0 8 0 lockfpl 104 28 0 27 1 0 1 1 0 8 0 lockfspl 48 11 0 10 1 0 1 1 0 8 0 sessionpl 144 18 0 8 1 0 1 1 0 8 0 pgrppl 48 18 0 8 1 0 1 1 0 8 0 ucredpl 96 129 0 120 1 0 1 1 0 8 0 zombiepl 144 15786 0 15786 2 1 1 1 0 8 1 processpl 1080 15819 0 15786 5 2 3 3 0 8 0 procpl 672 32718 0 32676 10 5 5 5 0 8 1 sockpl 432 7458 0 7439 13 9 4 5 0 8 1 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 11 0 0 2 0 2 2 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 18 0 0 3 0 3 3 0 8 0 mcl2k2 2112 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 301 0 0 28 4 24 28 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 615 0 0 24 0 24 24 0 8 0 bufpl 280 18843 0 12598 447 0 447 447 0 8 0 anonpl 24 1068632 0 1010493 576 8 568 574 0 186 0 amapchunkpl 152 55584 0 52942 151 18 133 149 0 158 4 amappl16 200 25168 0 22995 115 0 115 115 0 8 0 amappl15 192 3 0 0 1 0 1 1 0 8 0 amappl14 184 52 0 47 1 0 1 1 0 8 0 amappl13 176 33 0 30 1 0 1 1 0 8 0 amappl12 168 16 0 13 1 0 1 1 0 8 0 amappl11 160 129 0 113 1 0 1 1 0 8 0 amappl10 152 7779 0 7775 1 0 1 1 0 8 0 amappl9 144 8028 0 8026 2 1 1 1 0 8 0 amappl8 136 164 0 118 2 0 2 2 0 8 0 amappl7 128 7968 0 7957 1 0 1 1 0 8 0 amappl6 120 7842 0 7832 1 0 1 1 0 8 0 amappl5 112 16025 0 16005 1 0 1 1 0 8 0 amappl4 104 259 0 234 1 0 1 1 0 8 0 amappl3 96 163 0 154 1 0 1 1 0 8 0 amappl2 88 125613 0 125537 3 1 2 3 0 8 0 amappl1 80 473198 0 472700 30 18 12 20 0 8 1 amappl 88 33442 0 32941 12 0 12 12 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 5 0 0 1 0 1 1 0 8 0 uaddrrnd 24 15803 0 15786 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 15803 0 15786 1 0 1 1 0 8 0 vmmpekpl 168 83035 0 83011 2 0 2 2 0 8 0 vmmpepl 168 2053123 0 2049080 377 111 266 277 0 357 90 vmsppl 368 15802 0 15786 2 0 2 2 0 8 0 rwobjpl 56 389278 0 385979 58 10 48 48 0 8 1 pdppl 4096 31613 0 31572 63 22 41 45 0 8 0 pvpl 32 4645130 0 4584017 797 13 784 797 0 265 0 pmappl 232 15802 0 15786 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 335 0 35 9 0 9 9 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff826feff0) 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f end of kernel end trace frame: 0x7f7fffff51e0, count: 9 ddb{0}> trace x86_ipi_db(ffffffff826feff0) 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f end of kernel end trace frame: 0x7f7fffff51e0, 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(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e60b088) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e6090,3,ffff800021cac7e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e555210,40287401,ffff8000256e6090,3,fffffd807f7b7960,ffff800021cac7e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806a260010,40287401,ffff8000256e6090,ffff800021cac7e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021cac7e0,ffff8000256e61a0,ffff8000256e61f0) at sys_ioctl+0x4b0 syscall(ffff8000256e6270) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e6270) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9475af38390, count: 6 ddb{1}> 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(fffffd806e60b088) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e6090,3,ffff800021cac7e0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e555210,40287401,ffff8000256e6090,3,fffffd807f7b7960,ffff800021cac7e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806a260010,40287401,ffff8000256e6090,ffff800021cac7e0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021cac7e0,ffff8000256e61a0,ffff8000256e61f0) at sys_ioctl+0x4b0 syscall(ffff8000256e6270) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e6270) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x9475af38390, count: -9