panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *194135 50480 0 0 0x4000000 0K syz-executor.1 121207 50480 0 0 0x4000000 1 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 vrele(fffffd8076c37c70) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021bef760,1,ffff800020b5f3d8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fabc580,c0106477,ffff800021bef760,1,fffffd807f7c6600,ffff800020b5f3d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067fd3560,c0106477,ffff800021bef760,ffff800020b5f3d8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b5f3d8,ffff800021bef878,ffff800021bef8e0) at sys_ioctl+0x5b8 syscall(ffff800021bef950) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021bef950) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,49690ddd010) at Xsyscall+0x128 end of kernel end trace frame: 0x498cd550740, 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() at panic+0x15c sys/kern/subr_prf.c:207 vrele(fffffd8076c37c70) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff800021bef760,1,ffff800020b5f3d8) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd806fabc580,c0106477,ffff800021bef760,1,fffffd807f7c6600,ffff800020b5f3d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067fd3560,c0106477,ffff800021bef760,ffff800020b5f3d8) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800020b5f3d8,ffff800021bef878,ffff800021bef8e0) at sys_ioctl+0x5b8 syscall(ffff800021bef950) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] syscall(ffff800021bef950) at syscall+0x552 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff1f,0,3,49690ddd010) at Xsyscall+0x128 end of kernel end trace frame: 0x498cd550740, count: -9 ddb{0}> show registers rdi 0xffffffff818a6367 db_enter+0x17 rsi 0x6a82 __ALIGN_SIZE+0x5a82 rbp 0xffff800021bef320 rbx 0xffff800021bef3d0 rdx 0x6a83 __ALIGN_SIZE+0x5a83 rcx 0xffff800021c06000 rax 0xffff800021c06000 r8 0xffffffff817612d3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x5999e31855802afd r12 0x3000000008 r13 0xffff800021bef330 r14 0x100 r15 0x1 rip 0xffffffff818a6368 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021bef310 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=194135 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b5e018,0xffff800020b5e518 process=0xffff800020b7c000 user=0xffff800021bea000, vmspace=0xfffffd807effd2e0 estcpu=36, cpticks=3, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 11860 237717 38577 0 2 0 syz-executor.0 11860 328907 38577 0 2 0x4000000 syz-executor.0 50480 246353 10346 0 2 0 syz-executor.1 *50480 194135 10346 0 7 0x4000000 syz-executor.1 50480 121207 10346 0 7 0x4000000 syz-executor.1 52839 71700 1 0 3 0x100083 ttyin getty 38577 210994 1819 0 2 0x482 syz-executor.0 10109 63324 0 0 3 0x14200 bored sosplice 10346 432059 1819 0 2 0x482 syz-executor.1 1819 159364 13380 0 3 0x82 thrsleep syz-fuzzer 1819 498566 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 433380 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 278909 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 63659 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 91125 13380 0 3 0x4000082 kqread syz-fuzzer 1819 290169 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 238281 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 326281 13380 0 3 0x4000082 thrsleep syz-fuzzer 1819 203100 13380 0 3 0x4000082 thrsleep syz-fuzzer 13380 94885 55151 0 3 0x10008a pause ksh 55151 155987 24041 0 3 0x92 select sshd 24041 102744 1 0 3 0x80 select sshd 4153 447987 40306 74 3 0x100092 bpf pflogd 40306 33672 1 0 3 0x80 netio pflogd 98169 156531 18761 73 2 0x100090 syslogd 18761 375781 1 0 3 0x100082 netio syslogd 81051 24035 1 77 3 0x100090 poll dhclient 25483 229381 1 0 3 0x80 poll dhclient 59010 23872 0 0 2 0x14200 zerothread 22972 474397 0 0 3 0x14200 aiodoned aiodoned 73911 65984 0 0 3 0x14200 syncer update 82430 138763 0 0 3 0x14200 cleaner cleaner 41306 87876 0 0 3 0x14200 reaper reaper 42613 51172 0 0 3 0x14200 pgdaemon pagedaemon 78834 130230 0 0 3 0x14200 bored crynlk 55324 319221 0 0 3 0x14200 bored crypto 50545 130595 0 0 3 0x40014200 acpi0 acpi0 46436 411308 0 0 3 0x40014200 idle1 19029 496951 0 0 3 0x14200 bored softnet 97991 301280 0 0 3 0x14200 bored systqmp 6139 289432 0 0 3 0x14200 bored systq 2658 146056 0 0 3 0x40014200 bored softclock 32335 174671 0 0 3 0x40014200 idle0 88558 46192 0 0 3 0x14200 bored smr 1 361981 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 11860 (syz-executor.0) thread 0xffff800020b5e290 (328907) exclusive rrwlock inode r = 0 (0xfffffd8078607b48) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 ufs_ihashins+0x45 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x133 sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1cf sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_makeinode+0xaa sys/ufs/ufs/ufs_vnops.c:1832 #7 ufs_mknod+0x4e sys/ufs/ufs/ufs_vnops.c:172 #8 VOP_MKNOD+0x6a sys/kern/vfs_vops.c:134 #9 domknodat+0x319 sys/kern/vfs_syscalls.c:1553 #10 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #10 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #11 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd80786071b8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:556 #5 vfs_lookup+0xec sys/kern/vfs_lookup.c:418 #6 namei+0x61c sys/kern/vfs_lookup.c:248 #7 domknodat+0x92 sys/kern/vfs_syscalls.c:1505 #8 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #8 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #9 Xsyscall+0x128 Process 50480 (syz-executor.1) thread 0xffff800020b5f3d8 (194135) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff823a69a8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1163 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x38f sys/kern/sched_bsd.c:441 #3 sleep_finish+0x113 sys/kern/kern_synch.c:373 #4 tsleep+0x198 sleep_finish_timeout sys/kern/kern_synch.c:397 [inline] #4 tsleep+0x198 sleep_finish_all sys/kern/kern_synch.c:183 [inline] #4 tsleep+0x198 sys/kern/kern_synch.c:152 #5 fifo_open+0x3b6 sys/miscfs/fifofs/fifo_vnops.c:194 #6 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #7 vn_open+0x495 sys/kern/vfs_vnops.c:174 #8 diskmapioctl+0x1ba sys/dev/diskmap.c:89 #9 VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 #10 vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 #11 sys_ioctl+0x5b8 #12 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:92 [inline] #12 syscall+0x552 sys/arch/amd64/amd64/trap.c:555 #13 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9569 6434K 7129K 78643K 17529 0 0 pcb 13 8K 8K 78643K 238 0 0 rtable 113 4K 4K 78643K 774 0 0 ifaddr 75 16K 18K 78643K 359 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1592 0 0 iov 0 0K 24K 78643K 297 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 77K 78643K 3613 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 43 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 276 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12765 0 0 file desc 6 17K 25K 78643K 2630 0 0 sigio 0 0K 0K 78643K 35 0 0 proc 53 50K 83K 78643K 773 0 0 subproc 32 2K 2K 78643K 55 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 278 0 0 in_multi 33 2K 2K 78643K 133 0 0 ether_multi 1 0K 0K 78643K 12 0 0 mrt 0 0K 0K 78643K 18 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 84 371K 371K 78643K 84 0 0 exec 0 0K 1K 78643K 412 0 0 pfkey data 0 0K 0K 78643K 1 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 101 21K 30K 78643K 9593 0 0 UVM aobj 130 4K 4K 78643K 137 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 183 0 0 NDP 17 0K 0K 78643K 97 0 0 temp 207 2748K 3388K 78643K 11685 0 0 kqueue 0 0K 0K 78643K 21 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 9 0 2 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 120 0 118 1 0 1 1 0 8 0 rtentry 112 60 0 15 2 0 2 2 0 8 0 unpcb 120 866 0 854 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 7900 0 7900 2 2 0 2 0 8 0 tcpcb 544 487 0 483 1 0 1 1 0 8 0 inpcb 280 1343 0 1335 1 0 1 1 0 8 0 rttmr 72 4 0 4 2 2 0 1 0 8 0 nd6 48 9 0 3 1 0 1 1 0 8 0 pkpcb 40 10 0 10 4 4 0 1 0 8 0 ppxss 1128 63 0 63 6 6 0 1 0 8 0 pffrag 232 1 0 1 1 1 0 1 0 482 0 pffrnode 88 1 0 1 1 1 0 1 0 8 0 pffrent 40 3 0 3 2 2 0 1 0 8 0 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 67 0 44 1 0 1 1 0 8 0 pfstkey 112 67 0 44 1 0 1 1 0 8 0 pfstate 328 67 0 44 3 0 3 3 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 236 0 44 12 0 12 12 0 8 0 art_table 32 237 0 44 2 0 2 2 0 8 0 art_node 16 59 0 18 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 8 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 274 0 264 1 0 1 1 0 8 0 shmpl 112 135 0 7 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 5649 0 4227 47 0 47 47 0 8 0 ffsino 272 5649 0 4227 96 0 96 96 0 8 0 nchpl 144 9577 0 7945 62 0 62 62 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 29732 0 29731 3 2 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 4 0 4 3 3 0 1 0 8 0 scxspl 192 27502 0 27502 12 11 1 6 0 8 1 plimitpl 152 215 0 207 1 0 1 1 0 8 0 sigapl 432 2829 0 2813 3 1 2 3 0 8 0 futexpl 56 32222 0 32222 2 1 1 1 0 8 1 knotepl 112 528 0 509 2 1 1 2 0 8 0 kqueuepl 104 588 0 586 1 0 1 1 0 8 0 pipepl 112 1616 0 1597 5 3 2 2 0 8 1 fdescpl 488 2830 0 2813 3 0 3 3 0 8 0 filepl 152 16858 0 16756 7 2 5 6 0 8 0 lockfpl 104 871 0 871 3 2 1 1 0 8 1 lockfspl 48 310 0 310 3 2 1 1 0 8 1 sessionpl 112 21 0 10 1 0 1 1 0 8 0 pgrppl 48 65 0 54 1 0 1 1 0 8 0 ucredpl 96 3294 0 3285 1 0 1 1 0 8 0 zombiepl 144 2813 0 2813 3 2 1 1 0 8 1 processpl 896 2846 0 2813 4 0 4 4 0 8 0 procpl 632 8706 0 8661 10 5 5 5 0 8 1 srpgc 64 4 0 4 2 2 0 1 0 8 0 sosppl 128 44 0 44 8 7 1 1 0 8 1 sockpl 384 2365 0 2344 8 5 3 4 0 8 0 mcl64k 65536 257 0 0 33 0 33 33 0 8 0 mcl16k 16384 6 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 15 0 0 2 0 2 2 0 8 0 mcl8k 8192 10 0 0 2 0 2 2 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 203 0 0 23 3 20 23 0 8 0 mtagpl 80 23 0 0 1 0 1 1 0 8 0 mbufpl 256 507 0 0 23 0 23 23 0 8 0 bufpl 256 11313 0 4284 440 0 440 440 0 8 0 anonpl 16 234730 0 222763 109 44 65 65 0 125 15 amapchunkpl 152 16117 0 16006 28 20 8 10 0 158 3 amappl16 192 11722 0 11064 71 30 41 45 0 8 8 amappl15 184 1283 0 1281 1 0 1 1 0 8 0 amappl14 176 1338 0 1331 1 0 1 1 0 8 0 amappl13 168 8 0 7 1 0 1 1 0 8 0 amappl12 160 4 0 3 2 1 1 1 0 8 0 amappl11 152 1367 0 1349 1 0 1 1 0 8 0 amappl10 144 75 0 71 1 0 1 1 0 8 0 amappl9 136 611 0 607 1 0 1 1 0 8 0 amappl8 128 165 0 143 1 0 1 1 0 8 0 amappl7 120 40 0 35 1 0 1 1 0 8 0 amappl6 112 1357 0 1347 1 0 1 1 0 8 0 amappl5 104 172 0 157 1 0 1 1 0 8 0 amappl4 96 1836 0 1806 2 1 1 2 0 8 0 amappl3 88 2838 0 2824 1 0 1 1 0 8 0 amappl2 80 21793 0 21715 3 1 2 3 0 8 0 amappl1 72 70061 0 69614 27 17 10 20 0 8 0 amappl 80 8980 0 8940 1 0 1 1 0 84 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 136 0 7 3 0 3 3 0 8 0 uaddrrnd 24 2830 0 2813 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2830 0 2813 1 0 1 1 0 8 0 vmmpekpl 168 27181 0 27147 2 0 2 2 0 8 0 vmmpepl 168 347750 0 345863 163 72 91 101 0 357 8 vmsppl 368 2829 0 2813 2 0 2 2 0 8 0 pdppl 4096 5668 0 5626 6 0 6 6 0 8 0 pvpl 32 690564 0 675303 246 86 160 160 0 265 36 pmappl 232 2829 0 2813 2 1 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 653 0 8 19 0 19 19 0 8 0