panic: ufs_rename: lost dir entry Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 70628 83048 32767 0x10 0 0 syz-executor.1 *336178 83048 32767 0x10 0x4000000 1K syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff821db594) at panic+0x15c sys/kern/subr_prf.c:207 ufs_mkdir(ffff800024f99008) at ufs_mkdir VOP_RENAME(fffffd8075ceb348,fffffd807cde3018,ffff800024f99218,fffffd80680dbea0,0,ffff800024f99148) at VOP_RENAME+0x106 sys/kern/vfs_vops.c:426 dorenameat(ffff800020a9dae8,2b,20000140,29,20000180) at dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2979 syscall(ffff800024f993b0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800024f993b0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x25b0aa53270, count: 8 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 ufs_rename: lost dir entry ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff821db594) at panic+0x15c sys/kern/subr_prf.c:207 ufs_mkdir(ffff800024f99008) at ufs_mkdir VOP_RENAME(fffffd8075ceb348,fffffd807cde3018,ffff800024f99218,fffffd80680dbea0,0,ffff800024f99148) at VOP_RENAME+0x106 sys/kern/vfs_vops.c:426 dorenameat(ffff800020a9dae8,2b,20000140,29,20000180) at dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2979 syscall(ffff800024f993b0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800024f993b0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x25b0aa53270, count: -7 ddb{1}> show registers rdi 0xffffffff816f8f37 db_enter+0x17 rsi 0x3075 __ALIGN_SIZE+0x2075 rbp 0xffff800024f98d80 rbx 0xffff800024f98e30 rdx 0x3076 __ALIGN_SIZE+0x2076 rcx 0xffff800021152000 rax 0xffff800021152000 r8 0xffffffff81102b0f kprintf+0x16f r9 0x1 r10 0x25 r11 0xedefe92dcb9fd481 r12 0x3000000008 r13 0xffff800024f98d90 r14 0x100 r15 0x1 rip 0xffffffff816f8f38 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800024f98d70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=336178 stat=onproc flags process=10 proc=4000000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020a9c768,0xffff800020a9cc58 process=0xffff800020ad6b60 user=0xffff800024f94000, vmspace=0xfffffd806ea1c008 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 13207 423446 14513 32767 3 0x90 nanosleep syz-executor.0 13207 261160 14513 32767 3 0x4000090 netcon2 syz-executor.0 13207 110916 14513 32767 3 0x4000090 fsleep syz-executor.0 83048 70628 95030 32767 7 0x10 syz-executor.1 83048 37388 95030 32767 3 0x4000090 fsleep syz-executor.1 83048 484177 95030 32767 3 0x4000090 fsleep syz-executor.1 83048 63869 95030 32767 3 0x4000090 fsleep syz-executor.1 *83048 336178 95030 32767 7 0x4000010 syz-executor.1 83048 524083 95030 32767 3 0x4000090 fsleep syz-executor.1 83048 378016 95030 32767 3 0x4000090 fsleep syz-executor.1 95030 20933 61074 32767 3 0x90 nanosleep syz-executor.1 61074 479081 40183 0 3 0x82 wait syz-executor.1 14513 522029 20209 32767 3 0x90 nanosleep syz-executor.0 20209 404134 40183 0 3 0x82 wait syz-executor.0 23951 383991 0 0 3 0x14200 bored sosplice 40183 122813 75388 0 3 0x82 thrsleep syz-fuzzer 40183 420447 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 271174 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 415936 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 392000 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 20035 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 484804 75388 0 3 0x4000082 kqread syz-fuzzer 40183 520070 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 112335 75388 0 3 0x4000082 thrsleep syz-fuzzer 40183 309723 75388 0 3 0x4000082 thrsleep syz-fuzzer 75388 201743 23905 0 3 0x10008a pause ksh 23905 208557 70903 0 3 0x92 select sshd 14162 67747 1 0 3 0x100083 ttyin getty 70903 195823 1 0 3 0x80 select sshd 60060 178452 28925 73 3 0x100090 kqread syslogd 28925 296850 1 0 3 0x100082 netio syslogd 62202 341169 1 77 3 0x100090 poll dhclient 48246 389109 1 0 3 0x80 poll dhclient 72313 509836 0 0 3 0x14200 pgzero zerothread 26610 51897 0 0 3 0x14200 aiodoned aiodoned 78116 262621 0 0 3 0x14200 syncer update 39957 293018 0 0 3 0x14200 cleaner cleaner 94942 235847 0 0 3 0x14200 reaper reaper 5137 14214 0 0 3 0x14200 pgdaemon pagedaemon 81064 31616 0 0 3 0x14200 bored crynlk 12809 11294 0 0 3 0x14200 bored crypto 49830 206249 0 0 3 0x40014200 acpi0 acpi0 88448 495341 0 0 3 0x40014200 idle1 32095 431307 0 0 3 0x14200 bored softnet 38523 299839 0 0 3 0x14200 bored systqmp 62346 167258 0 0 3 0x14200 bored systq 6248 258959 0 0 3 0x40014200 bored softclock 59237 404583 0 0 3 0x40014200 idle0 41505 516335 0 0 3 0x14200 bored smr 1 511343 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 83048 (syz-executor.1) thread 0xffff800020a9dae8 (336178) exclusive rrwlock inode r = 0 (0xfffffd8075e482b8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:309 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:453 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:571 #5 vget+0x1c8 sys/kern/vfs_subr.c:671 #6 ufs_ihashget+0x141 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x74 sys/ufs/ffs/ffs_vfsops.c:1323 #8 ufs_lookup+0x14b7 sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #10 vfs_relookup+0xb0 sys/kern/vfs_lookup.c:789 #11 ufs_rename+0x1463 sys/ufs/ufs/ufs_vnops.c:1057 #12 VOP_RENAME+0x106 sys/kern/vfs_vops.c:426 #13 dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2979 #14 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #14 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #15 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd80664e0810) #0 witness_lock+0x52e sys/kern/subr_witness.c:1164 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:309 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:453 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:571 #5 vfs_relookup+0x53 sys/kern/vfs_lookup.c:780 #6 ufs_rename+0x1463 sys/ufs/ufs/ufs_vnops.c:1057 #7 VOP_RENAME+0x106 sys/kern/vfs_vops.c:426 #8 dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2979 #9 syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] #9 syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 #10 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82633b18) #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 VOP_BWRITE+0x4a sys/kern/vfs_vops.c:727 #9 ufs_direnter+0x8e3 sys/ufs/ufs/ufs_lookup.c:909 #10 ufs_rename+0xbfe sys/ufs/ufs/ufs_vnops.c:951 #11 VOP_RENAME+0x106 sys/kern/vfs_vops.c:426 #12 dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2979 #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 9488 6334K 6334K 78643K 11408 0 pcb 13 10K 12K 78643K 15 0 rtable 109 3K 4K 78643K 8286 0 ifaddr 39 13K 15K 78643K 1524 0 counters 43 33K 33K 78643K 457 0 ioctlops 0 0K 2K 78643K 348 0 iov 0 0K 28K 78643K 1514 0 mount 1 1K 1K 78643K 1 0 vnodes 1215 76K 76K 78643K 6168 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 93 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 3859 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1809 196K 290K 78643K 12766 0 file desc 8 25K 33K 78643K 8854 0 sigio 0 0K 0K 78643K 236 0 proc 48 50K 83K 78643K 9807 0 subproc 34 2K 2K 78643K 3553 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 1K 78643K 3102 0 in_multi 33 2K 2K 78643K 2575 0 ether_multi 1 0K 0K 78643K 28 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 169 758K 758K 78643K 169 0 exec 0 0K 1K 78643K 3737 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 209 27K 42K 78643K 34258 0 UVM aobj 130 4K 4K 78643K 139 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 696 0 NDP 7 0K 0K 78643K 630 0 temp 102 3021K 3117K 78643K 48962 0 kqueue 3 4K 30K 78643K 1178 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 433 0 427 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 1553 0 1551 1 0 1 1 0 8 0 rtentry 112 2189 0 2143 2 0 2 2 0 8 0 unpcb 120 11762 0 11747 43 42 1 5 0 8 0 syncache 264 117 0 117 32 31 1 1 0 8 1 sackhl 24 2 0 2 2 2 0 1 0 8 0 tcpqe 32 46 0 46 19 19 0 1 0 8 0 tcpcb 544 8422 0 8417 130 128 2 13 0 8 1 ipq 40 75 0 75 27 26 1 1 0 8 1 ipqe 40 1987 0 1987 27 26 1 1 0 8 1 inpcb 280 16738 0 16728 115 110 5 9 0 8 4 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 2 0 2 1 1 0 1 0 8 0 nd6 48 479 0 473 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 9633 0 9415 23 9 14 15 0 8 0 art_table 32 9634 0 9415 2 0 2 2 0 8 0 art_node 16 2188 0 2146 1 0 1 1 0 8 0 sysvmsgpl 40 69 0 54 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 3857 0 3847 1 0 1 1 0 8 0 shmpl 112 137 0 9 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 13843 0 12408 47 0 47 47 0 8 0 ffsino 272 13843 0 12408 97 0 97 97 0 8 0 nchpl 144 33801 0 32198 61 1 60 61 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 208 5926 0 0 312 0 312 312 0 8 0 namei 1024 152982 0 152980 3 2 1 2 0 8 0 percpumem 16 239 0 207 1 0 1 1 0 8 0 scxspl 192 112837 0 112837 72 69 3 7 0 8 3 plimitpl 152 1534 0 1525 1 0 1 1 0 8 0 sigapl 432 8404 0 8388 14 12 2 3 0 8 0 futexpl 56 203030 0 203024 2 1 1 1 0 8 0 knotepl 112 4349 0 4330 12 10 2 3 0 8 1 kqueuepl 104 5738 0 5736 32 31 1 4 0 8 0 pipelkpl 48 4550 0 4540 1 0 1 1 0 8 0 pipepl 120 9100 0 9081 32 30 2 3 0 8 1 fdescpl 496 8405 0 8388 3 0 3 3 0 8 0 filepl 152 107123 0 106982 157 149 8 15 0 8 2 lockfpl 104 2814 0 2813 1 0 1 1 0 8 0 lockfspl 48 890 0 889 1 0 1 1 0 8 0 sessionpl 112 224 0 214 1 0 1 1 0 8 0 pgrppl 48 420 0 410 1 0 1 1 0 8 0 ucredpl 96 17662 0 17653 1 0 1 1 0 8 0 zombiepl 144 8388 0 8388 1 0 1 1 0 8 1 processpl 960 8421 0 8388 5 0 5 5 0 8 0 procpl 624 23994 0 23944 26 21 5 5 0 8 1 sosppl 128 227 0 226 32 31 1 1 0 8 0 sockpl 400 30450 0 30423 197 188 9 18 0 8 5 mcl64k 65536 59 0 0 4 1 3 3 0 8 0 mcl16k 16384 37 0 0 4 1 3 3 0 8 0 mcl12k 12288 33 0 0 2 0 2 2 0 8 0 mcl9k 9216 32 0 0 2 0 2 2 0 8 0 mcl8k 8192 18 0 0 3 0 3 3 0 8 0 mcl4k 4096 18 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 19 5 14 19 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 963 0 0 24 1 23 24 0 8 0 bufpl 280 32866 0 26576 450 0 450 450 0 8 0 anonpl 16 1294601 0 1281003 252 184 68 81 0 125 0 amapchunkpl 152 85382 0 85234 180 172 8 20 0 158 1 amappl16 192 47112 0 46231 257 201 56 58 0 8 5 amappl15 184 1511 0 1504 1 0 1 1 0 8 0 amappl14 176 2264 0 2261 1 0 1 1 0 8 0 amappl13 168 498 0 498 16 16 0 1 0 8 0 amappl12 160 1197 0 1190 2 1 1 1 0 8 0 amappl11 152 1622 0 1610 1 0 1 1 0 8 0 amappl10 144 949 0 940 12 11 1 1 0 8 0 amappl9 136 4432 0 4429 1 0 1 1 0 8 0 amappl8 128 3346 0 3232 6 2 4 4 0 8 0 amappl7 120 2270 0 2249 1 0 1 1 0 8 0 amappl6 112 1112 0 1093 1 0 1 1 0 8 0 amappl5 104 2753 0 2744 1 0 1 1 0 8 0 amappl4 96 8969 0 8929 7 5 2 2 0 8 0 amappl3 88 1278 0 1271 1 0 1 1 0 8 0 amappl2 80 51251 0 51168 3 1 2 3 0 8 0 amappl1 72 239941 0 239470 53 44 9 20 0 8 0 amappl 80 27826 0 27773 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 138 0 9 3 0 3 3 0 8 0 uaddrrnd 24 8405 0 8388 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 8405 0 8388 1 0 1 1 0 8 0 vmmpekpl 168 88614 0 88582 2 0 2 2 0 8 0 vmmpepl 168 1229848 0 1227475 401 252 149 171 0 357 38 vmsppl 368 8404 0 8388 2 0 2 2 0 8 0 pdppl 4096 16817 0 16776 6 0 6 6 0 8 0 pvpl 32 3315546 0 3298497 584 419 165 196 0 265 5 pmappl 232 8404 0 8388 34 32 2 2 0 8 1 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 547 0 358 6 0 6 6 0 8 0