panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *172185 47409 0 0 0x4000000 0K syz-executor.1 236344 15055 0 0x2 0x480 1 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(fffffd806e30b6b0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000242cf580,3,ffff80002123d268) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e351ad8,40287401,ffff8000242cf580,3,fffffd807f7b78a0,ffff80002123d268) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806885e7b8,40287401,ffff8000242cf580,ffff80002123d268) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123d268,ffff8000242cf690,ffff8000242cf6e0) at sys_ioctl+0x4b0 syscall(ffff8000242cf760) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000242cf760) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x44789a6290, 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(fffffd806e30b6b0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000242cf580,3,ffff80002123d268) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e351ad8,40287401,ffff8000242cf580,3,fffffd807f7b78a0,ffff80002123d268) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806885e7b8,40287401,ffff8000242cf580,ffff80002123d268) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123d268,ffff8000242cf690,ffff8000242cf6e0) at sys_ioctl+0x4b0 syscall(ffff8000242cf760) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000242cf760) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x44789a6290, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000242cefc0 rbx 0xffff8000242cefd0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0xd067543ec4cb4bf5 r11 0x6141cbfb97c95127 r12 0x3000000008 r13 0xffff8000242cf070 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000242cefb0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=172185 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=71, nice=20 forw=0xffffffffffffffff, list=0xffff80002123c548,0xffffffff828c76b0 process=0xffff800021234880 user=0xffff8000242ca000, vmspace=0xfffffd807eff98a0 estcpu=21, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 47409 76443 15055 0 2 0 syz-executor.1 47409 334032 15055 0 3 0x4000080 ttyout syz-executor.1 *47409 172185 15055 0 7 0x4000000 syz-executor.1 8581 112470 0 0 3 0x14200 bored sosplice 15055 236344 89001 0 7 0x482 syz-executor.1 92632 135196 89001 0 3 0x82 piperd syz-executor.0 89001 227579 74149 0 3 0x82 thrsleep syz-fuzzer 89001 398539 74149 0 3 0x4000082 thrsleep syz-fuzzer 89001 520134 74149 0 3 0x4000082 kqread syz-fuzzer 89001 161358 74149 0 3 0x4000082 thrsleep syz-fuzzer 89001 199161 74149 0 3 0x4000082 thrsleep syz-fuzzer 89001 464420 74149 0 3 0x4000082 thrsleep syz-fuzzer 89001 351161 74149 0 3 0x4000082 thrsleep syz-fuzzer 89001 59332 74149 0 3 0x4000082 thrsleep syz-fuzzer 74149 113463 30455 0 3 0x10008a sigsusp ksh 30455 11453 3933 0 3 0x92 select sshd 12096 148817 1 0 3 0x100083 ttyin getty 3933 278905 1 0 3 0x80 select sshd 76111 133194 63310 74 3 0x100092 bpf pflogd 63310 468889 1 0 3 0x80 netio pflogd 38900 380068 57494 73 3 0x100090 kqread syslogd 57494 92697 1 0 3 0x100082 netio syslogd 25730 297562 1 77 3 0x100090 poll dhclient 96404 447893 1 0 3 0x80 poll dhclient 75075 41966 0 0 3 0x14200 bored smr 78827 60631 0 0 3 0x14200 pgzero zerothread 24578 378808 0 0 3 0x14200 aiodoned aiodoned 75798 156511 0 0 3 0x14200 syncer update 17739 293181 0 0 3 0x14200 cleaner cleaner 58870 283145 0 0 3 0x14200 reaper reaper 98717 275744 0 0 3 0x14200 pgdaemon pagedaemon 92736 26185 0 0 3 0x14200 bored crynlk 83191 458519 0 0 3 0x14200 bored crypto 17896 408810 0 0 3 0x14200 bored viomb 29080 252855 0 0 3 0x40014200 acpi0 acpi0 74746 477137 0 0 3 0x40014200 idle1 43824 430193 0 0 3 0x14200 bored softnet 36683 511356 0 0 3 0x14200 bored systqmp 16847 139846 0 0 3 0x14200 bored systq 82194 208815 0 0 3 0x40014200 bored softclock 87427 144837 0 0 3 0x40014200 idle0 1 151702 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 47409 (syz-executor.1) thread 0xffff80002123d268 (172185) 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 9501 6423K 6810K 78643K 11094 0 pcb 13 8K 8K 78643K 25 0 rtable 105 3K 3K 78643K 204 0 ifaddr 53 11K 11K 78643K 55 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1474 0 iov 0 0K 12K 78643K 9 0 mount 1 1K 1K 78643K 1 0 vnodes 1228 77K 77K 78643K 1300 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 7 0K 0K 78643K 8 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 731 0 sigio 0 0K 0K 78643K 5 0 proc 62 63K 95K 78643K 461 0 subproc 32 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 5 0 in_multi 33 2K 2K 78643K 43 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 43 201K 201K 78643K 43 0 exec 0 0K 2K 78643K 360 0 pfkey data 0 0K 1K 78643K 2 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 150 27K 28K 78643K 2512 0 UVM aobj 5 2K 2K 78643K 5 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 8 0K 0K 78643K 12 0 temp 75 3972K 4036K 78643K 3638 0 kqueue 3 4K 10K 78643K 23 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 23 0 21 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 95 0 84 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 702 0 702 1 1 0 1 0 8 0 tcpcb 736 26 0 22 1 0 1 1 0 8 0 inpcb 304 121 0 114 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 4 0 4 1 1 0 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 pffrag 232 2 0 2 1 1 0 1 0 482 0 pffrnode 88 2 0 2 1 1 0 1 0 8 0 pffrent 40 8 0 8 1 1 0 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 17 0 5 1 0 1 1 0 8 0 pfstkey 112 17 0 5 1 0 1 1 0 8 0 pfstate 320 17 0 5 1 0 1 1 0 8 0 pfrule 1360 24 0 19 2 1 1 2 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 2 0 2 1 0 1 1 0 8 1 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 6 0 1 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2254 0 851 88 0 88 88 0 8 0 ffsino 272 2254 0 851 95 1 94 94 0 8 0 nchpl 144 3255 0 1651 60 0 60 60 0 8 0 uvmvnodes 72 2363 0 0 43 0 43 43 0 8 0 vnodes 224 2363 0 0 139 0 139 139 0 8 0 namei 1024 9202 0 9202 3 2 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 9715 0 9715 8 7 1 6 0 8 1 plimitpl 152 18 0 9 1 0 1 1 0 8 0 sigapl 424 948 0 915 4 0 4 4 0 8 0 futexpl 56 5338 0 5338 2 1 1 1 0 8 1 knotepl 112 83 0 63 1 0 1 1 0 8 0 kqueuepl 168 1289 0 1287 1 0 1 1 0 8 0 pipepl 336 95 0 84 2 0 2 2 0 8 1 fdescpl 496 931 0 915 3 0 3 3 0 8 0 filepl 152 4390 0 4283 6 1 5 5 0 8 0 lockfpl 104 222 0 221 1 0 1 1 0 8 0 lockfspl 48 107 0 106 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 123 0 114 1 0 1 1 0 8 0 zombiepl 144 915 0 915 2 1 1 1 0 8 1 processpl 1080 948 0 915 3 0 3 3 0 8 0 procpl 672 1908 0 1866 5 1 4 4 0 8 0 sosppl 168 3 0 3 2 1 1 1 0 8 1 sockpl 432 243 0 223 3 0 3 3 0 8 0 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 321 0 0 40 0 40 40 0 8 0 mtagpl 96 14 0 0 1 0 1 1 0 8 0 mbufpl 256 327 0 0 20 0 20 20 0 8 0 bufpl 280 4104 0 178 281 0 281 281 0 8 0 anonpl 24 83553 0 65799 109 1 108 108 0 186 0 amapchunkpl 152 4016 0 3622 18 2 16 17 0 158 0 amappl16 200 2598 0 1882 38 0 38 38 0 8 0 amappl15 192 3 0 0 1 0 1 1 0 8 0 amappl14 184 27 0 21 1 0 1 1 0 8 0 amappl13 176 373 0 369 1 0 1 1 0 8 0 amappl12 168 11 0 9 1 0 1 1 0 8 0 amappl11 160 59 0 42 1 0 1 1 0 8 0 amappl10 152 18 0 12 1 0 1 1 0 8 0 amappl9 144 642 0 640 2 1 1 1 0 8 0 amappl8 136 160 0 115 2 0 2 2 0 8 0 amappl7 128 597 0 589 1 0 1 1 0 8 0 amappl6 120 67 0 55 1 0 1 1 0 8 0 amappl5 112 1079 0 1061 1 0 1 1 0 8 0 amappl4 104 280 0 254 1 0 1 1 0 8 0 amappl3 96 485 0 476 1 0 1 1 0 8 0 amappl2 88 6541 0 6472 3 1 2 3 0 8 0 amappl1 80 36133 0 35656 28 17 11 21 0 8 0 amappl 88 2205 0 2112 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 4 0 0 1 0 1 1 0 8 0 uaddrrnd 24 931 0 915 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 931 0 915 1 0 1 1 0 8 0 vmmpekpl 168 9215 0 9191 2 0 2 2 0 8 0 vmmpepl 168 124058 0 122088 122 30 92 105 0 357 1 vmsppl 368 930 0 915 2 0 2 2 0 8 0 rwobjpl 56 28981 0 27526 31 9 22 22 0 8 1 pdppl 4096 1869 0 1830 65 24 41 45 0 8 2 pvpl 32 404661 0 383273 178 4 174 174 0 265 1 pmappl 232 930 0 915 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 341 0 30 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(fffffd806e30b6b0) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000242cf580,3,ffff80002123d268) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e351ad8,40287401,ffff8000242cf580,3,fffffd807f7b78a0,ffff80002123d268) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd806885e7b8,40287401,ffff8000242cf580,ffff80002123d268) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123d268,ffff8000242cf690,ffff8000242cf6e0) at sys_ioctl+0x4b0 syscall(ffff8000242cf760) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000242cf760) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x44789a6290, 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0xf kd_curproc sys/dev/kcov.c:559 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0xf sys/dev/kcov.c:143 __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 sys/kern/kern_lock.c:147 __mp_acquire_count(ffffffff828d3f20,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(ffff800022cc98e8,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff800022cc98e8,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff800022cc98e8,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(ffffffff82895cbc,120,ffffffff823a2c4c,2) at tsleep+0x1f2 sys/kern/kern_synch.c:163 sys_nanosleep(ffff80002123d7a8,ffff800022cc9a10,ffff800022cc9a60) at sys_nanosleep+0x1f5 sys/kern/kern_time.c:297 syscall(ffff800022cc9ae0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800022cc9ae0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc42d0, count: 2 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0xf kd_curproc sys/dev/kcov.c:559 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0xf sys/dev/kcov.c:143 __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x133 sys/kern/kern_lock.c:147 __mp_acquire_count(ffffffff828d3f20,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(ffff800022cc98e8,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff800022cc98e8,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff800022cc98e8,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(ffffffff82895cbc,120,ffffffff823a2c4c,2) at tsleep+0x1f2 sys/kern/kern_synch.c:163 sys_nanosleep(ffff80002123d7a8,ffff800022cc9a10,ffff800022cc9a60) at sys_nanosleep+0x1f5 sys/kern/kern_time.c:297 syscall(ffff800022cc9ae0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800022cc9ae0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc42d0, count: -13