panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 270812 13943 32767 0x10 0 0 syz-executor.1 *171030 13943 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(fffffd806e65e248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e4d60,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e8f9130,40287401,ffff8000256e4d60,3,fffffd807f7b7a20,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663b3a38,40287401,ffff8000256e4d60,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000256e4e70,ffff8000256e4ec0) at sys_ioctl+0x4b0 syscall(ffff8000256e4f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e4f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc928d4ace10, 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(fffffd806e65e248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e4d60,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e8f9130,40287401,ffff8000256e4d60,3,fffffd807f7b7a20,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663b3a38,40287401,ffff8000256e4d60,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000256e4e70,ffff8000256e4ec0) at sys_ioctl+0x4b0 syscall(ffff8000256e4f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e4f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc928d4ace10, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256e47a0 rbx 0xffff8000256e47b0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xb4a98f3b5cdcaa62 r11 0x8d0113e15883bd32 r12 0x3000000008 r13 0xffff8000256e4850 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256e4790 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=171030 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff5268,0xffffffff828cbbd0 process=0xffff8000ffff3b30 user=0xffff8000256df000, vmspace=0xfffffd807effab80 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 13943 270812 12397 32767 7 0x10 syz-executor.1 13943 31105 12397 32767 2 0x4000010 syz-executor.1 *13943 171030 12397 32767 7 0x4000010 syz-executor.1 68587 418656 0 0 3 0x14200 bored sosplice 12397 128919 52281 32767 3 0x90 nanoslp syz-executor.1 52281 197536 12178 0 3 0x82 wait syz-executor.1 23782 149837 5807 32767 3 0x10 biowait syz-executor.0 5807 431905 12178 0 3 0x82 wait syz-executor.0 12178 311688 1742 0 3 0x82 thrsleep syz-fuzzer 12178 460027 1742 0 3 0x4000082 nanoslp syz-fuzzer 12178 397008 1742 0 3 0x4000082 thrsleep syz-fuzzer 12178 393566 1742 0 3 0x4000082 thrsleep syz-fuzzer 12178 183906 1742 0 3 0x4000082 thrsleep syz-fuzzer 12178 317206 1742 0 3 0x4000082 kqread syz-fuzzer 12178 261035 1742 0 3 0x4000082 thrsleep syz-fuzzer 12178 135990 1742 0 3 0x4000082 thrsleep syz-fuzzer 1742 520586 8294 0 3 0x10008a sigsusp ksh 8294 445307 63696 0 3 0x92 select sshd 70743 21395 1 0 3 0x100083 ttyin getty 63696 30327 1 0 3 0x80 select sshd 72227 344729 97565 73 3 0x100090 kqread syslogd 97565 330671 1 0 3 0x100082 netio syslogd 74077 405934 1 77 3 0x100090 poll dhclient 34916 468244 1 0 3 0x80 poll dhclient 97150 233648 0 0 3 0x14200 bored smr 45217 449786 0 0 3 0x14200 pgzero zerothread 87547 308199 0 0 3 0x14200 aiodoned aiodoned 99590 86785 0 0 3 0x14200 syncer update 64604 309736 0 0 3 0x14200 cleaner cleaner 66116 296229 0 0 3 0x14200 reaper reaper 88089 280997 0 0 3 0x14200 pgdaemon pagedaemon 21633 60735 0 0 3 0x14200 bored crynlk 49857 445209 0 0 3 0x14200 bored crypto 92210 47528 0 0 3 0x14200 bored viomb 26232 109219 0 0 3 0x40014200 acpi0 acpi0 98688 351612 0 0 3 0x40014200 idle1 11022 40155 0 0 2 0x14200 softnet 66692 295010 0 0 3 0x14200 bored systqmp 42282 398620 0 0 3 0x14200 bored systq 27006 26872 0 0 3 0x40014200 bored softclock 79899 90313 0 0 3 0x40014200 idle0 1 214630 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 13943 (syz-executor.1) thread 0xffff8000ffff47e8 (171030) 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 23782 (syz-executor.0) thread 0xffff8000211c27e8 (149837) exclusive rrwlock inode r = 0 (0xfffffd806552df78) #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 (0xfffffd806bb515f8) #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 6350K 6350K 78643K 10568 0 pcb 13 8K 8K 78643K 13 0 rtable 107 3K 3K 78643K 191 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 20 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 0K 78643K 42 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 93 0 proc 48 50K 70K 78643K 370 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 35 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 31 148K 148K 78643K 31 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 147 25K 26K 78643K 872 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 86 3977K 4041K 78643K 1934 0 kqueue 3 4K 9K 78643K 13 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 46 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 548 0 548 1 0 1 1 0 8 1 tcpcb 736 17 0 13 1 0 1 1 0 8 0 inpcb 304 49 0 42 1 0 1 1 0 8 0 nd6 48 7 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 201 0 0 13 0 13 13 0 8 0 art_table 32 202 0 0 2 0 2 2 0 8 0 art_node 16 45 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 7 0 0 1 0 1 1 0 8 0 semupl 112 4 0 4 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 1485 0 89 88 0 88 88 0 8 0 ffsino 272 1485 0 89 94 0 94 94 0 8 0 nchpl 144 1777 0 180 60 0 60 60 0 8 0 uvmvnodes 72 1528 0 0 28 0 28 28 0 8 0 vnodes 224 1528 0 0 90 0 90 90 0 8 0 namei 1024 4344 0 4343 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 5168 0 5167 9 1 8 8 0 8 7 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 282 0 249 4 0 4 4 0 8 0 futexpl 56 842 0 842 1 0 1 1 0 8 1 knotepl 112 72 0 52 1 0 1 1 0 8 0 kqueuepl 168 78 0 76 1 0 1 1 0 8 0 pipepl 336 69 0 58 1 0 1 1 0 8 0 fdescpl 496 265 0 249 3 0 3 3 0 8 1 filepl 152 1200 0 1098 6 1 5 5 0 8 1 lockfpl 104 17 0 16 1 0 1 1 0 8 0 lockfspl 48 9 0 8 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 78 0 69 1 0 1 1 0 8 0 zombiepl 144 249 0 249 2 1 1 1 0 8 1 processpl 1080 282 0 249 5 2 3 3 0 8 0 procpl 672 366 0 324 5 1 4 4 0 8 0 sosppl 168 5 0 5 1 0 1 1 0 8 1 sockpl 432 99 0 82 4 1 3 3 0 8 1 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 202 0 0 25 0 25 25 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 317 0 0 19 0 19 19 0 8 0 bufpl 280 3323 0 173 225 0 225 225 0 8 0 anonpl 24 47312 0 23815 144 2 142 142 0 186 0 amapchunkpl 152 1752 0 1153 27 1 26 26 0 158 2 amappl16 200 1091 0 209 47 0 47 47 0 8 0 amappl15 192 2 0 1 1 0 1 1 0 8 0 amappl14 184 56 0 50 1 0 1 1 0 8 0 amappl13 176 32 0 30 2 1 1 1 0 8 0 amappl12 168 5 0 3 1 0 1 1 0 8 0 amappl11 160 84 0 69 1 0 1 1 0 8 0 amappl10 152 13 0 9 1 0 1 1 0 8 0 amappl9 144 286 0 286 1 1 0 1 0 8 0 amappl8 136 115 0 86 2 0 2 2 0 8 0 amappl7 128 216 0 208 1 0 1 1 0 8 0 amappl6 120 62 0 52 1 0 1 1 0 8 0 amappl5 112 402 0 383 1 0 1 1 0 8 0 amappl4 104 280 0 254 1 0 1 1 0 8 0 amappl3 96 109 0 102 1 0 1 1 0 8 0 amappl2 88 1379 0 1312 3 1 2 3 0 8 0 amappl1 80 15706 0 15211 26 14 12 21 0 8 0 amappl 88 647 0 541 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 265 0 249 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 265 0 249 1 0 1 1 0 8 0 vmmpekpl 168 6054 0 6032 2 0 2 2 0 8 0 vmmpepl 168 41332 0 39102 141 10 131 131 0 357 30 vmsppl 368 264 0 249 2 0 2 2 0 8 0 rwobjpl 56 10972 0 9372 29 5 24 24 0 8 0 pdppl 4096 537 0 498 61 16 45 45 0 8 6 pvpl 32 155237 0 128648 220 0 220 220 0 265 4 pmappl 232 264 0 249 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 317 0 19 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x44 sys/dev/kcov.c:149 intr_handler(ffff8000234a22c0,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+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(ffff8000234a2460,c91dfbb7020) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000234a2460) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffc7e50, 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x44 sys/dev/kcov.c:149 intr_handler(ffff8000234a22c0,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+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(ffff8000234a2460,c91dfbb7020) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff8000234a2460) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffc7e50, 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(fffffd806e65e248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e4d60,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e8f9130,40287401,ffff8000256e4d60,3,fffffd807f7b7a20,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663b3a38,40287401,ffff8000256e4d60,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000256e4e70,ffff8000256e4ec0) at sys_ioctl+0x4b0 syscall(ffff8000256e4f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e4f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc928d4ace10, 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(fffffd806e65e248) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256e4d60,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e8f9130,40287401,ffff8000256e4d60,3,fffffd807f7b7a20,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663b3a38,40287401,ffff8000256e4d60,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000256e4e70,ffff8000256e4ec0) at sys_ioctl+0x4b0 syscall(ffff8000256e4f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256e4f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc928d4ace10, count: -9