panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *409003 45729 32767 0x10 0x4000000 0K syz-executor.0 520292 9754 32767 0x10 0 1 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(fffffd806e67f168) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256cbd90,3,ffff8000ffff4a88) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806f76d590,40287401,ffff8000256cbd90,3,fffffd807f7b77e0,ffff8000ffff4a88) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065a46ad0,40287401,ffff8000256cbd90,ffff8000ffff4a88) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4a88,ffff8000256cbea0,ffff8000256cbef0) at sys_ioctl+0x4b0 syscall(ffff8000256cbf70) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256cbf70) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x8a5fee3df30, 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(fffffd806e67f168) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256cbd90,3,ffff8000ffff4a88) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806f76d590,40287401,ffff8000256cbd90,3,fffffd807f7b77e0,ffff8000ffff4a88) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065a46ad0,40287401,ffff8000256cbd90,ffff8000ffff4a88) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4a88,ffff8000256cbea0,ffff8000256cbef0) at sys_ioctl+0x4b0 syscall(ffff8000256cbf70) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256cbf70) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x8a5fee3df30, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256cb7d0 rbx 0xffff8000256cb7e0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0x3ebe7facdc1e53c0 r11 0xbfaa3001e19f9da r12 0x3000000008 r13 0xffff8000256cb880 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256cb7c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=409003 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=75, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff4fc8,0xffffffff828cbbd0 process=0xffff8000ffff2e88 user=0xffff8000256c7000, vmspace=0xfffffd807effa8a0 estcpu=25, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 45729 170001 45758 32767 2 0x10 syz-executor.0 *45729 409003 45758 32767 7 0x4000010 syz-executor.0 45758 77291 43266 32767 2 0x490 syz-executor.0 9754 520292 330 32767 7 0x10 syz-executor.1 330 470268 8723 0 3 0x82 wait syz-executor.1 43266 374966 8723 0 3 0x82 wait syz-executor.0 8723 188725 88587 0 3 0x82 thrsleep syz-fuzzer 8723 307514 88587 0 2 0x4000482 syz-fuzzer 8723 190846 88587 0 3 0x4000082 thrsleep syz-fuzzer 8723 80002 88587 0 3 0x4000082 thrsleep syz-fuzzer 8723 243091 88587 0 2 0x4000482 syz-fuzzer 8723 148367 88587 0 3 0x4000082 thrsleep syz-fuzzer 8723 200496 88587 0 3 0x4000082 thrsleep syz-fuzzer 8723 343707 88587 0 3 0x4000082 kqread syz-fuzzer 88587 310748 78855 0 3 0x10008a sigsusp ksh 78855 495825 18642 0 3 0x92 select sshd 33540 189827 1 0 3 0x100083 ttyin getty 18642 357739 1 0 3 0x80 select sshd 25553 358168 22145 73 2 0x100090 syslogd 22145 126231 1 0 3 0x100082 netio syslogd 28454 42215 1 77 3 0x100090 poll dhclient 62105 119112 1 0 3 0x80 poll dhclient 46268 82495 0 0 3 0x14200 bored smr 78442 453209 0 0 3 0x14200 pgzero zerothread 57868 107391 0 0 3 0x14200 aiodoned aiodoned 15999 79136 0 0 3 0x14200 syncer update 29616 25397 0 0 3 0x14200 cleaner cleaner 43385 412061 0 0 3 0x14200 reaper reaper 70166 408470 0 0 3 0x14200 pgdaemon pagedaemon 3075 430092 0 0 3 0x14200 bored crynlk 17665 32560 0 0 3 0x14200 bored crypto 68864 313260 0 0 3 0x14200 bored viomb 30778 326058 0 0 3 0x40014200 acpi0 acpi0 51884 185797 0 0 3 0x40014200 idle1 78006 360293 0 0 2 0x14200 softnet 88720 310353 0 0 2 0x14200 systqmp 53106 229239 0 0 3 0x14200 bored systq 34709 34630 0 0 3 0x40014200 bored softclock 53710 144072 0 0 3 0x40014200 idle0 1 18674 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 45729 (syz-executor.0) thread 0xffff8000ffff4a88 (409003) 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 9754 (syz-executor.1) thread 0xffff8000ffff5a48 (520292) exclusive rrwlock inode r = 0 (0xfffffd8065600f78) #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 ufs_ihashins+0x45 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x135 sys/ufs/ffs/ffs_vfsops.c:1350 #5 ffs_inode_alloc+0x1e1 sys/ufs/ffs/ffs_alloc.c:394 #6 ufs_mkdir+0xf4 sys/ufs/ufs/ufs_vnops.c:1162 #7 VOP_MKDIR+0xc6 sys/kern/vfs_vops.c:459 #8 domkdirat+0x121 sys/kern/vfs_syscalls.c:3064 #9 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #9 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #10 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806bb550a8) #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 domkdirat+0x75 sys/kern/vfs_syscalls.c:3049 #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9478 6349K 6349K 78643K 10568 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 191 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 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 45 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 81 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 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 318 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 152 27K 28K 78643K 874 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 83 3977K 4041K 78643K 1914 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 31 0 23 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 390 0 390 2 1 1 1 0 8 1 tcpcb 736 14 0 7 1 0 1 1 0 8 0 inpcb 304 40 0 32 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 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 10 0 9 1 0 1 1 0 8 0 semupl 112 5 0 5 1 0 1 1 0 8 1 semapl 112 35 0 25 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1461 0 65 88 0 88 88 0 8 0 ffsino 272 1461 0 65 94 0 94 94 0 8 0 nchpl 144 1737 0 138 60 0 60 60 0 8 0 uvmvnodes 72 1504 0 0 28 0 28 28 0 8 0 vnodes 224 1504 0 0 89 0 89 89 0 8 0 namei 1024 4195 0 4194 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5045 0 5045 10 6 4 8 0 8 4 plimitpl 152 17 0 7 1 0 1 1 0 8 0 sigapl 424 269 0 237 4 0 4 4 0 8 0 futexpl 56 486 0 486 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 47 0 45 1 0 1 1 0 8 0 pipepl 336 71 0 60 2 0 2 2 0 8 1 fdescpl 496 253 0 237 3 0 3 3 0 8 1 filepl 152 1105 0 1002 6 1 5 5 0 8 1 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 69 0 60 1 0 1 1 0 8 0 zombiepl 144 237 0 237 2 1 1 1 0 8 1 processpl 1080 269 0 237 5 2 3 3 0 8 0 procpl 672 352 0 312 5 1 4 4 0 8 0 sockpl 432 92 0 74 3 0 3 3 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 255 0 0 31 0 31 31 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 264 0 0 16 0 16 16 0 8 0 bufpl 280 3297 0 173 224 0 224 224 0 8 0 anonpl 24 47850 0 23297 151 2 149 149 0 186 0 amapchunkpl 152 1642 0 1070 24 0 24 24 0 158 1 amappl16 200 1180 0 206 52 0 52 52 0 8 0 amappl15 192 32 0 29 1 0 1 1 0 8 0 amappl14 184 24 0 19 1 0 1 1 0 8 0 amappl13 176 24 0 22 1 0 1 1 0 8 0 amappl12 168 6 0 3 2 1 1 1 0 8 0 amappl11 160 47 0 36 1 0 1 1 0 8 0 amappl10 152 15 0 10 1 0 1 1 0 8 0 amappl9 144 144 0 143 1 0 1 1 0 8 0 amappl8 136 188 0 148 2 0 2 2 0 8 0 amappl7 128 216 0 208 1 0 1 1 0 8 0 amappl6 120 57 0 49 1 0 1 1 0 8 0 amappl5 112 672 0 653 1 0 1 1 0 8 0 amappl4 104 246 0 221 1 0 1 1 0 8 0 amappl3 96 110 0 103 1 0 1 1 0 8 0 amappl2 88 1252 0 1182 3 1 2 3 0 8 0 amappl1 80 15455 0 14979 28 16 12 20 0 8 1 amappl 88 642 0 531 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 253 0 237 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 253 0 237 1 0 1 1 0 8 0 vmmpekpl 168 6051 0 6026 2 0 2 2 0 8 0 vmmpepl 168 40324 0 38008 148 14 134 134 0 357 33 vmsppl 368 252 0 237 2 0 2 2 0 8 0 rwobjpl 56 11015 0 9329 33 7 26 26 0 8 1 pdppl 4096 513 0 474 63 18 45 45 0 8 6 pvpl 32 150836 0 123242 229 0 229 229 0 265 5 pmappl 232 252 0 237 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 320 0 21 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(fffffd806e67f168) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256cbd90,3,ffff8000ffff4a88) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806f76d590,40287401,ffff8000256cbd90,3,fffffd807f7b77e0,ffff8000ffff4a88) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065a46ad0,40287401,ffff8000256cbd90,ffff8000ffff4a88) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4a88,ffff8000256cbea0,ffff8000256cbef0) at sys_ioctl+0x4b0 syscall(ffff8000256cbf70) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256cbf70) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x8a5fee3df30, 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(ffff8000228b23e8,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff8000228b23e8,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff8000228b23e8,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(fffffd80627e7d58,11,ffffffff8242fc85,0) at tsleep+0x1f2 sys/kern/kern_synch.c:163 biowait(fffffd80627e7d58) at biowait+0x91 sys/kern/vfs_bio.c:1271 bwrite(fffffd80627e7d58) at bwrite+0x213 sys/kern/vfs_bio.c:772 VOP_BWRITE(fffffd80627e7d58) at VOP_BWRITE+0x4a sys/kern/vfs_vops.c:735 ufs_mkdir(ffff8000228b26f0) at ufs_mkdir+0x6a4 sys/ufs/ufs/ufs_vnops.c:1248 VOP_MKDIR(fffffd80663f4858,ffff8000228b2850,ffff8000228b28a0,ffff8000228b2780) at VOP_MKDIR+0xc6 sys/kern/vfs_vops.c:459 end trace frame: 0xffff8000228b2940, count: 0 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(ffff8000228b23e8,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff8000228b23e8,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff8000228b23e8,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(fffffd80627e7d58,11,ffffffff8242fc85,0) at tsleep+0x1f2 sys/kern/kern_synch.c:163 biowait(fffffd80627e7d58) at biowait+0x91 sys/kern/vfs_bio.c:1271 bwrite(fffffd80627e7d58) at bwrite+0x213 sys/kern/vfs_bio.c:772 VOP_BWRITE(fffffd80627e7d58) at VOP_BWRITE+0x4a sys/kern/vfs_vops.c:735 ufs_mkdir(ffff8000228b26f0) at ufs_mkdir+0x6a4 sys/ufs/ufs/ufs_vnops.c:1248 VOP_MKDIR(fffffd80663f4858,ffff8000228b2850,ffff8000228b28a0,ffff8000228b2780) at VOP_MKDIR+0xc6 sys/kern/vfs_vops.c:459 domkdirat(ffff8000ffff5a48,ffffff9c,7f7ffffc0cf0,1ff) at domkdirat+0x121 sys/kern/vfs_syscalls.c:3064 syscall(ffff8000228b2a20) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000228b2a20) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc0d70, count: -17