panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 259450 17687 32767 0x10 0 0 syz-executor.1 *423684 17687 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(fffffd807eb2f788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234bc100,3,ffff8000ffff4d20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7772f0,40287401,ffff8000234bc100,3,fffffd807f7b7960,ffff8000ffff4d20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80661fbc98,40287401,ffff8000234bc100,ffff8000ffff4d20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4d20,ffff8000234bc210,ffff8000234bc260) at sys_ioctl+0x4b0 syscall(ffff8000234bc2e0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234bc2e0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x22cec456d10, 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(fffffd807eb2f788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234bc100,3,ffff8000ffff4d20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7772f0,40287401,ffff8000234bc100,3,fffffd807f7b7960,ffff8000ffff4d20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80661fbc98,40287401,ffff8000234bc100,ffff8000ffff4d20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4d20,ffff8000234bc210,ffff8000234bc260) at sys_ioctl+0x4b0 syscall(ffff8000234bc2e0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234bc2e0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x22cec456d10, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000234bbb40 rbx 0xffff8000234bbb50 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xff19e8dd0ff533f0 r11 0xa0aeda1e9d7d9aa9 r12 0x3000000008 r13 0xffff8000234bbbf0 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000234bbb30 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=423684 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff47e0,0xffffffff828cbbd0 process=0xffff8000ffff32c0 user=0xffff8000234b7000, vmspace=0xfffffd807effa5c0 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 17687 259450 89616 32767 7 0x10 syz-executor.1 *17687 423684 89616 32767 7 0x4000010 syz-executor.1 89616 479793 14547 32767 3 0x90 nanoslp syz-executor.1 14547 353773 47994 0 3 0x82 wait syz-executor.1 65663 122781 36231 32767 3 0x10 biowait syz-executor.0 36231 45675 47994 0 3 0x82 wait syz-executor.0 47994 346271 89607 0 3 0x82 thrsleep syz-fuzzer 47994 337245 89607 0 3 0x4000082 thrsleep syz-fuzzer 47994 234644 89607 0 3 0x4000082 thrsleep syz-fuzzer 47994 493597 89607 0 3 0x4000082 thrsleep syz-fuzzer 47994 128511 89607 0 3 0x4000082 kqread syz-fuzzer 47994 280948 89607 0 3 0x4000082 thrsleep syz-fuzzer 47994 50465 89607 0 3 0x4000082 thrsleep syz-fuzzer 47994 204084 89607 0 3 0x4000082 thrsleep syz-fuzzer 89607 204639 6131 0 3 0x10008a sigsusp ksh 6131 112311 17211 0 3 0x92 select sshd 64737 322760 1 0 3 0x100083 ttyin getty 17211 226043 1 0 3 0x80 select sshd 86457 425753 98251 73 3 0x100090 kqread syslogd 98251 117448 1 0 3 0x100082 netio syslogd 50711 504716 1 77 3 0x100090 poll dhclient 11922 113048 1 0 3 0x80 poll dhclient 20852 334120 0 0 3 0x14200 bored smr 36814 262240 0 0 3 0x14200 pgzero zerothread 172 278730 0 0 3 0x14200 aiodoned aiodoned 62122 274180 0 0 3 0x14200 syncer update 8849 146133 0 0 3 0x14200 cleaner cleaner 24808 70674 0 0 3 0x14200 reaper reaper 35378 391425 0 0 3 0x14200 pgdaemon pagedaemon 46997 341278 0 0 3 0x14200 bored crynlk 69028 461686 0 0 3 0x14200 bored crypto 61915 321259 0 0 3 0x14200 bored viomb 15587 519651 0 0 3 0x40014200 acpi0 acpi0 61066 458167 0 0 3 0x40014200 idle1 42827 442946 0 0 3 0x14200 bored softnet 64645 153681 0 0 3 0x14200 bored systqmp 74083 53174 0 0 3 0x14200 bored systq 54140 494244 0 0 3 0x40014200 bored softclock 81529 475958 0 0 3 0x40014200 idle0 1 335611 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 17687 (syz-executor.1) thread 0xffff8000ffff4d20 (423684) 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 65663 (syz-executor.0) thread 0xffff8000211c2548 (122781) exclusive rrwlock inode r = 0 (0xfffffd8062d27e68) #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 (0xfffffd806bb4d3d8) #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 9478 6349K 6349K 78643K 10568 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 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 6 0K 0K 78643K 6 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 43 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 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 317 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 159 30K 31K 78643K 766 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 9 0K 0K 78643K 9 0 temp 61 3971K 4035K 78643K 1810 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 27 0 19 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 1 1 1 0 8 1 tcpcb 736 10 0 5 1 0 1 1 0 8 0 inpcb 304 32 0 24 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 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 4 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1423 0 27 88 0 88 88 0 8 0 ffsino 272 1423 0 27 94 0 94 94 0 8 0 nchpl 144 1647 0 50 60 0 60 60 0 8 0 uvmvnodes 72 1466 0 0 27 0 27 27 0 8 0 vnodes 224 1466 0 0 87 0 87 87 0 8 0 namei 1024 4009 0 4008 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 4822 0 4821 9 8 1 8 0 8 0 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 231 0 199 4 0 4 4 0 8 0 futexpl 56 72 0 72 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 16 0 14 1 0 1 1 0 8 0 pipepl 336 69 0 58 1 0 1 1 0 8 0 fdescpl 496 215 0 199 3 0 3 3 0 8 0 filepl 152 994 0 891 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 63 0 54 1 0 1 1 0 8 0 zombiepl 144 199 0 199 2 1 1 1 0 8 1 processpl 1080 231 0 199 5 2 3 3 0 8 0 procpl 672 250 0 210 4 0 4 4 0 8 0 sockpl 432 78 0 60 3 0 3 3 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 263 0 0 32 0 32 32 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 288 0 0 17 0 17 17 0 8 0 bufpl 280 3260 0 173 221 0 221 221 0 8 0 anonpl 24 44898 0 21941 143 3 140 140 0 186 1 amapchunkpl 152 1506 0 932 26 1 25 25 0 158 1 amappl16 200 982 0 118 46 0 46 46 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 23 0 18 1 0 1 1 0 8 0 amappl13 176 28 0 23 1 0 1 1 0 8 0 amappl12 168 22 0 16 1 0 1 1 0 8 0 amappl11 160 57 0 46 1 0 1 1 0 8 0 amappl10 152 7 0 2 1 0 1 1 0 8 0 amappl9 144 239 0 235 2 1 1 1 0 8 0 amappl8 136 161 0 108 3 0 3 3 0 8 0 amappl7 128 226 0 218 1 0 1 1 0 8 0 amappl6 120 60 0 52 1 0 1 1 0 8 0 amappl5 112 446 0 430 1 0 1 1 0 8 0 amappl4 104 255 0 229 1 0 1 1 0 8 0 amappl3 96 110 0 102 1 0 1 1 0 8 0 amappl2 88 890 0 825 3 1 2 3 0 8 0 amappl1 80 14222 0 13758 28 16 12 20 0 8 1 amappl 88 526 0 425 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 215 0 199 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 215 0 199 1 0 1 1 0 8 0 vmmpekpl 168 5832 0 5813 1 0 1 1 0 8 0 vmmpepl 168 35216 0 33024 146 15 131 131 0 357 35 vmsppl 368 214 0 199 2 0 2 2 0 8 0 rwobjpl 56 9678 0 8114 30 6 24 24 0 8 1 pdppl 4096 437 0 398 63 18 45 45 0 8 6 pvpl 32 136774 0 110285 215 0 215 215 0 265 1 pmappl 232 214 0 199 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{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+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x129 sys/kern/kern_lock.c:147 intr_handler(ffff80002349e460,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 upageflttrap(ffff80002349e600,22cb0ae27c0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff80002349e600) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffe56d0, count: 5 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+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x129 sys/kern/kern_lock.c:147 intr_handler(ffff80002349e460,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 upageflttrap(ffff80002349e600,22cb0ae27c0) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff80002349e600) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffe56d0, count: -10 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(fffffd807eb2f788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234bc100,3,ffff8000ffff4d20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7772f0,40287401,ffff8000234bc100,3,fffffd807f7b7960,ffff8000ffff4d20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80661fbc98,40287401,ffff8000234bc100,ffff8000ffff4d20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4d20,ffff8000234bc210,ffff8000234bc260) at sys_ioctl+0x4b0 syscall(ffff8000234bc2e0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234bc2e0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x22cec456d10, 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(fffffd807eb2f788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234bc100,3,ffff8000ffff4d20) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e7772f0,40287401,ffff8000234bc100,3,fffffd807f7b7960,ffff8000ffff4d20) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80661fbc98,40287401,ffff8000234bc100,ffff8000ffff4d20) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4d20,ffff8000234bc210,ffff8000234bc260) at sys_ioctl+0x4b0 syscall(ffff8000234bc2e0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234bc2e0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x22cec456d10, count: -9