panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 486885 41491 32767 0x10 0 0 syz-executor.0 *208726 41491 32767 0x10 0x4000000 1K syz-executor.0 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(fffffd806e6686a8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4610,3,ffff8000ffff57a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ee924b0,40287401,ffff8000256d4610,3,fffffd807f7b78a0,ffff8000ffff57a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066577ac8,40287401,ffff8000256d4610,ffff8000ffff57a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff57a0,ffff8000256d4720,ffff8000256d4770) at sys_ioctl+0x4b0 syscall(ffff8000256d47f0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d47f0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x47f6f6ffd30, 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(fffffd806e6686a8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4610,3,ffff8000ffff57a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ee924b0,40287401,ffff8000256d4610,3,fffffd807f7b78a0,ffff8000ffff57a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066577ac8,40287401,ffff8000256d4610,ffff8000ffff57a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff57a0,ffff8000256d4720,ffff8000256d4770) at sys_ioctl+0x4b0 syscall(ffff8000256d47f0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d47f0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x47f6f6ffd30, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256d4050 rbx 0xffff8000256d4060 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xeae42d521cf2c36 r11 0x25c21c53aae56e7a r12 0x3000000008 r13 0xffff8000256d4100 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256d4040 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=208726 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=58, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff5500,0xffffffff828cbbd0 process=0xffff8000ffff21e0 user=0xffff8000256cf000, 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 41491 486885 84679 32767 7 0x10 syz-executor.0 *41491 208726 84679 32767 7 0x4000010 syz-executor.0 23707 440201 23261 32767 2 0x10 syz-executor.1 23707 122998 23261 32767 3 0x4000090 fsleep syz-executor.1 14778 229154 0 0 3 0x14200 bored sosplice 23261 356445 53311 32767 3 0x90 nanoslp syz-executor.1 84679 110470 51553 32767 3 0x90 nanoslp syz-executor.0 53311 136931 53420 0 3 0x82 wait syz-executor.1 51553 91189 53420 0 3 0x82 wait syz-executor.0 53420 115328 892 0 3 0x82 thrsleep syz-fuzzer 53420 505328 892 0 3 0x4000082 thrsleep syz-fuzzer 53420 95508 892 0 3 0x4000082 thrsleep syz-fuzzer 53420 265299 892 0 3 0x4000082 kqread syz-fuzzer 53420 328296 892 0 3 0x4000082 thrsleep syz-fuzzer 53420 267379 892 0 3 0x4000082 thrsleep syz-fuzzer 53420 198129 892 0 3 0x4000082 thrsleep syz-fuzzer 53420 510836 892 0 3 0x4000082 thrsleep syz-fuzzer 892 194217 66581 0 3 0x10008a sigsusp ksh 66581 465235 79279 0 3 0x92 select sshd 34989 217415 1 0 3 0x100083 ttyin getty 79279 427808 1 0 3 0x80 select sshd 49875 19357 37308 73 3 0x100090 kqread syslogd 37308 151670 1 0 3 0x100082 netio syslogd 35517 16301 1 77 3 0x100090 poll dhclient 15848 83330 1 0 3 0x80 poll dhclient 54 367534 0 0 3 0x14200 bored smr 40770 252696 0 0 2 0x14200 zerothread 39996 245436 0 0 3 0x14200 aiodoned aiodoned 19012 23465 0 0 3 0x14200 syncer update 70736 64157 0 0 3 0x14200 cleaner cleaner 41027 385927 0 0 3 0x14200 reaper reaper 394 488767 0 0 3 0x14200 pgdaemon pagedaemon 4648 220824 0 0 3 0x14200 bored crynlk 62869 99481 0 0 3 0x14200 bored crypto 84061 76944 0 0 3 0x14200 bored viomb 97447 152082 0 0 3 0x40014200 acpi0 acpi0 37956 33539 0 0 3 0x40014200 idle1 67488 438213 0 0 3 0x14200 bored softnet 74228 133187 0 0 3 0x14200 bored systqmp 71521 23444 0 0 3 0x14200 bored systq 65262 306389 0 0 3 0x40014200 bored softclock 91239 505799 0 0 3 0x40014200 idle0 1 90472 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 41491 (syz-executor.0) thread 0xffff8000ffff57a0 (208726) 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 10569 0 pcb 13 8K 8K 78643K 13 0 rtable 107 3K 3K 78643K 191 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 20 0 iov 0 0K 0K 78643K 5 0 mount 1 1K 1K 78643K 1 0 vnodes 1216 76K 76K 78643K 1222 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 11 1K 1K 78643K 21 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 196 0 proc 48 50K 83K 78643K 379 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 13 0 in_multi 33 2K 2K 78643K 35 0 ether_multi 1 0K 0K 78643K 2 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 328 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 165 27K 27K 78643K 1226 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 5 0K 0K 78643K 9 0 temp 84 3977K 4041K 78643K 2150 0 kqueue 3 4K 10K 78643K 6 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 19 0 17 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 81 0 73 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 932 0 932 3 3 0 3 0 8 0 tcpcb 736 39 0 33 2 1 1 2 0 8 0 ipq 40 1 0 0 1 0 1 1 0 8 0 ipqe 40 2 0 1 1 0 1 1 0 8 0 inpcb 304 98 0 91 1 0 1 1 0 8 0 nd6 48 7 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 45 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 16 0 7 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 13 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1580 0 184 88 0 88 88 0 8 0 ffsino 272 1580 0 184 94 0 94 94 0 8 0 nchpl 144 2022 0 422 60 0 60 60 0 8 0 uvmvnodes 72 1623 0 0 30 0 30 30 0 8 0 vnodes 224 1623 0 0 96 0 96 96 0 8 0 namei 1024 4831 0 4831 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5753 0 5753 9 8 1 8 0 8 1 plimitpl 152 20 0 10 1 0 1 1 0 8 0 sigapl 424 385 0 351 4 0 4 4 0 8 0 futexpl 56 1915 0 1914 1 0 1 1 0 8 0 knotepl 112 66 0 46 1 0 1 1 0 8 0 kqueuepl 168 173 0 170 1 0 1 1 0 8 0 pipepl 336 79 0 68 2 0 2 2 0 8 1 fdescpl 496 368 0 351 3 0 3 3 0 8 0 filepl 152 1598 0 1494 6 1 5 5 0 8 1 lockfpl 104 29 0 28 1 0 1 1 0 8 0 lockfspl 48 9 0 8 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 120 0 111 1 0 1 1 0 8 0 zombiepl 144 351 0 351 2 1 1 1 0 8 1 processpl 1080 385 0 351 5 2 3 3 0 8 0 procpl 672 635 0 592 4 0 4 4 0 8 0 sosppl 168 7 0 7 2 1 1 1 0 8 1 sockpl 432 198 0 181 4 1 3 3 0 8 1 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 8 0 0 1 0 1 1 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 427 0 0 53 0 53 53 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 468 0 0 29 0 29 29 0 8 0 bufpl 280 3417 0 173 232 0 232 232 0 8 0 anonpl 24 56084 0 31079 153 2 151 151 0 186 0 amapchunkpl 152 2156 0 1604 25 3 22 24 0 158 0 amappl16 200 1482 0 458 54 0 54 54 0 8 0 amappl15 192 4 0 2 1 0 1 1 0 8 0 amappl14 184 21 0 18 1 0 1 1 0 8 0 amappl13 176 25 0 23 1 0 1 1 0 8 0 amappl12 168 18 0 13 1 0 1 1 0 8 0 amappl11 160 221 0 206 1 0 1 1 0 8 0 amappl10 152 6 0 2 1 0 1 1 0 8 0 amappl9 144 291 0 290 2 1 1 1 0 8 0 amappl8 136 156 0 108 2 0 2 2 0 8 0 amappl7 128 215 0 207 1 0 1 1 0 8 0 amappl6 120 61 0 49 1 0 1 1 0 8 0 amappl5 112 497 0 477 1 0 1 1 0 8 0 amappl4 104 418 0 386 1 0 1 1 0 8 0 amappl3 96 118 0 110 1 0 1 1 0 8 0 amappl2 88 2122 0 2045 3 1 2 3 0 8 0 amappl1 80 19306 0 18798 26 14 12 20 0 8 1 amappl 88 923 0 816 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 368 0 351 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 368 0 351 1 0 1 1 0 8 0 vmmpekpl 168 6464 0 6440 2 0 2 2 0 8 0 vmmpepl 168 55703 0 53193 154 18 136 142 0 357 26 vmsppl 368 367 0 351 2 0 2 2 0 8 0 rwobjpl 56 14082 0 12320 31 5 26 26 0 8 1 pdppl 4096 743 0 702 63 22 41 45 0 8 0 pvpl 32 194262 0 165986 232 3 229 230 0 265 0 pmappl 232 367 0 351 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 357 0 26 10 0 10 10 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 __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 upageflttrap(ffff8000256c8d10,48055c61360) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000256c8d10) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffd62e0, count: 5 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 __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 upageflttrap(ffff8000256c8d10,48055c61360) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000256c8d10) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffd62e0, count: -10 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(fffffd806e6686a8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4610,3,ffff8000ffff57a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ee924b0,40287401,ffff8000256d4610,3,fffffd807f7b78a0,ffff8000ffff57a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066577ac8,40287401,ffff8000256d4610,ffff8000ffff57a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff57a0,ffff8000256d4720,ffff8000256d4770) at sys_ioctl+0x4b0 syscall(ffff8000256d47f0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d47f0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x47f6f6ffd30, 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(fffffd806e6686a8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4610,3,ffff8000ffff57a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806ee924b0,40287401,ffff8000256d4610,3,fffffd807f7b78a0,ffff8000ffff57a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066577ac8,40287401,ffff8000256d4610,ffff8000ffff57a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff57a0,ffff8000256d4720,ffff8000256d4770) at sys_ioctl+0x4b0 syscall(ffff8000256d47f0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d47f0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x47f6f6ffd30, count: -9