panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 225221 74127 32767 0x10 0 0 syz-executor.1 *238426 74127 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(fffffd806ee42788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e8bb0,3,ffff8000ffff4548) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806eebf210,40287401,ffff8000256e8bb0,3,fffffd807f7b77e0,ffff8000ffff4548) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663c0ab0,40287401,ffff8000256e8bb0,ffff8000ffff4548) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4548,ffff8000256e8cc0,ffff8000256e8d10) at sys_ioctl+0x4b0 syscall(ffff8000256e8d90) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e8d90) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa102066efb0, 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(fffffd806ee42788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e8bb0,3,ffff8000ffff4548) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806eebf210,40287401,ffff8000256e8bb0,3,fffffd807f7b77e0,ffff8000ffff4548) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663c0ab0,40287401,ffff8000256e8bb0,ffff8000ffff4548) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4548,ffff8000256e8cc0,ffff8000256e8d10) at sys_ioctl+0x4b0 syscall(ffff8000256e8d90) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e8d90) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa102066efb0, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256e85f0 rbx 0xffff8000256e8600 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xd58790d3ec807d45 r11 0xa8ece5c26e8d8e8f r12 0x3000000008 r13 0xffff8000256e86a0 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256e85e0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=238426 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=55, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff4d28,0xffffffff828cbbd0 process=0xffff8000ffff3b30 user=0xffff8000256e3000, vmspace=0xfffffd807effaa10 estcpu=5, cpticks=2, pctcpu=0.6 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 74127 225221 1094 32767 7 0x10 syz-executor.1 74127 320056 1094 32767 3 0x4000090 ttyout syz-executor.1 *74127 238426 1094 32767 7 0x4000010 syz-executor.1 24531 3133 0 0 3 0x14200 bored sosplice 1094 403649 40967 32767 3 0x90 nanoslp syz-executor.1 78906 517085 42622 32767 3 0x10 biowait syz-executor.0 40967 31878 97853 0 3 0x82 wait syz-executor.1 42622 53858 97853 0 3 0x82 wait syz-executor.0 97853 307877 82312 0 3 0x82 thrsleep syz-fuzzer 97853 348246 82312 0 3 0x4000082 thrsleep syz-fuzzer 97853 191104 82312 0 3 0x4000082 thrsleep syz-fuzzer 97853 376143 82312 0 3 0x4000082 thrsleep syz-fuzzer 97853 7583 82312 0 3 0x4000082 kqread syz-fuzzer 97853 443229 82312 0 3 0x4000082 thrsleep syz-fuzzer 97853 505547 82312 0 3 0x4000082 thrsleep syz-fuzzer 97853 23244 82312 0 3 0x4000082 thrsleep syz-fuzzer 82312 77506 97508 0 3 0x10008a sigsusp ksh 97508 315575 94114 0 3 0x92 select sshd 10738 243856 1 0 3 0x100083 ttyin getty 94114 220324 1 0 3 0x80 select sshd 40401 44048 75855 73 3 0x100090 kqread syslogd 75855 519403 1 0 3 0x100082 netio syslogd 85634 373807 1 77 3 0x100090 poll dhclient 31503 6025 1 0 3 0x80 poll dhclient 80276 276664 0 0 3 0x14200 bored smr 20202 517128 0 0 3 0x14200 pgzero zerothread 26855 316210 0 0 3 0x14200 aiodoned aiodoned 15437 474728 0 0 3 0x14200 syncer update 457 288466 0 0 3 0x14200 cleaner cleaner 87018 276489 0 0 3 0x14200 reaper reaper 95207 241171 0 0 3 0x14200 pgdaemon pagedaemon 74856 73472 0 0 3 0x14200 bored crynlk 61726 269964 0 0 3 0x14200 bored crypto 24421 269203 0 0 3 0x14200 bored viomb 32429 317594 0 0 3 0x40014200 acpi0 acpi0 81230 99800 0 0 3 0x40014200 idle1 37407 124805 0 0 3 0x14200 bored softnet 97284 65823 0 0 3 0x14200 bored systqmp 73191 496257 0 0 3 0x14200 bored systq 67728 73887 0 0 3 0x40014200 bored softclock 49649 411459 0 0 3 0x40014200 idle0 1 500055 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 74127 (syz-executor.1) thread 0xffff8000ffff4548 (238426) 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 78906 (syz-executor.0) thread 0xffff8000ffff5a48 (517085) exclusive rrwlock inode r = 0 (0xfffffd80662aee68) #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 (0xfffffd806bb4c0a8) #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 9479 6350K 6350K 78643K 10569 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 193 0 ifaddr 39 10K 10K 78643K 39 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 15 0 iov 0 0K 2K 78643K 4 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 0K 1K 78643K 46 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 92 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 ip_moptions 0 0K 0K 78643K 10 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 164 28K 29K 78643K 918 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 72 3974K 4038K 78643K 1931 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 23 0 21 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 45 0 37 1 0 1 1 0 8 0 syncache 296 5 0 5 2 1 1 1 0 8 1 tcpqe 32 906 0 906 1 0 1 1 0 8 1 tcpcb 736 24 0 19 1 0 1 1 0 8 0 inpcb 304 51 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 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 0 1 0 1 1 0 8 0 semupl 112 13 0 13 1 0 1 1 0 8 1 semapl 112 36 0 26 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1472 0 76 88 0 88 88 0 8 0 ffsino 272 1472 0 76 94 0 94 94 0 8 0 nchpl 144 1753 0 156 60 0 60 60 0 8 0 uvmvnodes 72 1515 0 0 28 0 28 28 0 8 0 vnodes 224 1515 0 0 90 0 90 90 0 8 0 namei 1024 4304 0 4303 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5115 0 5114 9 8 1 8 0 8 0 plimitpl 152 18 0 7 1 0 1 1 0 8 0 sigapl 424 281 0 248 4 0 4 4 0 8 0 futexpl 56 740 0 740 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 71 0 69 1 0 1 1 0 8 0 pipepl 336 74 0 63 2 0 2 2 0 8 1 fdescpl 496 264 0 248 3 0 3 3 0 8 0 filepl 152 1219 0 1116 6 1 5 5 0 8 0 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 93 0 84 1 0 1 1 0 8 0 zombiepl 144 248 0 248 2 1 1 1 0 8 1 processpl 1080 281 0 248 5 2 3 3 0 8 0 procpl 672 383 0 341 5 1 4 4 0 8 0 sosppl 168 1 0 0 1 0 1 1 0 8 0 sockpl 432 124 0 106 4 1 3 3 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 279 0 0 34 0 34 34 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 301 0 0 18 0 18 18 0 8 0 bufpl 280 3312 0 173 225 0 225 225 0 8 0 anonpl 24 48126 0 23816 149 2 147 147 0 186 0 amapchunkpl 152 1701 0 1131 26 1 25 25 0 158 2 amappl16 200 1168 0 210 51 0 51 51 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 62 0 55 1 0 1 1 0 8 0 amappl13 176 25 0 23 1 0 1 1 0 8 0 amappl12 168 7 0 6 1 0 1 1 0 8 0 amappl11 160 77 0 62 1 0 1 1 0 8 0 amappl10 152 14 0 9 1 0 1 1 0 8 0 amappl9 144 280 0 278 1 0 1 1 0 8 0 amappl8 136 154 0 107 2 0 2 2 0 8 0 amappl7 128 220 0 211 1 0 1 1 0 8 0 amappl6 120 57 0 50 1 0 1 1 0 8 0 amappl5 112 403 0 387 1 0 1 1 0 8 0 amappl4 104 277 0 250 1 0 1 1 0 8 0 amappl3 96 121 0 111 1 0 1 1 0 8 0 amappl2 88 1358 0 1289 3 1 2 3 0 8 0 amappl1 80 15564 0 15087 26 14 12 20 0 8 1 amappl 88 667 0 560 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 264 0 248 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 264 0 248 1 0 1 1 0 8 0 vmmpekpl 168 6138 0 6113 2 0 2 2 0 8 0 vmmpepl 168 41759 0 39445 146 12 134 134 0 357 31 vmsppl 368 263 0 248 2 0 2 2 0 8 0 rwobjpl 56 11205 0 9525 32 6 26 26 0 8 1 pdppl 4096 535 0 496 63 18 45 45 0 8 6 pvpl 32 154455 0 126574 227 0 227 227 0 265 0 pmappl 232 263 0 248 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 324 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f __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 upageflttrap(ffff8000234beed0,a10c36f5f20) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000234beed0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffc6ec0, 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+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f __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 upageflttrap(ffff8000234beed0,a10c36f5f20) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000234beed0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffc6ec0, 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(fffffd806ee42788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e8bb0,3,ffff8000ffff4548) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806eebf210,40287401,ffff8000256e8bb0,3,fffffd807f7b77e0,ffff8000ffff4548) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663c0ab0,40287401,ffff8000256e8bb0,ffff8000ffff4548) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4548,ffff8000256e8cc0,ffff8000256e8d10) at sys_ioctl+0x4b0 syscall(ffff8000256e8d90) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e8d90) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa102066efb0, 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(fffffd806ee42788) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e8bb0,3,ffff8000ffff4548) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806eebf210,40287401,ffff8000256e8bb0,3,fffffd807f7b77e0,ffff8000ffff4548) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663c0ab0,40287401,ffff8000256e8bb0,ffff8000ffff4548) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4548,ffff8000256e8cc0,ffff8000256e8d10) at sys_ioctl+0x4b0 syscall(ffff8000256e8d90) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e8d90) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa102066efb0, count: -9