panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 432722 50778 32767 0x10 0 0 syz-executor.1 *347456 50778 32767 0x10 0x4000000 1K 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(fffffd806e5814e8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256f9530,3,ffff8000228ab508) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7762f0,40287401,ffff8000256f9530,3,fffffd807f7b7600,ffff8000228ab508) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80643c8260,40287401,ffff8000256f9530,ffff8000228ab508) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000228ab508,ffff8000256f9640,ffff8000256f9690) at sys_ioctl+0x4b0 syscall(ffff8000256f9710) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256f9710) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4a87ffe1d30, 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(fffffd806e5814e8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256f9530,3,ffff8000228ab508) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7762f0,40287401,ffff8000256f9530,3,fffffd807f7b7600,ffff8000228ab508) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80643c8260,40287401,ffff8000256f9530,ffff8000228ab508) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000228ab508,ffff8000256f9640,ffff8000256f9690) at sys_ioctl+0x4b0 syscall(ffff8000256f9710) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256f9710) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4a87ffe1d30, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256f8f70 rbx 0xffff8000256f8f80 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xa2c1f65540cf49f9 r11 0x5322cb902d0530b9 r12 0x3000000008 r13 0xffff8000256f9020 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256f8f60 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=347456 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=58, nice=20 forw=0xffffffffffffffff, list=0xffff8000228aa548,0xffffffff828cbbd0 process=0xffff8000234c76f8 user=0xffff8000256f4000, vmspace=0xfffffd807effa8a0 estcpu=16, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 50778 432722 46114 32767 7 0x10 syz-executor.1 *50778 347456 46114 32767 7 0x4000010 syz-executor.1 16808 340455 21876 32767 2 0x10 syz-executor.0 16808 445738 21876 32767 3 0x4000010 biowait syz-executor.0 16808 84892 21876 32767 3 0x4000010 inode syz-executor.0 46114 425499 81005 32767 3 0x90 nanoslp syz-executor.1 21876 300549 75990 32767 3 0x90 nanoslp syz-executor.0 81005 463633 75421 0 3 0x82 wait syz-executor.1 75990 32016 75421 0 3 0x82 wait syz-executor.0 75421 523878 70626 0 3 0x82 thrsleep syz-fuzzer 75421 334538 70626 0 3 0x4000082 thrsleep syz-fuzzer 75421 54229 70626 0 3 0x4000082 thrsleep syz-fuzzer 75421 428222 70626 0 3 0x4000082 thrsleep syz-fuzzer 75421 79305 70626 0 3 0x4000082 thrsleep syz-fuzzer 75421 363009 70626 0 3 0x4000082 kqread syz-fuzzer 75421 144873 70626 0 3 0x4000082 thrsleep syz-fuzzer 75421 455052 70626 0 3 0x4000082 thrsleep syz-fuzzer 70626 98903 17819 0 3 0x10008a sigsusp ksh 17819 91489 65526 0 3 0x92 select sshd 1768 357498 1 0 3 0x100083 ttyin getty 65526 204978 1 0 3 0x80 select sshd 9084 364427 13709 73 3 0x100090 kqread syslogd 13709 127967 1 0 3 0x100082 netio syslogd 88831 124529 1 77 3 0x100090 poll dhclient 20446 201407 1 0 3 0x80 poll dhclient 55338 467311 0 0 3 0x14200 bored smr 61974 344365 0 0 2 0x14200 zerothread 73565 217978 0 0 3 0x14200 aiodoned aiodoned 34240 102961 0 0 3 0x14200 syncer update 1390 78740 0 0 3 0x14200 cleaner cleaner 16360 417970 0 0 3 0x14200 reaper reaper 14850 334637 0 0 3 0x14200 pgdaemon pagedaemon 26839 36258 0 0 3 0x14200 bored crynlk 48222 77414 0 0 3 0x14200 bored crypto 48113 27704 0 0 3 0x14200 bored viomb 19509 129918 0 0 3 0x40014200 acpi0 acpi0 10078 191771 0 0 3 0x40014200 idle1 80591 235658 0 0 3 0x14200 bored softnet 45683 34055 0 0 3 0x14200 bored systqmp 89351 420937 0 0 3 0x14200 bored systq 91202 332165 0 0 3 0x40014200 bored softclock 99568 317594 0 0 3 0x40014200 idle0 1 92474 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 50778 (syz-executor.1) thread 0xffff8000228ab508 (347456) 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 Process 16808 (syz-executor.0) thread 0xffff8000228aaa88 (445738) exclusive rrwlock inode r = 0 (0xfffffd8065c0bb38) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x443 sys/kern/kern_rwlock.c:312 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:463 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 #4 vn_lock+0x6c sys/kern/vfs_vnops.c:575 #5 vn_write+0x11a sys/kern/vfs_vnops.c:411 #6 dofilewritev+0x1ab sys/kern/sys_generic.c:365 #7 sys_writev+0xa7 sys/kern/sys_generic.c:312 #8 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #9 Xsyscall+0x128 Process 16808 (syz-executor.0) thread 0xffff8000228aa008 (84892) exclusive rrwlock inode r = 0 (0xfffffd8065c0be68) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x443 sys/kern/kern_rwlock.c:312 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:463 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:614 #4 vn_lock+0x6c sys/kern/vfs_vnops.c:575 #5 vfs_lookup+0xe6 sys/kern/vfs_lookup.c:419 #6 namei+0x5f7 sys/kern/vfs_lookup.c:249 #7 dofchownat+0xb5 sys/kern/vfs_syscalls.c:2434 #8 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9480 6350K 6350K 78643K 10570 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 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 1K 1K 78643K 23 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 126 0 proc 48 50K 70K 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 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 49 228K 228K 78643K 49 0 exec 0 0K 2K 78643K 322 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 165 31K 31K 78643K 1027 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 5 0K 0K 78643K 9 0 temp 77 3975K 4039K 78643K 1991 0 kqueue 3 4K 4K 78643K 3 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 19 0 17 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 68 0 60 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 289 0 289 2 2 0 1 0 8 0 tcpcb 736 22 0 18 2 0 2 2 0 8 1 inpcb 304 58 0 51 1 0 1 1 0 8 0 ip6q 72 1 0 1 1 0 1 1 0 8 1 ip6af 40 2 0 2 1 0 1 1 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 8 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 15 0 5 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1509 0 112 88 0 88 88 0 8 0 ffsino 272 1509 0 112 94 0 94 94 0 8 0 nchpl 144 1835 0 235 60 0 60 60 0 8 0 uvmvnodes 72 1552 0 0 29 0 29 29 0 8 0 vnodes 224 1552 0 0 92 0 92 92 0 8 0 namei 1024 4463 0 4462 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5610 0 5609 10 9 1 8 0 8 0 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 314 0 281 4 0 4 4 0 8 0 futexpl 56 1398 0 1398 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 161 0 159 1 0 1 1 0 8 0 pipepl 336 94 0 83 2 0 2 2 0 8 1 fdescpl 496 298 0 281 3 0 3 3 0 8 0 filepl 152 1449 0 1345 6 1 5 5 0 8 0 lockfpl 104 8 0 6 1 0 1 1 0 8 0 lockfspl 48 5 0 3 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 87 0 78 1 0 1 1 0 8 0 zombiepl 144 281 0 281 2 1 1 1 0 8 1 processpl 1080 314 0 281 5 2 3 3 0 8 0 procpl 672 469 0 426 5 1 4 4 0 8 0 sockpl 432 150 0 133 3 0 3 3 0 8 0 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 216 0 0 25 0 25 25 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 266 0 0 16 0 16 16 0 8 0 bufpl 280 3516 0 173 239 0 239 239 0 8 0 anonpl 24 50994 0 26826 150 4 146 146 0 186 0 amapchunkpl 152 1912 0 1344 25 1 24 24 0 158 0 amappl16 200 1240 0 283 51 0 51 51 0 8 0 amappl15 192 2 0 1 1 0 1 1 0 8 0 amappl14 184 68 0 61 1 0 1 1 0 8 0 amappl13 176 81 0 75 1 0 1 1 0 8 0 amappl12 168 8 0 7 2 1 1 1 0 8 0 amappl11 160 57 0 44 1 0 1 1 0 8 0 amappl10 152 19 0 13 1 0 1 1 0 8 0 amappl9 144 276 0 275 2 1 1 1 0 8 0 amappl8 136 156 0 106 2 0 2 2 0 8 0 amappl7 128 218 0 212 1 0 1 1 0 8 0 amappl6 120 66 0 51 1 0 1 1 0 8 0 amappl5 112 452 0 434 1 0 1 1 0 8 0 amappl4 104 243 0 218 1 0 1 1 0 8 0 amappl3 96 176 0 166 1 0 1 1 0 8 0 amappl2 88 1647 0 1570 3 1 2 3 0 8 0 amappl1 80 17208 0 16696 26 15 11 20 0 8 0 amappl 88 766 0 651 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 298 0 281 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 298 0 281 1 0 1 1 0 8 0 vmmpekpl 168 6409 0 6382 2 0 2 2 0 8 0 vmmpepl 168 46258 0 43798 153 21 132 133 0 357 25 vmsppl 368 297 0 281 2 0 2 2 0 8 0 rwobjpl 56 12231 0 10519 33 8 25 25 0 8 0 pdppl 4096 603 0 562 63 19 44 45 0 8 3 pvpl 32 171556 0 144205 229 5 224 224 0 265 2 pmappl 232 297 0 281 2 1 1 2 0 8 0 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{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 intr_handler(ffff8000256d30b0,ffff80000006a400) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge17_untramp() at Xintr_ioapic_edge17_untramp+0x18f __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 syscall(ffff8000256d3280) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000256d3280) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe7ae0, count: 6 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 intr_handler(ffff8000256d30b0,ffff80000006a400) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge17_untramp() at Xintr_ioapic_edge17_untramp+0x18f __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 syscall(ffff8000256d3280) at syscall+0x3fd mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000256d3280) at syscall+0x3fd sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe7ae0, count: -9 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(fffffd806e5814e8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256f9530,3,ffff8000228ab508) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7762f0,40287401,ffff8000256f9530,3,fffffd807f7b7600,ffff8000228ab508) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80643c8260,40287401,ffff8000256f9530,ffff8000228ab508) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000228ab508,ffff8000256f9640,ffff8000256f9690) at sys_ioctl+0x4b0 syscall(ffff8000256f9710) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256f9710) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4a87ffe1d30, 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(fffffd806e5814e8) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256f9530,3,ffff8000228ab508) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7762f0,40287401,ffff8000256f9530,3,fffffd807f7b7600,ffff8000228ab508) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80643c8260,40287401,ffff8000256f9530,ffff8000228ab508) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000228ab508,ffff8000256f9640,ffff8000256f9690) at sys_ioctl+0x4b0 syscall(ffff8000256f9710) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256f9710) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4a87ffe1d30, count: -9