panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 358038 89181 0 0 0 1 syz-executor.1 *487789 89181 0 0 0x4000000 0K syz-executor.1 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(fffffd806ed325d0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222b17f0,3,ffff8000212827e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2e8bb8,40287401,ffff8000222b17f0,3,fffffd807f7b7960,ffff8000212827e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80682ad5f0,40287401,ffff8000222b17f0,ffff8000212827e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212827e8,ffff8000222b1900,ffff8000222b1950) at sys_ioctl+0x4b0 syscall(ffff8000222b19d0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222b19d0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf3660c19870, 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(fffffd806ed325d0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222b17f0,3,ffff8000212827e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2e8bb8,40287401,ffff8000222b17f0,3,fffffd807f7b7960,ffff8000212827e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80682ad5f0,40287401,ffff8000222b17f0,ffff8000212827e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212827e8,ffff8000222b1900,ffff8000222b1950) at sys_ioctl+0x4b0 syscall(ffff8000222b19d0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222b19d0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf3660c19870, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000222b1230 rbx 0xffff8000222b1240 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x6353642462b5226e r11 0xd0571e049571dd77 r12 0x3000000008 r13 0xffff8000222b12e0 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222b1220 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=487789 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021283508,0xffffffff828c76b0 process=0xffff800021234010 user=0xffff8000222ac000, vmspace=0xfffffd807eff98a0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 89181 358038 21500 0 7 0 syz-executor.1 *89181 487789 21500 0 7 0x4000000 syz-executor.1 21500 578 61517 0 2 0x482 syz-executor.1 78476 61478 61517 0 2 0x482 syz-executor.0 61517 412571 8427 0 3 0x82 thrsleep syz-fuzzer 61517 132335 8427 0 3 0x4000082 thrsleep syz-fuzzer 61517 509031 8427 0 3 0x4000082 thrsleep syz-fuzzer 61517 308462 8427 0 3 0x4000082 thrsleep syz-fuzzer 61517 437385 8427 0 3 0x4000082 thrsleep syz-fuzzer 61517 122096 8427 0 3 0x4000082 thrsleep syz-fuzzer 61517 196864 8427 0 3 0x4000082 thrsleep syz-fuzzer 61517 314492 8427 0 3 0x4000082 kqread syz-fuzzer 8427 298810 62610 0 3 0x10008a sigsusp ksh 62610 38714 6279 0 3 0x92 select sshd 35050 244325 1 0 3 0x100083 ttyin getty 6279 70833 1 0 3 0x80 select sshd 87710 171797 95228 74 3 0x100092 bpf pflogd 95228 385623 1 0 3 0x80 netio pflogd 61027 100808 59131 73 2 0x100090 syslogd 59131 472973 1 0 3 0x100082 netio syslogd 33004 117316 1 77 3 0x100090 poll dhclient 34778 41283 1 0 3 0x80 poll dhclient 90008 2193 0 0 3 0x14200 bored smr 39945 194400 0 0 3 0x14200 pgzero zerothread 13280 403329 0 0 3 0x14200 aiodoned aiodoned 45322 144631 0 0 3 0x14200 syncer update 74424 190665 0 0 3 0x14200 cleaner cleaner 27829 482761 0 0 3 0x14200 reaper reaper 94414 454055 0 0 3 0x14200 pgdaemon pagedaemon 32447 379529 0 0 3 0x14200 bored crynlk 82424 30660 0 0 3 0x14200 bored crypto 65029 307484 0 0 3 0x14200 bored viomb 21303 387852 0 0 3 0x40014200 acpi0 acpi0 26035 39512 0 0 3 0x40014200 idle1 4786 158641 0 0 3 0x14200 bored softnet 37854 340647 0 0 3 0x14200 bored systqmp 87454 434114 0 0 3 0x14200 bored systq 98630 504235 0 0 3 0x40014200 bored softclock 84005 69751 0 0 3 0x40014200 idle0 1 179368 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 89181 (syz-executor.1) thread 0xffff8000212827e8 (487789) 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 6545K 78643K 10584 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 199 0 ifaddr 44 10K 10K 78643K 45 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1469 0 mount 1 1K 1K 78643K 1 0 vnodes 1219 77K 77K 78643K 1224 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 2 0K 0K 78643K 2 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 36 0 proc 59 63K 95K 78643K 447 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 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 358 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 127 25K 26K 78643K 800 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 10 0K 0K 78643K 10 0 temp 66 3971K 4033K 78643K 2044 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 19 0 17 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 25 0 15 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 665 0 665 1 0 1 1 0 8 1 tcpcb 736 10 0 6 1 0 1 1 0 8 0 inpcb 304 39 0 32 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 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 pfstitem 24 11 0 0 1 0 1 1 0 8 0 pfstkey 112 11 0 0 1 0 1 1 0 8 0 pfstate 320 11 0 0 1 0 1 1 0 8 0 pfrule 1360 21 0 16 2 1 1 2 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 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1426 0 22 88 0 88 88 0 8 0 ffsino 272 1426 0 22 95 1 94 94 0 8 0 nchpl 144 1645 0 38 60 0 60 60 0 8 0 uvmvnodes 72 1472 0 0 27 0 27 27 0 8 0 vnodes 224 1472 0 0 87 0 87 87 0 8 0 namei 1024 4275 0 4275 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 4870 0 4870 10 2 8 8 0 8 8 plimitpl 152 17 0 8 1 0 1 1 0 8 0 sigapl 424 252 0 220 4 0 4 4 0 8 0 futexpl 56 13 0 13 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 2 0 0 1 0 1 1 0 8 0 pipepl 336 76 0 65 1 0 1 1 0 8 0 fdescpl 496 236 0 220 3 0 3 3 0 8 0 filepl 152 1105 0 999 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 62 0 53 1 0 1 1 0 8 0 zombiepl 144 220 0 219 2 1 1 1 0 8 0 processpl 1080 252 0 219 3 0 3 3 0 8 0 procpl 672 262 0 221 5 1 4 4 0 8 0 sockpl 432 83 0 64 3 0 3 3 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 220 0 0 27 0 27 27 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 255 0 0 16 0 16 16 0 8 0 bufpl 280 3333 0 181 226 0 226 226 0 8 0 anonpl 24 38118 0 22700 96 1 95 95 0 186 1 amapchunkpl 152 1303 0 951 16 0 16 16 0 158 1 amappl16 200 736 0 114 33 0 33 33 0 8 0 amappl15 192 9 0 7 1 0 1 1 0 8 0 amappl14 184 27 0 22 1 0 1 1 0 8 0 amappl13 176 27 0 25 1 0 1 1 0 8 0 amappl12 168 15 0 11 2 1 1 1 0 8 0 amappl11 160 58 0 41 1 0 1 1 0 8 0 amappl10 152 21 0 15 1 0 1 1 0 8 0 amappl9 144 273 0 273 1 1 0 1 0 8 0 amappl8 136 143 0 104 2 0 2 2 0 8 0 amappl7 128 244 0 237 1 0 1 1 0 8 0 amappl6 120 71 0 59 1 0 1 1 0 8 0 amappl5 112 402 0 383 1 0 1 1 0 8 0 amappl4 104 282 0 259 1 0 1 1 0 8 0 amappl3 96 124 0 116 1 0 1 1 0 8 0 amappl2 88 988 0 921 3 1 2 3 0 8 0 amappl1 80 15349 0 14882 26 11 15 21 0 8 3 amappl 88 540 0 466 2 0 2 2 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 236 0 220 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 236 0 220 1 0 1 1 0 8 0 vmmpekpl 168 6086 0 6060 2 0 2 2 0 8 0 vmmpepl 168 36738 0 34910 114 8 106 106 0 357 23 vmsppl 368 235 0 220 2 0 2 2 0 8 0 rwobjpl 56 9872 0 8547 28 7 21 21 0 8 2 pdppl 4096 479 0 440 62 17 45 45 0 8 6 pvpl 32 134712 0 115978 154 0 154 154 0 265 2 pmappl 232 235 0 220 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 316 0 22 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(fffffd806ed325d0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222b17f0,3,ffff8000212827e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2e8bb8,40287401,ffff8000222b17f0,3,fffffd807f7b7960,ffff8000212827e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80682ad5f0,40287401,ffff8000222b17f0,ffff8000212827e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212827e8,ffff8000222b1900,ffff8000222b1950) at sys_ioctl+0x4b0 syscall(ffff8000222b19d0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222b19d0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf3660c19870, 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 sys/kern/kern_lock.c:147 upageflttrap(ffff8000234c1bf0,f3612c4b7c0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000234c1bf0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffe0d20, 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(ffffffff828d3f20) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 sys/kern/kern_lock.c:147 upageflttrap(ffff8000234c1bf0,f3612c4b7c0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000234c1bf0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffe0d20, count: -7