panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 57892 66490 32767 0x10 0x4000000 0K syz-executor.1 96909 81718 32767 0x10 0x480 1 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(fffffd806e5a5be8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e3980,3,ffff8000220ae7e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6f9130,40287401,ffff8000256e3980,3,fffffd807f7b7780,ffff8000220ae7e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8063e6c5f0,40287401,ffff8000256e3980,ffff8000220ae7e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000220ae7e8,ffff8000256e3a90,ffff8000256e3ae0) at sys_ioctl+0x4b0 syscall(ffff8000256e3b60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e3b60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x86ce49b8180, 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(fffffd806e5a5be8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e3980,3,ffff8000220ae7e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6f9130,40287401,ffff8000256e3980,3,fffffd807f7b7780,ffff8000220ae7e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8063e6c5f0,40287401,ffff8000256e3980,ffff8000220ae7e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000220ae7e8,ffff8000256e3a90,ffff8000256e3ae0) at sys_ioctl+0x4b0 syscall(ffff8000256e3b60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e3b60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x86ce49b8180, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256e33c0 rbx 0xffff8000256e33d0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xeb19bbe5d09ffe7f r11 0x94a00b5a75bfa820 r12 0x3000000008 r13 0xffff8000256e3470 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256e33b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=57892 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=58, nice=20 forw=0xffffffffffffffff, list=0xffff8000220aefc8,0xffffffff828cbbd0 process=0xffff8000234caa50 user=0xffff8000256de000, vmspace=0xfffffd807effa8a0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 66490 170485 68920 32767 2 0x10 syz-executor.1 *66490 57892 68920 32767 7 0x4000010 syz-executor.1 68920 501647 45076 32767 2 0x490 syz-executor.1 81718 96909 81148 32767 7 0x490 syz-executor.0 45076 212140 16670 0 3 0x82 wait syz-executor.1 81148 296988 16670 0 3 0x82 wait syz-executor.0 16670 493456 35914 0 3 0x82 thrsleep syz-fuzzer 16670 21309 35914 0 2 0x4000482 syz-fuzzer 16670 8839 35914 0 3 0x4000082 thrsleep syz-fuzzer 16670 192960 35914 0 3 0x4000082 kqread syz-fuzzer 16670 439627 35914 0 3 0x4000082 thrsleep syz-fuzzer 16670 58224 35914 0 3 0x4000082 thrsleep syz-fuzzer 16670 116837 35914 0 3 0x4000082 thrsleep syz-fuzzer 16670 465492 35914 0 3 0x4000082 thrsleep syz-fuzzer 35914 144803 6734 0 3 0x10008a sigsusp ksh 6734 311349 47416 0 3 0x92 select sshd 35398 277557 1 0 3 0x100083 ttyin getty 47416 484141 1 0 3 0x80 select sshd 1283 6983 52451 73 3 0x100090 kqread syslogd 52451 514846 1 0 3 0x100082 netio syslogd 8325 73176 1 77 3 0x100090 poll dhclient 96599 110584 1 0 3 0x80 poll dhclient 8042 351266 0 0 3 0x14200 bored smr 33727 223581 0 0 3 0x14200 pgzero zerothread 75195 92447 0 0 3 0x14200 aiodoned aiodoned 95219 423481 0 0 3 0x14200 syncer update 15656 420212 0 0 3 0x14200 cleaner cleaner 31345 460338 0 0 3 0x14200 reaper reaper 74543 100351 0 0 3 0x14200 pgdaemon pagedaemon 44181 181368 0 0 3 0x14200 bored crynlk 21853 152633 0 0 3 0x14200 bored crypto 65956 260883 0 0 3 0x14200 bored viomb 56425 55005 0 0 3 0x40014200 acpi0 acpi0 11846 465656 0 0 3 0x40014200 idle1 79654 249429 0 0 3 0x14200 bored softnet 84532 523877 0 0 3 0x14200 bored systqmp 30057 280763 0 0 3 0x14200 bored systq 71725 150309 0 0 3 0x40014200 bored softclock 84065 89796 0 0 3 0x40014200 idle0 1 141692 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 66490 (syz-executor.1) thread 0xffff8000220ae7e8 (57892) 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 iov 0 0K 12K 78643K 2 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 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 16 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 76 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 2 0 in_multi 33 2K 2K 78643K 36 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 43 201K 201K 78643K 43 0 exec 0 0K 2K 78643K 317 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 175 31K 32K 78643K 864 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 9 0K 0K 78643K 9 0 temp 70 3973K 4036K 78643K 1882 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 32 0 24 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 316 0 316 1 0 1 1 0 8 1 tcpcb 736 24 0 6 2 0 2 2 0 8 0 inpcb 304 46 0 39 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 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 187 0 0 12 0 12 12 0 8 0 art_table 32 188 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 0 1 0 1 1 0 8 0 semupl 112 5 0 5 1 0 1 1 0 8 1 semapl 112 10 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1455 0 59 88 0 88 88 0 8 0 ffsino 272 1455 0 59 94 0 94 94 0 8 0 nchpl 144 1714 0 116 60 0 60 60 0 8 0 uvmvnodes 72 1498 0 0 28 0 28 28 0 8 0 vnodes 224 1498 0 0 89 0 89 89 0 8 0 namei 1024 4169 0 4169 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 4811 0 4811 2 1 1 2 0 8 1 plimitpl 152 17 0 7 1 0 1 1 0 8 0 sigapl 424 264 0 232 4 0 4 4 0 8 0 futexpl 56 564 0 564 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 80 0 78 1 0 1 1 0 8 0 pipepl 336 69 0 58 1 0 1 1 0 8 0 fdescpl 496 248 0 232 3 0 3 3 0 8 0 filepl 152 1130 0 1026 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 72 0 63 1 0 1 1 0 8 0 zombiepl 144 232 0 231 2 1 1 1 0 8 0 processpl 1080 264 0 231 5 2 3 3 0 8 0 procpl 672 327 0 286 5 1 4 4 0 8 0 sockpl 432 97 0 80 4 1 3 3 0 8 1 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 187 0 0 23 0 23 23 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 213 0 0 13 0 13 13 0 8 0 bufpl 280 3294 0 173 223 0 223 223 0 8 0 anonpl 24 46884 0 22685 149 2 147 147 0 186 0 amapchunkpl 152 1540 0 961 25 0 25 25 0 158 1 amappl16 200 1121 0 174 50 0 50 50 0 8 0 amappl15 192 3 0 1 1 0 1 1 0 8 0 amappl14 184 45 0 39 1 0 1 1 0 8 0 amappl13 176 52 0 48 1 0 1 1 0 8 0 amappl12 168 11 0 9 1 0 1 1 0 8 0 amappl11 160 48 0 36 1 0 1 1 0 8 0 amappl10 152 6 0 2 1 0 1 1 0 8 0 amappl9 144 278 0 278 1 1 0 1 0 8 0 amappl8 136 159 0 109 2 0 2 2 0 8 0 amappl7 128 218 0 210 1 0 1 1 0 8 0 amappl6 120 59 0 49 1 0 1 1 0 8 0 amappl5 112 365 0 351 1 0 1 1 0 8 0 amappl4 104 241 0 217 1 0 1 1 0 8 0 amappl3 96 155 0 140 1 0 1 1 0 8 0 amappl2 88 1233 0 1161 3 1 2 3 0 8 0 amappl1 80 15159 0 14688 25 9 16 20 0 8 5 amappl 88 615 0 501 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 248 0 232 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 248 0 232 1 0 1 1 0 8 0 vmmpekpl 168 5948 0 5921 2 0 2 2 0 8 0 vmmpepl 168 39601 0 37297 136 3 133 133 0 357 27 vmsppl 368 247 0 232 2 0 2 2 0 8 0 rwobjpl 56 10615 0 8951 30 4 26 26 0 8 2 pdppl 4096 503 0 464 58 13 45 45 0 8 6 pvpl 32 148120 0 120871 224 0 224 224 0 265 0 pmappl 232 247 0 232 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 303 0 16 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(fffffd806e5a5be8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e3980,3,ffff8000220ae7e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6f9130,40287401,ffff8000256e3980,3,fffffd807f7b7780,ffff8000220ae7e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8063e6c5f0,40287401,ffff8000256e3980,ffff8000220ae7e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000220ae7e8,ffff8000256e3a90,ffff8000256e3ae0) at sys_ioctl+0x4b0 syscall(ffff8000256e3b60) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e3b60) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x86ce49b8180, 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 __mp_acquire_count(ffffffff828cdb90,1) at __mp_acquire_count+0x4c sys/kern/kern_lock.c:227 mi_switch() at mi_switch+0x390 sys/kern/sched_bsd.c:433 sleep_finish(ffff8000234c0b08,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff8000234c0b08,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff8000234c0b08,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(ffffffff8285873c,120,ffffffff823a4637,2) at tsleep+0x1f2 sys/kern/kern_synch.c:163 sys_nanosleep(ffff8000220af7a8,ffff8000234c0c30,ffff8000234c0c80) at sys_nanosleep+0x1f5 sys/kern/kern_time.c:297 syscall(ffff8000234c0d00) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234c0d00) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7c60, count: 3 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 __mp_acquire_count(ffffffff828cdb90,1) at __mp_acquire_count+0x4c sys/kern/kern_lock.c:227 mi_switch() at mi_switch+0x390 sys/kern/sched_bsd.c:433 sleep_finish(ffff8000234c0b08,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff8000234c0b08,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff8000234c0b08,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(ffffffff8285873c,120,ffffffff823a4637,2) at tsleep+0x1f2 sys/kern/kern_synch.c:163 sys_nanosleep(ffff8000220af7a8,ffff8000234c0c30,ffff8000234c0c80) at sys_nanosleep+0x1f5 sys/kern/kern_time.c:297 syscall(ffff8000234c0d00) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234c0d00) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7c60, count: -12