panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *174602 30022 0 0 0x4000000 0K syz-executor.0 197306 473 0 0x2 0x4000480 1 syz-fuzzer 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(fffffd806ee1d090) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1260,3,ffff80002123cfc8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2df838,40287401,ffff8000222c1260,3,fffffd807f7b7900,ffff80002123cfc8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8067af2d10,40287401,ffff8000222c1260,ffff80002123cfc8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cfc8,ffff8000222c1370,ffff8000222c13c0) at sys_ioctl+0x4b0 syscall(ffff8000222c1440) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1440) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x604a6774340, 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ee1d090) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1260,3,ffff80002123cfc8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2df838,40287401,ffff8000222c1260,3,fffffd807f7b7900,ffff80002123cfc8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8067af2d10,40287401,ffff8000222c1260,ffff80002123cfc8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cfc8,ffff8000222c1370,ffff8000222c13c0) at sys_ioctl+0x4b0 syscall(ffff8000222c1440) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1440) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x604a6774340, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000222c0ca0 rbx 0xffff8000222c0cb0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x9a621bad2a6c9eba r11 0xa2ea4805819cb2d8 r12 0x3000000008 r13 0xffff8000222c0d50 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222c0c90 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=174602 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff80002123c2a8,0xffffffff828c76b0 process=0xffff800021234010 user=0xffff8000222bc000, vmspace=0xfffffd807eff9730 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 30022 51306 3270 0 2 0 syz-executor.0 *30022 174602 3270 0 7 0x4000000 syz-executor.0 71532 223944 473 0 2 0x2 syz-executor.1 3270 444819 473 0 2 0x482 syz-executor.0 473 497124 80814 0 3 0x82 thrsleep syz-fuzzer 473 197306 80814 0 7 0x4000482 syz-fuzzer 473 476610 80814 0 3 0x4000082 thrsleep syz-fuzzer 473 371190 80814 0 3 0x4000082 thrsleep syz-fuzzer 473 444752 80814 0 3 0x4000082 thrsleep syz-fuzzer 473 12401 80814 0 3 0x4000082 thrsleep syz-fuzzer 473 181132 80814 0 3 0x4000082 kqread syz-fuzzer 473 396814 80814 0 2 0x4000482 syz-fuzzer 80814 281354 38286 0 3 0x10008a sigsusp ksh 38286 486944 54375 0 3 0x92 select sshd 62316 488555 1 0 3 0x100083 ttyin getty 54375 217154 1 0 3 0x80 select sshd 8322 81061 66626 74 3 0x100092 bpf pflogd 66626 432622 1 0 3 0x80 netio pflogd 76329 132586 6524 73 2 0x100090 syslogd 6524 206893 1 0 3 0x100082 netio syslogd 63800 370380 1 77 3 0x100090 poll dhclient 91490 1351 1 0 3 0x80 poll dhclient 81879 392784 0 0 3 0x14200 bored smr 49677 505362 0 0 3 0x14200 pgzero zerothread 49144 181344 0 0 3 0x14200 aiodoned aiodoned 37455 469750 0 0 3 0x14200 syncer update 30669 373814 0 0 3 0x14200 cleaner cleaner 32776 406070 0 0 3 0x14200 reaper reaper 38501 495509 0 0 3 0x14200 pgdaemon pagedaemon 21229 392094 0 0 3 0x14200 bored crynlk 33511 254339 0 0 3 0x14200 bored crypto 58628 509535 0 0 3 0x14200 bored viomb 30479 366983 0 0 3 0x40014200 acpi0 acpi0 36183 79537 0 0 3 0x40014200 idle1 62372 522636 0 0 3 0x14200 bored softnet 25374 449380 0 0 3 0x14200 bored systqmp 6269 167339 0 0 3 0x14200 bored systq 79692 271075 0 0 3 0x40014200 bored softclock 79143 499030 0 0 3 0x40014200 idle0 1 204977 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 30022 (syz-executor.0) thread 0xffff80002123cfc8 (174602) 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 71532 (syz-executor.1) thread 0xffff80002123d268 (223944) exclusive rrwlock inode r = 0 (0xfffffd8067f442c0) #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 (0xfffffd8067f44a30) #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9485 6416K 6417K 78643K 10579 0 pcb 13 8K 8K 78643K 17 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 mount 1 1K 1K 78643K 1 0 vnodes 1219 77K 77K 78643K 1224 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 3 0K 0K 78643K 3 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 49 0 proc 59 63K 95K 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 43 201K 201K 78643K 43 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 138 25K 26K 78643K 849 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 10 0K 0K 78643K 10 0 temp 66 3971K 4035K 78643K 2077 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 21 0 19 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 27 0 17 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 875 0 875 5 1 4 4 0 8 4 tcpcb 736 12 0 5 1 0 1 1 0 8 0 inpcb 304 43 0 35 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 14 0 0 1 0 1 1 0 8 0 pfstkey 112 14 0 0 1 0 1 1 0 8 0 pfstate 320 14 0 0 2 0 2 2 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 1 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1441 0 37 88 0 88 88 0 8 0 ffsino 272 1441 0 37 95 1 94 94 0 8 0 nchpl 144 1674 0 70 60 0 60 60 0 8 0 uvmvnodes 72 1487 0 0 28 0 28 28 0 8 0 vnodes 224 1487 0 0 88 0 88 88 0 8 0 namei 1024 4351 0 4350 2 1 1 1 0 8 0 percpumem 16 33 0 0 1 0 1 1 0 8 0 scxspl 216 4969 0 4969 9 1 8 8 0 8 8 plimitpl 152 16 0 7 1 0 1 1 0 8 0 sigapl 424 265 0 233 4 0 4 4 0 8 0 futexpl 56 88 0 88 1 0 1 1 0 8 1 knotepl 112 62 0 42 1 0 1 1 0 8 0 kqueuepl 168 8 0 6 1 0 1 1 0 8 0 pipepl 336 76 0 65 1 0 1 1 0 8 0 fdescpl 496 249 0 233 3 0 3 3 0 8 0 filepl 152 1147 0 1040 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 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 72 0 63 1 0 1 1 0 8 0 zombiepl 144 233 0 233 2 1 1 1 0 8 1 processpl 1080 265 0 233 3 0 3 3 0 8 0 procpl 672 295 0 255 5 1 4 4 0 8 0 sockpl 432 91 0 71 3 0 3 3 0 8 0 mcl4k 4096 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 470 0 0 58 0 58 58 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 522 0 0 33 0 33 33 0 8 0 bufpl 280 3351 0 181 227 0 227 227 0 8 0 anonpl 24 39714 0 23242 102 1 101 101 0 186 1 amapchunkpl 152 1369 0 991 18 1 17 17 0 158 2 amappl16 200 822 0 152 36 0 36 36 0 8 0 amappl15 192 4 0 2 1 0 1 1 0 8 0 amappl14 184 31 0 26 1 0 1 1 0 8 0 amappl13 176 26 0 24 1 0 1 1 0 8 0 amappl12 168 14 0 12 1 0 1 1 0 8 0 amappl11 160 70 0 52 1 0 1 1 0 8 0 amappl10 152 8 0 4 1 0 1 1 0 8 0 amappl9 144 281 0 281 1 1 0 1 0 8 0 amappl8 136 155 0 113 2 0 2 2 0 8 0 amappl7 128 248 0 238 1 0 1 1 0 8 0 amappl6 120 63 0 54 1 0 1 1 0 8 0 amappl5 112 403 0 385 1 0 1 1 0 8 0 amappl4 104 279 0 255 1 0 1 1 0 8 0 amappl3 96 122 0 115 1 0 1 1 0 8 0 amappl2 88 1122 0 1050 3 1 2 3 0 8 0 amappl1 80 16221 0 15745 26 9 17 21 0 8 5 amappl 88 586 0 503 2 0 2 2 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 249 0 233 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 249 0 233 1 0 1 1 0 8 0 vmmpekpl 168 6126 0 6097 2 0 2 2 0 8 0 vmmpepl 168 38619 0 36724 120 11 109 109 0 357 26 vmsppl 368 248 0 233 2 0 2 2 0 8 0 rwobjpl 56 10434 0 9045 28 6 22 22 0 8 1 pdppl 4096 505 0 466 61 16 45 45 0 8 6 pvpl 32 140029 0 120499 163 0 163 163 0 265 4 pmappl 232 248 0 233 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 363 0 21 10 0 10 10 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ee1d090) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1260,3,ffff80002123cfc8) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e2df838,40287401,ffff8000222c1260,3,fffffd807f7b7900,ffff80002123cfc8) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8067af2d10,40287401,ffff8000222c1260,ffff80002123cfc8) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123cfc8,ffff8000222c1370,ffff8000222c13c0) at sys_ioctl+0x4b0 syscall(ffff8000222c1440) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1440) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x604a6774340, 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 __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 __mp_acquire_count(ffffffff828d3f20,1) at __mp_acquire_count+0x4c sys/kern/kern_lock.c:227 mi_switch() at mi_switch+0x390 sys/kern/sched_bsd.c:433 sleep_finish(ffff80002125d258,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff80002125d258,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff80002125d258,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(ffffffff82895cbc,120,ffffffff823a2c4c,2) at tsleep+0x1f2 sys/kern/kern_synch.c:163 sys_nanosleep(ffff8000ffff7cf0,ffff80002125d380,ffff80002125d3d0) at sys_nanosleep+0x1f5 sys/kern/kern_time.c:297 syscall(ffff80002125d450) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002125d450) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc00003ff20, count: 3 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 __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 __mp_acquire_count(ffffffff828d3f20,1) at __mp_acquire_count+0x4c sys/kern/kern_lock.c:227 mi_switch() at mi_switch+0x390 sys/kern/sched_bsd.c:433 sleep_finish(ffff80002125d258,1) at sleep_finish+0x111 sys/kern/kern_synch.c:427 sleep_finish_all(ffff80002125d258,1) at sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:457 [inline] sleep_finish_all(ffff80002125d258,1) at sleep_finish_all+0x32 sys/kern/kern_synch.c:402 tsleep(ffffffff82895cbc,120,ffffffff823a2c4c,2) at tsleep+0x1f2 sys/kern/kern_synch.c:163 sys_nanosleep(ffff8000ffff7cf0,ffff80002125d380,ffff80002125d3d0) at sys_nanosleep+0x1f5 sys/kern/kern_time.c:297 syscall(ffff80002125d450) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002125d450) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc00003ff20, count: -12