panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 92677 87341 32767 0x10 0x4000000 0K syz-executor.0 298109 76547 0 0x2 0x4000000 1 syz-fuzzer 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(fffffd806e664328) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234caa70,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e636210,40287401,ffff8000234caa70,3,fffffd807f7b7840,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663ddc00,40287401,ffff8000234caa70,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000234cab80,ffff8000234cabd0) at sys_ioctl+0x4b0 syscall(ffff8000234cac50) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234cac50) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe6f55b995f0, 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(fffffd806e664328) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234caa70,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e636210,40287401,ffff8000234caa70,3,fffffd807f7b7840,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663ddc00,40287401,ffff8000234caa70,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000234cab80,ffff8000234cabd0) at sys_ioctl+0x4b0 syscall(ffff8000234cac50) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234cac50) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe6f55b995f0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000234ca4b0 rbx 0xffff8000234ca4c0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0x7e3bfadd878006c8 r11 0x5d47fe4b4118dae4 r12 0x3000000008 r13 0xffff8000234ca560 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000234ca4a0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=92677 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff4008,0xffffffff828cbbd0 process=0xffff8000ffff32c0 user=0xffff8000234c5000, vmspace=0xfffffd807effab80 estcpu=36, cpticks=3, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 87341 35109 12316 32767 2 0x10 syz-executor.0 *87341 92677 12316 32767 7 0x4000010 syz-executor.0 42160 356483 5234 32767 2 0x10 syz-executor.1 12316 297510 13875 32767 2 0x490 syz-executor.0 5234 140671 76547 0 3 0x82 wait syz-executor.1 13875 483504 76547 0 3 0x82 wait syz-executor.0 76547 335290 79017 0 3 0x82 thrsleep syz-fuzzer 76547 466136 79017 0 2 0x4000002 syz-fuzzer 76547 5891 79017 0 3 0x4000082 thrsleep syz-fuzzer 76547 284802 79017 0 3 0x4000082 thrsleep syz-fuzzer 76547 298109 79017 0 7 0x4000002 syz-fuzzer 76547 266586 79017 0 2 0x4000482 syz-fuzzer 76547 240189 79017 0 3 0x4000082 thrsleep syz-fuzzer 76547 125712 79017 0 3 0x4000082 thrsleep syz-fuzzer 79017 373532 99305 0 3 0x10008a sigsusp ksh 99305 458818 11721 0 3 0x92 select sshd 68831 131341 1 0 3 0x100083 ttyin getty 11721 71631 1 0 3 0x80 select sshd 76554 443805 46398 73 2 0x100090 syslogd 46398 324981 1 0 3 0x100082 netio syslogd 97969 48679 1 77 3 0x100090 poll dhclient 93515 276602 1 0 3 0x80 poll dhclient 62756 476536 0 0 3 0x14200 bored smr 73800 484078 0 0 3 0x14200 pgzero zerothread 65718 470139 0 0 3 0x14200 aiodoned aiodoned 55957 276622 0 0 3 0x14200 syncer update 28409 231110 0 0 3 0x14200 cleaner cleaner 12031 343800 0 0 3 0x14200 reaper reaper 70878 147382 0 0 3 0x14200 pgdaemon pagedaemon 22103 344630 0 0 3 0x14200 bored crynlk 56510 131269 0 0 3 0x14200 bored crypto 96220 71519 0 0 3 0x14200 bored viomb 3223 218839 0 0 3 0x40014200 acpi0 acpi0 91066 290879 0 0 3 0x40014200 idle1 87847 343267 0 0 3 0x14200 bored softnet 74753 369198 0 0 3 0x14200 bored systqmp 70049 335851 0 0 3 0x14200 bored systq 83783 38379 0 0 2 0x40014200 softclock 88934 466629 0 0 3 0x40014200 idle0 1 456808 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 87341 (syz-executor.0) thread 0xffff8000ffff47e8 (92677) 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 42160 (syz-executor.1) thread 0xffff8000ffff4a88 (356483) exclusive rrwlock inode r = 0 (0xfffffd8067451a28) #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 vget+0x1c6 sys/kern/vfs_subr.c:671 #6 ufs_ihashget+0x121 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x6b sys/ufs/ffs/ffs_vfsops.c:1321 #8 ufs_lookup+0x151d sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #10 vfs_lookup+0x708 sys/kern/vfs_lookup.c:568 #11 namei+0x5f7 sys/kern/vfs_lookup.c:249 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1848 #13 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #13 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd80798f8b40) #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 vget+0x1c6 sys/kern/vfs_subr.c:671 #6 cache_lookup+0x2b4 sys/kern/vfs_cache.c:224 #7 ufs_lookup+0x1c0 sys/ufs/ufs/ufs_lookup.c:162 #8 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #9 vfs_lookup+0x708 sys/kern/vfs_lookup.c:568 #10 namei+0x5f7 sys/kern/vfs_lookup.c:249 #11 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1848 #12 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #12 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #13 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 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 2 0K 0K 78643K 2 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 39 0 proc 48 50K 83K 78643K 367 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 137 26K 26K 78643K 737 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 1802 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 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 487 0 487 1 0 1 1 0 8 1 tcpcb 736 10 0 6 1 0 1 1 0 8 0 inpcb 304 32 0 25 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 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1421 0 24 88 0 88 88 0 8 0 ffsino 272 1421 0 24 94 0 94 94 0 8 0 nchpl 144 1646 0 46 60 0 60 60 0 8 0 uvmvnodes 72 1464 0 0 27 0 27 27 0 8 0 vnodes 224 1464 0 0 87 0 87 87 0 8 0 namei 1024 4011 0 4011 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 4781 0 4781 9 1 8 8 0 8 8 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 227 0 195 4 0 4 4 0 8 0 futexpl 56 33 0 33 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 4 0 2 1 0 1 1 0 8 0 pipepl 336 69 0 58 1 0 1 1 0 8 0 fdescpl 496 211 0 195 3 0 3 3 0 8 0 filepl 152 981 0 877 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 195 0 195 2 1 1 1 0 8 1 processpl 1080 227 0 195 5 2 3 3 0 8 0 procpl 672 239 0 199 5 1 4 4 0 8 0 sockpl 432 78 0 61 4 1 3 3 0 8 1 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 198 0 0 24 0 24 24 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 220 0 0 14 0 14 14 0 8 0 bufpl 280 3256 0 173 221 0 221 221 0 8 0 anonpl 24 44977 0 20548 151 2 149 149 0 186 1 amapchunkpl 152 1440 0 940 22 0 22 22 0 158 1 amappl16 200 1161 0 117 56 0 56 56 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 22 0 19 1 0 1 1 0 8 0 amappl13 176 24 0 22 1 0 1 1 0 8 0 amappl12 168 25 0 19 1 0 1 1 0 8 0 amappl11 160 60 0 46 1 0 1 1 0 8 0 amappl10 152 12 0 7 1 0 1 1 0 8 0 amappl9 144 276 0 275 1 0 1 1 0 8 0 amappl8 136 135 0 98 2 0 2 2 0 8 0 amappl7 128 222 0 213 1 0 1 1 0 8 0 amappl6 120 63 0 53 1 0 1 1 0 8 0 amappl5 112 359 0 343 1 0 1 1 0 8 0 amappl4 104 254 0 224 1 0 1 1 0 8 0 amappl3 96 110 0 101 1 0 1 1 0 8 0 amappl2 88 912 0 843 3 1 2 3 0 8 0 amappl1 80 13864 0 13396 26 10 16 20 0 8 6 amappl 88 513 0 419 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 211 0 195 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 211 0 195 1 0 1 1 0 8 0 vmmpekpl 168 5815 0 5792 2 0 2 2 0 8 0 vmmpepl 168 34869 0 32508 150 4 146 146 0 357 43 vmsppl 368 210 0 195 2 0 2 2 0 8 0 rwobjpl 56 9677 0 7941 31 4 27 27 0 8 2 pdppl 4096 429 0 390 58 13 45 45 0 8 6 pvpl 32 135102 0 107609 227 0 227 227 0 265 3 pmappl 232 210 0 195 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 304 0 16 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(fffffd806e664328) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000234caa70,3,ffff8000ffff47e8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e636210,40287401,ffff8000234caa70,3,fffffd807f7b7840,ffff8000ffff47e8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd80663ddc00,40287401,ffff8000234caa70,ffff8000ffff47e8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff47e8,ffff8000234cab80,ffff8000234cabd0) at sys_ioctl+0x4b0 syscall(ffff8000234cac50) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000234cac50) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe6f55b995f0, 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x5f sys/dev/kcov.c:149 upageflttrap(ffff800021260bc0,c0045f0868) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff800021260bc0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0xc000481670, count: 8 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 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x5f sys/dev/kcov.c:149 upageflttrap(ffff800021260bc0,c0045f0868) at upageflttrap+0x77 sys/arch/amd64/amd64/trap.c:180 usertrap(ffff800021260bc0) at usertrap+0x21a sys/arch/amd64/amd64/trap.c:406 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0xc000481670, count: -7