panic: vputonfreelist: lock count is not zero Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *329452 66533 0 0x1000 0x4080000 1K syz-executor.0 94994 65404 0 0x14000 0x200 0 reaper db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8226d206) at panic+0x15c sys/kern/subr_prf.c:207 vputonfreelist(fffffd807d02b8f8) at vputonfreelist+0x139 sys/kern/vfs_subr.c:711 vn_closefile(fffffd807be94c78,ffff800020ac2eb8) at vn_closefile+0xe2 sys/kern/vfs_vnops.c:615 fdrop(fffffd807be94c78,ffff800020ac2eb8) at fdrop+0xc2 sys/kern/kern_descrip.c:1276 sys_ftruncate(ffff800020ac2eb8,ffff80002139b318,ffff80002139b360) at sys_ftruncate+0x21f sys/kern/vfs_syscalls.c:2860 syscall(ffff80002139b3e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002139b3e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x94efd2e5ea0, count: 7 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 vputonfreelist: lock count is not zero ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8226d206) at panic+0x15c sys/kern/subr_prf.c:207 vputonfreelist(fffffd807d02b8f8) at vputonfreelist+0x139 sys/kern/vfs_subr.c:711 vn_closefile(fffffd807be94c78,ffff800020ac2eb8) at vn_closefile+0xe2 sys/kern/vfs_vnops.c:615 fdrop(fffffd807be94c78,ffff800020ac2eb8) at fdrop+0xc2 sys/kern/kern_descrip.c:1276 sys_ftruncate(ffff800020ac2eb8,ffff80002139b318,ffff80002139b360) at sys_ftruncate+0x21f sys/kern/vfs_syscalls.c:2860 syscall(ffff80002139b3e0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002139b3e0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x94efd2e5ea0, count: -8 ddb{1}> show registers rdi 0xffffffff8219a9e7 db_enter+0x17 rsi 0x2c34 __ALIGN_SIZE+0x1c34 rbp 0xffff80002139b080 rbx 0xffff80002139b130 rdx 0x2c35 __ALIGN_SIZE+0x1c35 rcx 0xffff800023da4000 rax 0xffff800023da4000 r8 0xffffffff81fb607f kprintf+0x16f r9 0x1 r10 0x25 r11 0xdcd3c538e0f7868 r12 0x3000000008 r13 0xffff80002139b090 r14 0x100 r15 0x1 rip 0xffffffff8219a9e8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002139b070 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=329452 stat=onproc flags process=1000 proc=4080000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020ac24f8,0xffff800020ac2298 process=0xffff800020aa9a60 user=0xffff800021396000, vmspace=0xfffffd807f000730 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 60067 366220 96112 0 2 0 syz-executor.1 60067 334815 96112 0 3 0x4000080 fsleep syz-executor.1 66533 313468 6970 0 3 0x3000 suspend syz-executor.0 66533 209038 6970 0 2 0x4081000 syz-executor.0 *66533 329452 6970 0 7 0x4081000 syz-executor.0 96112 28963 36713 0 3 0x82 nanosleep syz-executor.1 6970 224725 36713 0 3 0x82 nanosleep syz-executor.0 90723 381245 0 0 3 0x14200 bored sosplice 36713 292913 53564 0 3 0x82 thrsleep syz-fuzzer 36713 130463 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 40504 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 267883 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 212087 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 511734 53564 0 3 0x4000082 kqread syz-fuzzer 36713 493240 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 268552 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 371970 53564 0 3 0x4000082 thrsleep syz-fuzzer 36713 114442 53564 0 3 0x4000082 thrsleep syz-fuzzer 53564 196695 62068 0 3 0x10008a pause ksh 62068 240530 12069 0 3 0x92 select sshd 2246 487359 1 0 3 0x100083 ttyin getty 12069 76757 1 0 3 0x80 select sshd 53538 420524 45234 74 3 0x100092 bpf pflogd 45234 61868 1 0 3 0x80 netio pflogd 95725 191426 73699 73 3 0x100090 kqread syslogd 73699 293637 1 0 3 0x100082 netio syslogd 44211 276762 1 77 3 0x100090 poll dhclient 21075 269518 1 0 3 0x80 poll dhclient 1787 229749 0 0 3 0x14200 bored smr 6316 389662 0 0 2 0x14200 zerothread 55269 239099 0 0 3 0x14200 aiodoned aiodoned 61238 451701 0 0 3 0x14200 syncer update 21553 361932 0 0 3 0x14200 cleaner cleaner 65404 94994 0 0 7 0x14200 reaper 27566 182374 0 0 3 0x14200 pgdaemon pagedaemon 76165 230650 0 0 3 0x14200 bored crynlk 63721 324183 0 0 3 0x14200 bored crypto 16318 380498 0 0 3 0x40014200 acpi0 acpi0 90674 136033 0 0 3 0x40014200 idle1 3759 110855 0 0 3 0x14200 bored softnet 87750 289469 0 0 3 0x14200 bored systqmp 20569 361661 0 0 3 0x14200 bored systq 6222 44447 0 0 3 0x40014200 bored softclock 35444 478978 0 0 3 0x40014200 idle0 1 89886 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 66533 (syz-executor.0) thread 0xffff800020ac2eb8 (329452) exclusive kernel_lock &kernel_lock r = 1 (0xffffffff82641eb8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x392 sys/kern/sched_bsd.c:435 #3 sleep_finish+0x113 sys/kern/kern_synch.c:415 #4 sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:444 [inline] #4 sleep_finish_all+0x32 sys/kern/kern_synch.c:206 #5 tsleep+0x1cc sys/kern/kern_synch.c:155 #6 biowait+0xa6 sys/kern/vfs_bio.c:1255 #7 bwrite+0x1e4 sys/kern/vfs_bio.c:765 #8 ffs_update+0x2c2 sys/ufs/ffs/ffs_inode.c:113 #9 ffs_truncate+0x285 #10 ufs_setattr+0x6b0 sys/ufs/ufs/ufs_vnops.c:408 #11 VOP_SETATTR+0xc6 sys/kern/vfs_vops.c:229 #12 sys_ftruncate+0x1e0 sys/kern/vfs_syscalls.c:2856 #13 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #13 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #14 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9558 6448K 7389K 78643K 11815 0 pcb 13 8K 8K 78643K 147 0 rtable 90 11K 12K 78643K 431 0 ifaddr 108 20K 20K 78643K 172 0 counters 43 33K 34K 78643K 63 0 ioctlops 0 0K 4K 78643K 1503 0 iov 0 0K 16K 78643K 485 0 mount 1 1K 1K 78643K 1 0 vnodes 1222 77K 77K 78643K 1636 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 8 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 186 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 196K 290K 78643K 12766 0 file desc 6 17K 25K 78643K 587 0 sigio 0 0K 0K 78643K 24 0 proc 63 63K 95K 78643K 586 0 subproc 32 2K 2K 78643K 68 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 80 0 in_multi 84 3K 3K 78643K 208 0 ether_multi 1 0K 0K 78643K 29 0 mrt 0 0K 0K 78643K 11 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 67 307K 307K 78643K 67 0 exec 0 0K 1K 78643K 315 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 129 55K 79K 78643K 3034 0 UVM aobj 30 2K 2K 78643K 40 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 127 0 NDP 17 0K 0K 78643K 38 0 temp 153 3027K 3095K 78643K 11431 0 kqueue 3 4K 24K 78643K 124 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 12 0 5 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 93 0 91 1 0 1 1 0 8 0 rtentry 112 87 0 55 2 1 1 2 0 8 0 unpcb 120 360 0 350 1 0 1 1 0 8 0 syncache 264 9 0 9 3 3 0 1 0 8 0 tcpqe 32 280 0 280 3 3 0 1 0 8 0 tcpcb 544 438 0 434 1 0 1 1 0 8 0 inpcb 280 1500 0 1493 2 0 2 2 0 8 1 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 18 0 16 1 0 1 1 0 8 0 pkpcb 40 3 0 2 2 1 1 1 0 8 0 ppxss 1128 5 0 5 2 1 1 1 0 8 1 pffrag 232 6 0 6 4 4 0 1 0 482 0 pffrnode 88 6 0 6 4 4 0 1 0 8 0 pffrent 40 270 0 270 4 4 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 83 0 22 1 0 1 1 0 8 0 pfstkey 112 83 0 22 2 0 2 2 0 8 0 pfstate 328 83 0 22 6 0 6 6 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 409 0 281 13 4 9 13 0 8 0 art_table 32 410 0 281 3 1 2 2 0 8 0 art_node 16 86 0 58 1 0 1 1 0 8 0 sysvmsgpl 40 34 0 9 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 184 0 174 1 0 1 1 0 8 0 shmpl 112 38 0 10 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2329 0 927 46 0 46 46 0 8 0 ffsino 272 2329 0 927 94 0 94 94 0 8 0 nchpl 144 3461 0 1854 61 0 61 61 0 8 0 uvmvnodes 72 2683 0 0 49 0 49 49 0 8 0 vnodes 208 2683 0 0 142 0 142 142 0 8 0 namei 1024 10263 0 10263 1 0 1 1 0 8 1 percpumem 16 42 0 10 1 0 1 1 0 8 0 vcpupl 1984 4 0 0 1 0 1 1 0 8 0 vmpool 560 6 0 2 1 0 1 1 0 8 0 scsiplug 64 4 0 4 2 2 0 1 0 8 0 scxspl 192 10988 0 10988 12 9 3 7 0 8 3 plimitpl 152 82 0 74 1 0 1 1 0 8 0 sigapl 424 797 0 764 4 0 4 4 0 8 0 futexpl 56 11821 0 11820 1 0 1 1 0 8 0 knotepl 112 371 0 352 5 2 3 3 0 8 2 kqueuepl 144 222 0 220 1 0 1 1 0 8 0 pipelkpl 48 218 0 206 1 0 1 1 0 8 0 pipepl 120 436 0 415 1 0 1 1 0 8 0 fdescpl 496 781 0 764 3 0 3 3 0 8 0 filepl 152 6297 0 6193 6 0 6 6 0 8 1 lockfpl 104 808 0 807 1 0 1 1 0 8 0 lockfspl 48 191 0 190 1 0 1 1 0 8 0 sessionpl 112 20 0 9 1 0 1 1 0 8 0 pgrppl 48 26 0 15 1 0 1 1 0 8 0 ucredpl 96 603 0 594 1 0 1 1 0 8 0 zombiepl 144 765 0 764 1 0 1 1 0 8 0 processpl 960 797 0 764 5 0 5 5 0 8 0 procpl 624 2132 0 2086 4 0 4 4 0 8 0 sosppl 128 30 0 30 3 2 1 1 0 8 1 sockpl 400 1971 0 1951 8 3 5 6 0 8 3 mcl64k 65536 10 0 0 2 0 2 2 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 7 0 0 1 0 1 1 0 8 0 mcl9k 9216 6 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 9 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 287 0 0 35 0 35 35 0 8 0 mtagpl 80 35 0 0 1 0 1 1 0 8 0 mbufpl 256 312 0 0 19 0 19 19 0 8 0 bufpl 280 6070 0 176 421 0 421 421 0 8 0 anonpl 16 97025 0 79622 87 12 75 78 0 124 3 amapchunkpl 152 6779 0 6630 28 18 10 20 0 158 3 amappl16 192 3943 0 2991 63 12 51 55 0 8 2 amappl15 184 276 0 275 1 0 1 1 0 8 0 amappl14 176 128 0 122 2 1 1 1 0 8 0 amappl13 168 42 0 40 1 0 1 1 0 8 0 amappl12 160 142 0 142 2 2 0 1 0 8 0 amappl11 152 85 0 67 1 0 1 1 0 8 0 amappl10 144 17 0 11 1 0 1 1 0 8 0 amappl9 136 527 0 522 1 0 1 1 0 8 0 amappl8 128 501 0 472 1 0 1 1 0 8 0 amappl7 120 132 0 118 1 0 1 1 0 8 0 amappl6 112 25 0 20 1 0 1 1 0 8 0 amappl5 104 705 0 687 1 0 1 1 0 8 0 amappl4 96 650 0 617 2 1 1 2 0 8 0 amappl3 88 240 0 232 1 0 1 1 0 8 0 amappl2 80 5346 0 5266 3 0 3 3 0 8 0 amappl1 72 27220 0 26748 27 17 10 21 0 8 0 amappl 80 2442 0 2389 2 0 2 2 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 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 39 0 10 1 0 1 1 0 8 0 uaddrrnd 24 787 0 766 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 787 0 766 1 0 1 1 0 8 0 vmmpekpl 168 9936 0 9897 3 0 3 3 0 8 0 vmmpepl 168 104051 0 101805 147 33 114 127 0 357 15 vmsppl 368 786 0 766 2 0 2 2 0 8 0 pdppl 4096 1581 0 1536 6 0 6 6 0 8 0 pvpl 32 296326 0 274949 205 21 184 187 0 265 11 pmappl 232 786 0 766 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 197 0 10 6 0 6 6 0 8 0