panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 494409 57040 0 0 0 1 syz-executor.1 *474254 57040 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(fffffd806f6fa090) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1bd0,3,ffff8000212aad28) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd8073317678,40287401,ffff8000222c1bd0,3,fffffd807f7b75a0,ffff8000212aad28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80665db8e8,40287401,ffff8000222c1bd0,ffff8000212aad28) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212aad28,ffff8000222c1ce0,ffff8000222c1d30) at sys_ioctl+0x4b0 syscall(ffff8000222c1db0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1db0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x936066cdb90, 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(fffffd806f6fa090) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1bd0,3,ffff8000212aad28) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd8073317678,40287401,ffff8000222c1bd0,3,fffffd807f7b75a0,ffff8000212aad28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80665db8e8,40287401,ffff8000222c1bd0,ffff8000212aad28) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212aad28,ffff8000222c1ce0,ffff8000222c1d30) at sys_ioctl+0x4b0 syscall(ffff8000222c1db0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1db0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x936066cdb90, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000222c1610 rbx 0xffff8000222c1620 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x75fcc860297b56cb r11 0xb06653b4798383d7 r12 0x3000000008 r13 0xffff8000222c16c0 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222c1600 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=474254 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000212aa7e8,0xffff8000212aa018 process=0xffff800021235960 user=0xffff8000222bc000, 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 1993 362716 48934 0 2 0 syz-executor.0 57040 494409 63985 0 7 0 syz-executor.1 *57040 474254 63985 0 7 0x4000000 syz-executor.1 63985 324933 67426 0 2 0x482 syz-executor.1 48934 219903 67426 0 2 0x482 syz-executor.0 67426 174366 24148 0 3 0x82 thrsleep syz-fuzzer 67426 367850 24148 0 2 0x4000482 syz-fuzzer 67426 20562 24148 0 3 0x4000082 kqread syz-fuzzer 67426 343796 24148 0 3 0x4000082 thrsleep syz-fuzzer 67426 7150 24148 0 3 0x4000082 thrsleep syz-fuzzer 67426 65265 24148 0 3 0x4000082 thrsleep syz-fuzzer 67426 507296 24148 0 3 0x4000082 thrsleep syz-fuzzer 67426 99149 24148 0 3 0x4000082 thrsleep syz-fuzzer 24148 461656 25396 0 3 0x10008a sigsusp ksh 25396 319818 47255 0 3 0x92 select sshd 5556 89903 1 0 3 0x100083 ttyin getty 47255 103750 1 0 3 0x80 select sshd 79284 170204 55963 74 3 0x100092 bpf pflogd 55963 367871 1 0 3 0x80 netio pflogd 19817 206792 50630 73 3 0x100090 kqread syslogd 50630 376225 1 0 3 0x100082 netio syslogd 8305 344525 1 77 3 0x100090 poll dhclient 61291 523959 1 0 3 0x80 poll dhclient 37608 47758 0 0 3 0x14200 bored smr 28224 76207 0 0 2 0x14200 zerothread 52540 69917 0 0 3 0x14200 aiodoned aiodoned 51841 42623 0 0 3 0x14200 syncer update 87419 190378 0 0 3 0x14200 cleaner cleaner 90830 283744 0 0 3 0x14200 reaper reaper 88910 185364 0 0 3 0x14200 pgdaemon pagedaemon 38851 237672 0 0 3 0x14200 bored crynlk 11993 190915 0 0 3 0x14200 bored crypto 67433 32699 0 0 3 0x14200 bored viomb 5240 151669 0 0 3 0x40014200 acpi0 acpi0 38961 196503 0 0 3 0x40014200 idle1 67582 367637 0 0 3 0x14200 bored softnet 24308 514954 0 0 3 0x14200 bored systqmp 41475 481975 0 0 3 0x14200 bored systq 6159 209083 0 0 3 0x40014200 bored softclock 99777 2228 0 0 3 0x40014200 idle0 1 128451 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 57040 (syz-executor.1) thread 0xffff8000212aad28 (474254) 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 9491 6419K 6675K 78643K 10683 0 pcb 13 8K 8K 78643K 17 0 rtable 105 3K 3K 78643K 203 0 ifaddr 49 11K 11K 78643K 50 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1480 0 iov 0 0K 8K 78643K 4 0 mount 1 1K 1K 78643K 1 0 vnodes 1225 77K 77K 78643K 1260 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 3 0 VM map 2 1K 1K 78643K 2 0 sem 8 0K 0K 78643K 8 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 150 0 proc 61 63K 95K 78643K 462 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 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 360 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 160 29K 29K 78643K 1126 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 4 0 NDP 7 0K 0K 78643K 11 0 temp 71 3972K 4036K 78643K 2319 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 21 0 19 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 29 0 19 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 968 0 968 1 0 1 1 0 8 1 tcpcb 736 12 0 8 1 0 1 1 0 8 0 inpcb 304 50 0 43 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 14 0 0 1 0 1 1 0 8 0 pfstkey 112 14 0 0 1 0 1 1 0 8 0 pfstate 320 14 0 0 2 0 2 2 0 8 0 pfrule 1360 25 0 20 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 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 6 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1556 0 152 88 0 88 88 0 8 0 ffsino 272 1556 0 152 95 1 94 94 0 8 0 nchpl 144 1900 0 295 60 0 60 60 0 8 0 uvmvnodes 72 1633 0 0 30 0 30 30 0 8 0 vnodes 224 1633 0 0 97 0 97 97 0 8 0 namei 1024 4902 0 4902 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5621 0 5621 9 1 8 8 0 8 8 plimitpl 152 19 0 10 1 0 1 1 0 8 0 sigapl 424 366 0 333 4 0 4 4 0 8 0 futexpl 56 658 0 658 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 94 0 92 1 0 1 1 0 8 0 pipepl 336 82 0 71 2 0 2 2 0 8 1 fdescpl 496 350 0 333 3 0 3 3 0 8 0 filepl 152 1431 0 1325 6 1 5 5 0 8 0 lockfpl 104 10 0 9 1 0 1 1 0 8 0 lockfspl 48 5 0 4 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 83 0 74 1 0 1 1 0 8 0 zombiepl 144 333 0 333 2 1 1 1 0 8 1 processpl 1080 366 0 333 3 0 3 3 0 8 0 procpl 672 531 0 490 5 1 4 4 0 8 0 sockpl 432 100 0 81 3 0 3 3 0 8 0 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 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 mcl2k 2048 270 0 0 33 0 33 33 0 8 0 mtagpl 96 7 0 0 1 0 1 1 0 8 0 mbufpl 256 304 0 0 18 0 18 18 0 8 0 bufpl 280 3456 0 181 234 0 234 234 0 8 0 anonpl 24 45063 0 29639 95 1 94 94 0 186 0 amapchunkpl 152 1713 0 1346 17 1 16 16 0 158 1 amappl16 200 1044 0 425 33 0 33 33 0 8 0 amappl15 192 3 0 1 1 0 1 1 0 8 0 amappl14 184 29 0 22 1 0 1 1 0 8 0 amappl13 176 33 0 30 1 0 1 1 0 8 0 amappl12 168 11 0 10 2 1 1 1 0 8 0 amappl11 160 58 0 41 1 0 1 1 0 8 0 amappl10 152 88 0 81 1 0 1 1 0 8 0 amappl9 144 348 0 346 3 2 1 1 0 8 0 amappl8 136 184 0 127 3 0 3 3 0 8 0 amappl7 128 301 0 292 1 0 1 1 0 8 0 amappl6 120 131 0 118 1 0 1 1 0 8 0 amappl5 112 486 0 468 1 0 1 1 0 8 0 amappl4 104 276 0 252 1 0 1 1 0 8 0 amappl3 96 128 0 118 1 0 1 1 0 8 0 amappl2 88 1921 0 1852 3 1 2 3 0 8 0 amappl1 80 19112 0 18635 26 14 12 21 0 8 0 amappl 88 834 0 747 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 350 0 333 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 350 0 333 1 0 1 1 0 8 0 vmmpekpl 168 6484 0 6458 2 0 2 2 0 8 0 vmmpepl 168 51014 0 49060 116 12 104 104 0 357 19 vmsppl 368 349 0 333 2 0 2 2 0 8 0 rwobjpl 56 13132 0 11781 28 7 21 21 0 8 1 pdppl 4096 707 0 666 62 17 45 45 0 8 4 pvpl 32 178374 0 159826 156 1 155 155 0 265 5 pmappl 232 349 0 333 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 327 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(fffffd806f6fa090) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1bd0,3,ffff8000212aad28) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd8073317678,40287401,ffff8000222c1bd0,3,fffffd807f7b75a0,ffff8000212aad28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80665db8e8,40287401,ffff8000222c1bd0,ffff8000212aad28) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212aad28,ffff8000222c1ce0,ffff8000222c1d30) at sys_ioctl+0x4b0 syscall(ffff8000222c1db0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1db0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x936066cdb90, 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+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x129 sys/kern/kern_lock.c:147 syscall(ffff8000228c11d0) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000228c11d0) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7030, count: 9 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+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x129 sys/kern/kern_lock.c:147 syscall(ffff8000228c11d0) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000228c11d0) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7030, count: -6