panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 354433 22309 32767 0x10 0 1 syz-executor.0 * 34661 22309 32767 0x10 0x4000000 0K 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(fffffd806e5ad248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e1e40,3,ffff8000230ac540) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e59c130,40287401,ffff8000256e1e40,3,fffffd807f7b7ae0,ffff8000230ac540) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8062794a18,40287401,ffff8000256e1e40,ffff8000230ac540) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000230ac540,ffff8000256e1f50,ffff8000256e1fa0) at sys_ioctl+0x4b0 syscall(ffff8000256e2020) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e2020) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x614559a35d0, 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(fffffd806e5ad248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e1e40,3,ffff8000230ac540) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e59c130,40287401,ffff8000256e1e40,3,fffffd807f7b7ae0,ffff8000230ac540) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8062794a18,40287401,ffff8000256e1e40,ffff8000230ac540) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000230ac540,ffff8000256e1f50,ffff8000256e1fa0) at sys_ioctl+0x4b0 syscall(ffff8000256e2020) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e2020) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x614559a35d0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256e1880 rbx 0xffff8000256e1890 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0x8012b0f614693be4 r11 0xb48b4547fe28a9d8 r12 0x3000000008 r13 0xffff8000256e1930 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256e1870 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=34661 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=60, nice=20 forw=0xffffffffffffffff, list=0xffff8000230acd20,0xffffffff828cbbd0 process=0xffff8000ffff21e0 user=0xffff8000256dd000, vmspace=0xfffffd807effa5c0 estcpu=10, cpticks=2, pctcpu=0.1 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 22309 354433 97989 32767 7 0x10 syz-executor.0 *22309 34661 97989 32767 7 0x4000010 syz-executor.0 87451 92968 70282 32767 2 0x490 syz-executor.1 87451 249800 70282 32767 3 0x4000090 msgwait syz-executor.1 87451 394863 70282 32767 3 0x4000090 fsleep syz-executor.1 34144 385111 0 0 3 0x14200 bored sosplice 70282 39795 5468 32767 2 0x490 syz-executor.1 97989 342991 4682 32767 2 0x490 syz-executor.0 5468 379782 76472 0 3 0x82 wait syz-executor.1 4682 41729 76472 0 3 0x82 wait syz-executor.0 76472 233020 94806 0 3 0x82 thrsleep syz-fuzzer 76472 273345 94806 0 3 0x4000082 thrsleep syz-fuzzer 76472 187896 94806 0 3 0x4000082 thrsleep syz-fuzzer 76472 61806 94806 0 3 0x4000082 kqread syz-fuzzer 76472 60685 94806 0 3 0x4000082 thrsleep syz-fuzzer 76472 390630 94806 0 3 0x4000082 thrsleep syz-fuzzer 76472 100651 94806 0 3 0x4000082 thrsleep syz-fuzzer 76472 203870 94806 0 3 0x4000082 thrsleep syz-fuzzer 94806 381288 351 0 3 0x10008a sigsusp ksh 351 400376 95247 0 3 0x92 select sshd 18762 364305 1 0 3 0x100083 ttyin getty 95247 98679 1 0 3 0x80 select sshd 82185 210487 40050 73 3 0x100090 kqread syslogd 40050 462311 1 0 3 0x100082 netio syslogd 50307 88146 1 77 3 0x100090 poll dhclient 8709 347272 1 0 3 0x80 poll dhclient 19202 426418 0 0 3 0x14200 bored smr 79217 81740 0 0 3 0x14200 pgzero zerothread 14401 10422 0 0 3 0x14200 aiodoned aiodoned 4218 303565 0 0 3 0x14200 syncer update 43513 283873 0 0 3 0x14200 cleaner cleaner 17701 76136 0 0 3 0x14200 reaper reaper 10999 9573 0 0 3 0x14200 pgdaemon pagedaemon 44761 381809 0 0 3 0x14200 bored crynlk 55264 381401 0 0 3 0x14200 bored crypto 99800 422262 0 0 3 0x14200 bored viomb 90806 87145 0 0 3 0x40014200 acpi0 acpi0 23390 493449 0 0 3 0x40014200 idle1 46033 304150 0 0 3 0x14200 bored softnet 61758 298504 0 0 3 0x14200 bored systqmp 84713 333993 0 0 3 0x14200 bored systq 49889 227675 0 0 2 0x40014200 softclock 59519 266666 0 0 3 0x40014200 idle0 1 41427 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 22309 (syz-executor.0) thread 0xffff8000230ac540 (34661) 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 189 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 15 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 5K 78643K 9 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 40 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 151 0 proc 48 50K 83K 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 10 0 in_multi 33 2K 2K 78643K 35 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 322 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 144 24K 25K 78643K 1053 0 UVM aobj 3 2K 4K 78643K 11 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 5 0 NDP 5 0K 0K 78643K 9 0 temp 87 3978K 4042K 78643K 2052 0 kqueue 3 4K 8K 78643K 5 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 19 0 17 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 38 0 28 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 602 0 602 2 2 0 1 0 8 0 tcpcb 736 35 0 15 3 0 3 3 0 8 0 inpcb 304 75 0 67 1 0 1 1 0 8 0 ip6q 72 1 0 1 1 0 1 1 0 8 1 ip6af 40 2 0 2 1 0 1 1 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 17 0 11 1 0 1 1 0 8 0 semupl 112 4 0 4 1 0 1 1 0 8 1 semapl 112 33 0 23 1 0 1 1 0 8 0 shmpl 112 8 0 8 1 0 1 1 0 8 1 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1541 0 145 88 0 88 88 0 8 0 ffsino 272 1541 0 145 94 0 94 94 0 8 0 nchpl 144 1921 0 323 60 0 60 60 0 8 0 uvmvnodes 72 1584 0 0 29 0 29 29 0 8 0 vnodes 224 1584 0 0 94 0 94 94 0 8 0 namei 1024 4529 0 4529 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5515 0 5515 9 8 1 8 0 8 1 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 340 0 306 4 0 4 4 0 8 0 futexpl 56 1454 0 1453 1 0 1 1 0 8 0 knotepl 112 66 0 46 1 0 1 1 0 8 0 kqueuepl 168 143 0 139 1 0 1 1 0 8 0 pipepl 336 71 0 60 2 0 2 2 0 8 1 fdescpl 496 323 0 306 3 0 3 3 0 8 0 filepl 152 1341 0 1236 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 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 69 0 60 1 0 1 1 0 8 0 zombiepl 144 306 0 306 2 1 1 1 0 8 1 processpl 1080 340 0 306 5 2 3 3 0 8 0 procpl 672 520 0 476 4 0 4 4 0 8 0 sosppl 168 5 0 5 1 0 1 1 0 8 1 sockpl 432 132 0 112 3 0 3 3 0 8 0 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 239 0 0 29 0 29 29 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 418 0 0 26 0 26 26 0 8 0 bufpl 280 3375 0 173 229 0 229 229 0 8 0 anonpl 24 51955 0 27228 152 2 150 150 0 186 1 amapchunkpl 152 1878 0 1306 26 2 24 25 0 158 1 amappl16 200 1314 0 331 52 0 52 52 0 8 0 amappl15 192 62 0 59 1 0 1 1 0 8 0 amappl14 184 84 0 79 1 0 1 1 0 8 0 amappl13 176 24 0 22 1 0 1 1 0 8 0 amappl12 168 6 0 6 1 1 0 1 0 8 0 amappl11 160 50 0 38 1 0 1 1 0 8 0 amappl10 152 16 0 9 1 0 1 1 0 8 0 amappl9 144 281 0 279 1 0 1 1 0 8 0 amappl8 136 118 0 87 2 0 2 2 0 8 0 amappl7 128 220 0 212 1 0 1 1 0 8 0 amappl6 120 62 0 52 1 0 1 1 0 8 0 amappl5 112 411 0 396 1 0 1 1 0 8 0 amappl4 104 304 0 276 1 0 1 1 0 8 0 amappl3 96 120 0 111 1 0 1 1 0 8 0 amappl2 88 1861 0 1784 3 1 2 3 0 8 0 amappl1 80 17597 0 17086 27 15 12 20 0 8 1 amappl 88 796 0 694 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 10 0 8 1 0 1 1 0 8 0 uaddrrnd 24 323 0 306 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 323 0 306 1 0 1 1 0 8 0 vmmpekpl 168 6293 0 6265 2 0 2 2 0 8 0 vmmpepl 168 49155 0 46723 145 14 131 132 0 357 25 vmsppl 368 322 0 306 2 0 2 2 0 8 0 rwobjpl 56 12667 0 10963 34 8 26 26 0 8 1 pdppl 4096 653 0 612 63 18 45 45 0 8 4 pvpl 32 175386 0 147199 228 0 228 228 0 265 0 pmappl 232 322 0 306 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 330 0 21 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(fffffd806e5ad248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e1e40,3,ffff8000230ac540) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e59c130,40287401,ffff8000256e1e40,3,fffffd807f7b7ae0,ffff8000230ac540) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8062794a18,40287401,ffff8000256e1e40,ffff8000230ac540) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000230ac540,ffff8000256e1f50,ffff8000256e1fa0) at sys_ioctl+0x4b0 syscall(ffff8000256e2020) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e2020) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x614559a35d0, 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+0x120 __mp_lock_spin sys/kern/kern_lock.c:117 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x120 sys/kern/kern_lock.c:147 upageflttrap(ffff8000256dc4b0,614426cd5f0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000256dc4b0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffe27e0, 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+0x120 __mp_lock_spin sys/kern/kern_lock.c:117 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x120 sys/kern/kern_lock.c:147 upageflttrap(ffff8000256dc4b0,614426cd5f0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000256dc4b0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffe27e0, count: -7