panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *189726 55476 32767 0x10 0x4000000 1K syz-executor.0 319041 22336 32767 0x10 0 0 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(fffffd806e55f408) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4b80,3,ffff8000ffff42a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e9fe050,40287401,ffff8000256d4b80,3,fffffd807f7b7900,ffff8000ffff42a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806560ed10,40287401,ffff8000256d4b80,ffff8000ffff42a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff42a0,ffff8000256d4c90,ffff8000256d4ce0) at sys_ioctl+0x4b0 syscall(ffff8000256d4d60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4d60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa24a6765050, 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(fffffd806e55f408) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4b80,3,ffff8000ffff42a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e9fe050,40287401,ffff8000256d4b80,3,fffffd807f7b7900,ffff8000ffff42a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806560ed10,40287401,ffff8000256d4b80,ffff8000ffff42a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff42a0,ffff8000256d4c90,ffff8000256d4ce0) at sys_ioctl+0x4b0 syscall(ffff8000256d4d60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4d60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa24a6765050, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256d45c0 rbx 0xffff8000256d45d0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0x5ed98f14e8232e20 r11 0xc8a8c1753d8dfb40 r12 0x3000000008 r13 0xffff8000256d4670 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256d45b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=189726 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff5500,0xffffffff828cbbd0 process=0xffff8000ffff36f8 user=0xffff8000256cf000, vmspace=0xfffffd807effa000 estcpu=36, cpticks=3, pctcpu=0.0 user=0, sys=3, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 55476 449214 74913 32767 2 0x10 syz-executor.0 *55476 189726 74913 32767 7 0x4000010 syz-executor.0 22336 319041 66257 32767 7 0x10 syz-executor.1 22336 240174 66257 32767 3 0x4000090 fsleep syz-executor.1 61100 131679 0 0 3 0x14200 bored sosplice 66257 327224 25164 32767 3 0x90 nanoslp syz-executor.1 74913 357966 40606 32767 3 0x90 nanoslp syz-executor.0 25164 19611 35517 0 3 0x82 wait syz-executor.1 40606 515818 35517 0 3 0x82 wait syz-executor.0 35517 486871 30711 0 3 0x82 thrsleep syz-fuzzer 35517 380671 30711 0 3 0x4000082 thrsleep syz-fuzzer 35517 9813 30711 0 3 0x4000082 thrsleep syz-fuzzer 35517 493964 30711 0 3 0x4000082 thrsleep syz-fuzzer 35517 504185 30711 0 3 0x4000082 kqread syz-fuzzer 35517 509072 30711 0 3 0x4000082 thrsleep syz-fuzzer 35517 477415 30711 0 3 0x4000082 thrsleep syz-fuzzer 35517 461601 30711 0 3 0x4000082 thrsleep syz-fuzzer 30711 434059 56681 0 3 0x10008a sigsusp ksh 56681 211372 43012 0 3 0x92 select sshd 87370 256961 1 0 3 0x100083 ttyin getty 43012 506559 1 0 3 0x80 select sshd 20399 291413 93717 73 3 0x100090 kqread syslogd 93717 124959 1 0 3 0x100082 netio syslogd 60955 31214 1 77 3 0x100090 poll dhclient 37049 373039 1 0 3 0x80 poll dhclient 62872 341436 0 0 3 0x14200 bored smr 78473 222395 0 0 2 0x14200 zerothread 57824 116497 0 0 3 0x14200 aiodoned aiodoned 60853 471964 0 0 3 0x14200 syncer update 93878 147538 0 0 3 0x14200 cleaner cleaner 53900 515414 0 0 3 0x14200 reaper reaper 21365 187136 0 0 3 0x14200 pgdaemon pagedaemon 67041 295859 0 0 3 0x14200 bored crynlk 86947 465921 0 0 3 0x14200 bored crypto 33409 429010 0 0 3 0x14200 bored viomb 34898 107597 0 0 3 0x40014200 acpi0 acpi0 82984 379128 0 0 3 0x40014200 idle1 51051 157150 0 0 3 0x14200 bored softnet 75662 174679 0 0 3 0x14200 bored systqmp 61498 95928 0 0 3 0x14200 bored systq 11705 225687 0 0 3 0x40014200 bored softclock 75027 191537 0 0 3 0x40014200 idle0 1 366446 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 55476 (syz-executor.0) thread 0xffff8000ffff42a0 (189726) 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 105 3K 3K 78643K 201 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 8K 78643K 2 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 12 0K 1K 78643K 179 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 224 0 proc 48 50K 70K 78643K 370 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 2 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 342 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 154 29K 29K 78643K 1253 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 2 0 NDP 5 0K 0K 78643K 9 0 temp 101 3981K 4045K 78643K 2218 0 kqueue 3 4K 6K 78643K 7 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 35 0 33 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 86 0 78 1 0 1 1 0 8 0 syncache 296 6 0 6 2 1 1 1 0 8 1 tcpqe 32 341 0 341 2 2 0 1 0 8 0 tcpcb 736 36 0 30 2 0 2 2 0 8 1 inpcb 304 74 0 65 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 188 0 0 12 0 12 12 0 8 0 art_table 32 189 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 5 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 174 0 164 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1617 0 221 88 0 88 88 0 8 0 ffsino 272 1617 0 221 94 0 94 94 0 8 0 nchpl 144 2092 0 494 60 0 60 60 0 8 0 uvmvnodes 72 1660 0 0 31 0 31 31 0 8 0 vnodes 224 1660 0 0 98 0 98 98 0 8 0 namei 1024 4860 0 4860 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 6002 0 6002 9 8 1 8 0 8 1 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 413 0 379 4 0 4 4 0 8 0 futexpl 56 2467 0 2466 1 0 1 1 0 8 0 knotepl 112 68 0 48 1 0 1 1 0 8 0 kqueuepl 168 226 0 222 1 0 1 1 0 8 0 pipepl 336 74 0 63 2 0 2 2 0 8 1 fdescpl 496 396 0 379 3 0 3 3 0 8 0 filepl 152 1551 0 1446 6 1 5 5 0 8 0 lockfpl 104 21 0 20 1 0 1 1 0 8 0 lockfspl 48 11 0 10 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 63 0 54 1 0 1 1 0 8 0 zombiepl 144 379 0 379 2 1 1 1 0 8 1 processpl 1080 413 0 379 5 2 3 3 0 8 0 procpl 672 701 0 658 4 0 4 4 0 8 0 sosppl 168 2 0 2 1 0 1 1 0 8 1 sockpl 432 195 0 176 3 0 3 3 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 233 0 0 29 0 29 29 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 301 0 0 18 0 18 18 0 8 0 bufpl 280 3470 0 176 236 0 236 236 0 8 0 anonpl 24 59528 0 34631 156 2 154 154 0 186 2 amapchunkpl 152 2235 0 1661 24 0 24 24 0 158 1 amappl16 200 1585 0 586 55 0 55 55 0 8 2 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 23 0 19 1 0 1 1 0 8 0 amappl13 176 35 0 31 1 0 1 1 0 8 0 amappl12 168 7 0 4 1 0 1 1 0 8 0 amappl11 160 47 0 36 1 0 1 1 0 8 0 amappl10 152 203 0 194 1 0 1 1 0 8 0 amappl9 144 92 0 92 1 1 0 1 0 8 0 amappl8 136 123 0 93 2 0 2 2 0 8 0 amappl7 128 221 0 212 1 0 1 1 0 8 0 amappl6 120 259 0 244 1 0 1 1 0 8 0 amappl5 112 912 0 895 1 0 1 1 0 8 0 amappl4 104 248 0 221 1 0 1 1 0 8 0 amappl3 96 129 0 119 1 0 1 1 0 8 0 amappl2 88 2395 0 2321 3 1 2 3 0 8 0 amappl1 80 20157 0 19657 26 14 12 20 0 8 1 amappl 88 986 0 877 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 396 0 379 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 396 0 379 1 0 1 1 0 8 0 vmmpekpl 168 6492 0 6467 2 0 2 2 0 8 0 vmmpepl 168 59629 0 57172 145 12 133 133 0 357 26 vmsppl 368 395 0 379 2 0 2 2 0 8 0 rwobjpl 56 15158 0 13437 31 6 25 25 0 8 0 pdppl 4096 799 0 758 63 18 45 45 0 8 4 pvpl 32 204040 0 175776 237 0 237 237 0 265 8 pmappl 232 395 0 379 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 322 0 21 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc upageflttrap(ffff8000228adf90,ec0673a2000) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000228adf90) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffccf70, 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc upageflttrap(ffff8000228adf90,ec0673a2000) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000228adf90) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffccf70, 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(fffffd806e55f408) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4b80,3,ffff8000ffff42a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e9fe050,40287401,ffff8000256d4b80,3,fffffd807f7b7900,ffff8000ffff42a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806560ed10,40287401,ffff8000256d4b80,ffff8000ffff42a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff42a0,ffff8000256d4c90,ffff8000256d4ce0) at sys_ioctl+0x4b0 syscall(ffff8000256d4d60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4d60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa24a6765050, 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(fffffd806e55f408) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d4b80,3,ffff8000ffff42a0) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e9fe050,40287401,ffff8000256d4b80,3,fffffd807f7b7900,ffff8000ffff42a0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806560ed10,40287401,ffff8000256d4b80,ffff8000ffff42a0) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff42a0,ffff8000256d4c90,ffff8000256d4ce0) at sys_ioctl+0x4b0 syscall(ffff8000256d4d60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d4d60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa24a6765050, count: -9