panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 505020 72301 0 0 0 0 syz-executor.1 * 94054 72301 0 0 0x4000000 1K 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(fffffd806e25eb10) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000212a5040,3,ffff8000212727e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd807cc80c98,40287401,ffff8000212a5040,3,fffffd807f7b7720,ffff8000212727e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066741000,40287401,ffff8000212a5040,ffff8000212727e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212727e8,ffff8000212a5150,ffff8000212a51a0) at sys_ioctl+0x4b0 syscall(ffff8000212a5220) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212a5220) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1f81e77c670, 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e25eb10) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000212a5040,3,ffff8000212727e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd807cc80c98,40287401,ffff8000212a5040,3,fffffd807f7b7720,ffff8000212727e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066741000,40287401,ffff8000212a5040,ffff8000212727e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212727e8,ffff8000212a5150,ffff8000212a51a0) at sys_ioctl+0x4b0 syscall(ffff8000212a5220) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212a5220) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1f81e77c670, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000212a4a80 rbx 0xffff8000212a4a90 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x742c98a79325d29d r11 0xcd4f40ad12205a57 r12 0x3000000008 r13 0xffff8000212a4b30 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000212a4a70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=94054 stat=onproc flags process=0 proc=4000000 pri=61, usrpri=61, nice=20 forw=0xffffffffffffffff, list=0xffff8000212722a8,0xffffffff828c76b0 process=0xffff800021236e78 user=0xffff8000212a0000, vmspace=0xfffffd807eff98a0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 72301 505020 60211 0 7 0 syz-executor.1 *72301 94054 60211 0 7 0x4000000 syz-executor.1 60211 497788 17932 0 3 0x82 nanoslp syz-executor.1 21999 463845 17932 0 3 0x2 biowait syz-executor.0 17932 1263 5517 0 3 0x82 nanoslp syz-fuzzer 17932 35043 5517 0 3 0x4000082 nanoslp syz-fuzzer 17932 359434 5517 0 3 0x4000082 thrsleep syz-fuzzer 17932 434571 5517 0 3 0x4000082 thrsleep syz-fuzzer 17932 469605 5517 0 3 0x4000082 thrsleep syz-fuzzer 17932 340799 5517 0 3 0x4000082 thrsleep syz-fuzzer 17932 80233 5517 0 3 0x4000082 thrsleep syz-fuzzer 17932 378514 5517 0 3 0x4000082 kqread syz-fuzzer 5517 16301 43814 0 3 0x10008a sigsusp ksh 43814 239667 64347 0 3 0x92 select sshd 82071 185081 1 0 3 0x100083 ttyin getty 64347 201772 1 0 3 0x80 select sshd 27936 478087 28023 74 3 0x100092 bpf pflogd 28023 162684 1 0 3 0x80 netio pflogd 59807 100226 27168 73 3 0x100090 kqread syslogd 27168 461088 1 0 3 0x100082 netio syslogd 48585 37778 1 77 3 0x100090 poll dhclient 49012 390997 1 0 3 0x80 poll dhclient 55675 48043 0 0 3 0x14200 bored smr 52871 77132 0 0 3 0x14200 pgzero zerothread 2267 341479 0 0 3 0x14200 aiodoned aiodoned 47470 89300 0 0 3 0x14200 syncer update 46905 370517 0 0 3 0x14200 cleaner cleaner 88517 506180 0 0 3 0x14200 reaper reaper 93972 522739 0 0 3 0x14200 pgdaemon pagedaemon 39459 296967 0 0 3 0x14200 bored crynlk 26310 462144 0 0 3 0x14200 bored crypto 93760 433470 0 0 3 0x14200 bored viomb 21118 523537 0 0 3 0x40014200 acpi0 acpi0 14580 345071 0 0 3 0x40014200 idle1 70188 206260 0 0 3 0x14200 bored softnet 24722 307252 0 0 3 0x14200 bored systqmp 89744 259847 0 0 3 0x14200 bored systq 67494 522580 0 0 3 0x40014200 bored softclock 80865 291353 0 0 3 0x40014200 idle0 1 440659 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 72301 (syz-executor.1) thread 0xffff8000212727e8 (94054) 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 Process 21999 (syz-executor.0) thread 0xffff800021273a48 (463845) exclusive rrwlock inode r = 0 (0xfffffd80667fa4e0) #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 (0xfffffd80667fae70) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9482 6416K 6432K 78643K 10589 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 199 0 ifaddr 44 10K 10K 78643K 45 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1469 0 iov 0 0K 0K 78643K 56 0 mount 1 1K 1K 78643K 1 0 vnodes 1217 77K 77K 78643K 1229 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 8 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 522 0 sigio 0 0K 0K 78643K 10 0 proc 59 63K 83K 78643K 447 0 subproc 32 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 25 122K 122K 78643K 25 0 exec 0 0K 2K 78643K 358 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 26K 27K 78643K 1986 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 6 0K 0K 78643K 10 0 temp 65 3971K 4035K 78643K 3215 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 33 0 23 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 260 0 260 1 1 0 1 0 8 0 tcpcb 736 10 0 6 1 0 1 1 0 8 0 inpcb 304 39 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 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 12 0 2 1 0 1 1 0 8 0 pfstkey 112 12 0 2 1 0 1 1 0 8 0 pfstate 320 12 0 2 1 0 1 1 0 8 0 pfrule 1360 21 0 16 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 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 1919 0 516 88 0 88 88 0 8 0 ffsino 272 1919 0 516 95 1 94 94 0 8 0 nchpl 144 2634 0 1030 60 0 60 60 0 8 0 uvmvnodes 72 1969 0 0 36 0 36 36 0 8 0 vnodes 224 1969 0 0 116 0 116 116 0 8 0 namei 1024 6282 0 6281 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 7815 0 7814 10 3 7 8 0 8 6 plimitpl 152 16 0 7 1 0 1 1 0 8 0 sigapl 424 738 0 706 4 0 4 4 0 8 0 futexpl 56 2487 0 2487 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 708 0 704 1 0 1 1 0 8 0 pipepl 336 88 0 77 2 0 2 2 0 8 1 fdescpl 496 722 0 706 3 0 3 3 0 8 0 filepl 152 2377 0 2272 6 1 5 5 0 8 0 lockfpl 104 23 0 22 1 0 1 1 0 8 0 lockfspl 48 12 0 11 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 56 0 47 1 0 1 1 0 8 0 zombiepl 144 706 0 706 2 1 1 1 0 8 1 processpl 1080 738 0 706 3 0 3 3 0 8 0 procpl 672 1282 0 1242 5 1 4 4 0 8 0 sockpl 432 91 0 72 3 0 3 3 0 8 0 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 8 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 177 0 0 22 0 22 22 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 200 0 0 12 0 12 12 0 8 0 bufpl 280 3827 0 181 261 0 261 261 0 8 0 anonpl 24 75362 0 50772 153 2 151 151 0 186 0 amapchunkpl 152 3086 0 2545 22 0 22 22 0 158 0 amappl16 200 2745 0 1721 55 0 55 55 0 8 1 amappl15 192 2 0 1 1 0 1 1 0 8 0 amappl14 184 25 0 21 1 0 1 1 0 8 0 amappl13 176 26 0 24 1 0 1 1 0 8 0 amappl12 168 10 0 9 2 1 1 1 0 8 0 amappl11 160 317 0 298 1 0 1 1 0 8 0 amappl10 152 16 0 12 1 0 1 1 0 8 0 amappl9 144 282 0 281 1 0 1 1 0 8 0 amappl8 136 150 0 109 2 0 2 2 0 8 0 amappl7 128 244 0 237 1 0 1 1 0 8 0 amappl6 120 69 0 58 1 0 1 1 0 8 0 amappl5 112 882 0 863 1 0 1 1 0 8 0 amappl4 104 535 0 511 1 0 1 1 0 8 0 amappl3 96 126 0 118 1 0 1 1 0 8 0 amappl2 88 4944 0 4875 3 1 2 3 0 8 0 amappl1 80 28748 0 28271 27 15 12 21 0 8 0 amappl 88 1588 0 1488 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 722 0 706 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 722 0 706 1 0 1 1 0 8 0 vmmpekpl 168 8196 0 8171 2 0 2 2 0 8 0 vmmpepl 168 96275 0 94007 148 12 136 137 0 357 35 vmsppl 368 721 0 706 2 0 2 2 0 8 0 rwobjpl 56 21910 0 20151 33 7 26 26 0 8 0 pdppl 4096 1451 0 1412 63 19 44 45 0 8 5 pvpl 32 293460 0 265818 230 0 230 230 0 265 3 pmappl 232 721 0 706 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 312 0 24 9 0 9 9 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff826d1ff0) 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 sys/kern/kern_lock.c:147 intr_handler(ffff8000222b31d0,ffff80000006a400) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge17_untramp() at Xintr_ioapic_edge17_untramp+0x18f end of kernel end trace frame: 0x7f7ffffe17c0, count: 9 ddb{0}> trace x86_ipi_db(ffffffff826d1ff0) 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x122 sys/kern/kern_lock.c:147 intr_handler(ffff8000222b31d0,ffff80000006a400) at intr_handler+0x5e sys/arch/amd64/amd64/intr.c:532 Xintr_ioapic_edge17_untramp() at Xintr_ioapic_edge17_untramp+0x18f end of kernel end trace frame: 0x7f7ffffe17c0, count: -6 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e25eb10) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000212a5040,3,ffff8000212727e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd807cc80c98,40287401,ffff8000212a5040,3,fffffd807f7b7720,ffff8000212727e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066741000,40287401,ffff8000212a5040,ffff8000212727e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212727e8,ffff8000212a5150,ffff8000212a51a0) at sys_ioctl+0x4b0 syscall(ffff8000212a5220) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212a5220) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1f81e77c670, count: 6 ddb{1}> 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(fffffd806e25eb10) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000212a5040,3,ffff8000212727e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd807cc80c98,40287401,ffff8000212a5040,3,fffffd807f7b7720,ffff8000212727e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066741000,40287401,ffff8000212a5040,ffff8000212727e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000212727e8,ffff8000212a5150,ffff8000212a51a0) at sys_ioctl+0x4b0 syscall(ffff8000212a5220) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212a5220) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x1f81e77c670, count: -9