panic: ufs_rename: lost dir entry Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 250455 84073 32767 0x10 0 0 syz-executor.0 *165687 84073 32767 0x10 0x4000000 1K syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8240f628) at panic+0x15c sys/kern/subr_prf.c:207 ufs_mkdir(ffff80002532e2f8) at ufs_mkdir VOP_RENAME(fffffd8065b4b350,fffffd8065b4b1b0,ffff80002532e508,fffffd8075ae6b78,0,ffff80002532e438) at VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 dorenameat(ffff800020e0a128,10,20000140,e,20000180) at dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 syscall(ffff80002532e6a0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002532e6a0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x96feb953c60, 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(ffffffff8240f628) at panic+0x15c sys/kern/subr_prf.c:207 ufs_mkdir(ffff80002532e2f8) at ufs_mkdir VOP_RENAME(fffffd8065b4b350,fffffd8065b4b1b0,ffff80002532e508,fffffd8075ae6b78,0,ffff80002532e438) at VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 dorenameat(ffff800020e0a128,10,20000140,e,20000180) at dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 syscall(ffff80002532e6a0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002532e6a0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x96feb953c60, count: -7 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff80002532e070 rbx 0xffff80002532e120 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81afac6f kprintf+0x16f r9 0x1 r10 0x2 r11 0x472c92423c1201a r12 0x3000000008 r13 0xffff80002532e080 r14 0x100 r15 0x1 rip 0xffffffff822fe6a8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002532e060 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=165687 stat=onproc flags process=10 proc=4000000 pri=17, usrpri=73, nice=20 forw=0xffffffffffffffff, list=0xffff800020e09288,0xffffffff82918610 process=0xffff8000ffffd380 user=0xffff800025329000, vmspace=0xfffffd807efffa10 estcpu=23, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 84073 250455 23200 32767 7 0x10 syz-executor.0 84073 417976 23200 32767 3 0x4000090 netcon2 syz-executor.0 84073 369205 23200 32767 3 0x4000090 netcon2 syz-executor.0 84073 151066 23200 32767 3 0x4000090 fsleep syz-executor.0 84073 384568 23200 32767 3 0x4000090 fsleep syz-executor.0 84073 489477 23200 32767 3 0x4000090 fsleep syz-executor.0 *84073 165687 23200 32767 7 0x4000010 syz-executor.0 73935 286042 9274 32767 3 0x90 piperd syz-executor.1 9274 510596 69013 0 3 0x82 wait syz-executor.1 23200 346450 21153 32767 3 0x90 nanosleep syz-executor.0 21153 438846 69013 0 3 0x82 wait syz-executor.0 41707 72000 0 0 3 0x14200 bored sosplice 69013 254344 3038 0 3 0x82 thrsleep syz-fuzzer 69013 449681 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 311508 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 385261 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 261301 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 160705 3038 0 3 0x4000082 kqread syz-fuzzer 69013 210742 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 415053 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 15762 3038 0 3 0x4000082 thrsleep syz-fuzzer 69013 230654 3038 0 3 0x4000082 thrsleep syz-fuzzer 3038 172030 57690 0 3 0x10008a pause ksh 57690 412833 40371 0 3 0x92 select sshd 28775 377491 1 0 3 0x100083 ttyin getty 40371 324462 1 0 3 0x80 select sshd 8928 11267 12400 73 3 0x100090 kqread syslogd 12400 237076 1 0 3 0x100082 netio syslogd 83969 29558 1 77 3 0x100090 poll dhclient 51003 331011 1 0 3 0x80 poll dhclient 56183 102032 0 0 3 0x14200 bored smr 49179 71319 0 0 3 0x14200 pgzero zerothread 23080 284632 0 0 3 0x14200 aiodoned aiodoned 50237 102692 0 0 3 0x14200 syncer update 23260 2595 0 0 3 0x14200 cleaner cleaner 39878 159571 0 0 3 0x14200 reaper reaper 45034 476886 0 0 3 0x14200 pgdaemon pagedaemon 39635 79359 0 0 3 0x14200 bored crynlk 99432 62179 0 0 3 0x14200 bored crypto 49962 222026 0 0 3 0x40014200 acpi0 acpi0 1171 48490 0 0 3 0x40014200 idle1 86514 59317 0 0 3 0x14200 bored softnet 63620 282905 0 0 3 0x14200 bored systqmp 6829 333351 0 0 3 0x14200 bored systq 1869 343305 0 0 3 0x40014200 bored softclock 25908 478179 0 0 3 0x40014200 idle0 1 469443 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 84073 (syz-executor.0) thread 0xffff800020e0a128 (165687) exclusive rrwlock inode r = 0 (0xfffffd806bc32a38) #0 witness_lock+0x4c7 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4c7 sys/kern/subr_witness.c:1164 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:311 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:462 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:603 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:575 #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:1329 #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:1055 #12 VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 #13 dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 #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 (0xfffffd8065797c58) #0 witness_lock+0x4c7 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4c7 sys/kern/subr_witness.c:1164 #1 rw_enter+0x453 sys/kern/kern_rwlock.c:311 #2 rrw_enter+0x88 sys/kern/kern_rwlock.c:462 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:603 #4 vn_lock+0x81 sys/kern/vfs_vnops.c:575 #5 vfs_relookup+0x53 sys/kern/vfs_lookup.c:780 #6 ufs_rename+0x1463 sys/ufs/ufs/ufs_vnops.c:1055 #7 VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 #8 dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 #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 (0xffffffff829173e0) #0 witness_lock+0x4c7 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4c7 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:418 #4 sleep_finish_all+0x32 sleep_finish_timeout sys/kern/kern_synch.c:447 [inline] #4 sleep_finish_all+0x32 sys/kern/kern_synch.c:393 #5 tsleep+0x1cc sys/kern/kern_synch.c:155 #6 biowait+0xa6 sys/kern/vfs_bio.c:1256 #7 bwrite+0x1e4 sys/kern/vfs_bio.c:765 #8 VOP_BWRITE+0x4a sys/kern/vfs_vops.c:724 #9 ufs_direnter+0x8e3 sys/ufs/ufs/ufs_lookup.c:909 #10 ufs_rename+0xbfe sys/ufs/ufs/ufs_vnops.c:949 #11 VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 #12 dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 #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 9471 6333K 6333K 78643K 10748 0 pcb 13 8K 8K 78643K 13 0 rtable 107 3K 3K 78643K 2098 0 ifaddr 39 10K 10K 78643K 372 0 sysctl 3 1K 1K 78643K 3 0 counters 43 33K 33K 78643K 135 0 ioctlops 0 0K 2K 78643K 85 0 iov 0 0K 16K 78643K 170 0 mount 1 1K 1K 78643K 1 0 vnodes 1217 77K 77K 78643K 2133 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 27 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 743 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1824 197K 290K 78643K 13058 0 file desc 7 21K 33K 78643K 2365 0 sigio 0 0K 0K 78643K 17 0 proc 48 50K 71K 78643K 2459 0 subproc 34 2K 2K 78643K 816 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 197 0 in_multi 33 2K 2K 78643K 565 0 ether_multi 1 0K 0K 78643K 8 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 55 254K 254K 78643K 55 0 exec 0 0K 1K 78643K 964 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 132 23K 39K 78643K 8998 0 UVM aobj 92 7K 8K 78643K 117 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 97 0 NDP 5 0K 0K 78643K 147 0 temp 102 3869K 3949K 78643K 12492 0 kqueue 3 4K 22K 78643K 138 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 101 0 95 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 80 217 0 215 1 0 1 1 0 8 0 rtentry 112 564 0 519 2 0 2 2 0 8 0 unpcb 120 1157 0 1148 1 0 1 1 0 8 0 syncache 264 39 0 39 15 15 0 1 0 8 0 tcpqe 32 28 0 28 4 4 0 1 0 8 0 tcpcb 544 705 0 699 3 2 1 2 0 8 0 ipq 40 4 0 4 3 3 0 1 0 8 0 ipqe 40 8 0 8 3 3 0 1 0 8 0 inpcb 296 1591 0 1582 16 15 1 3 0 8 0 rttmr 72 2 0 2 1 1 0 1 0 8 0 ip6q 72 3 0 3 2 2 0 1 0 8 0 ip6af 40 6 0 6 1 1 0 1 0 8 0 nd6 48 153 0 146 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 2398 0 2206 21 9 12 15 0 8 0 art_table 32 2399 0 2206 2 0 2 2 0 8 0 art_node 16 563 0 522 1 0 1 1 0 8 0 sysvmsgpl 40 19 0 7 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 738 0 728 1 0 1 1 0 8 0 shmpl 112 114 0 25 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 4080 0 2661 90 1 89 89 0 8 0 ffsino 272 4080 0 2661 96 1 95 95 0 8 0 nchpl 144 9423 0 7829 60 0 60 60 0 8 0 uvmvnodes 72 4905 0 0 90 0 90 90 0 8 0 vnodes 208 4905 0 0 259 0 259 259 0 8 0 namei 1024 34567 0 34565 4 3 1 1 0 8 0 percpumem 16 78 0 46 1 0 1 1 0 8 0 scxspl 192 25438 0 25438 19 18 1 7 0 8 1 plimitpl 152 319 0 310 1 0 1 1 0 8 0 sigapl 424 2415 0 2383 4 0 4 4 0 8 0 futexpl 56 27349 0 27346 4 3 1 1 0 8 0 knotepl 112 845 0 826 2 1 1 2 0 8 0 kqueuepl 144 364 0 361 1 0 1 1 0 8 0 pipepl 304 548 0 538 11 9 2 2 0 8 0 fdescpl 496 2399 0 2383 6 3 3 3 0 8 0 filepl 152 17136 0 17025 8 3 5 6 0 8 0 lockfpl 104 346 0 343 1 0 1 1 0 8 0 lockfspl 48 122 0 120 1 0 1 1 0 8 0 sessionpl 112 63 0 53 1 0 1 1 0 8 0 pgrppl 48 94 0 84 1 0 1 1 0 8 0 ucredpl 96 2112 0 2103 1 0 1 1 0 8 0 zombiepl 144 2383 0 2383 1 0 1 1 0 8 1 processpl 992 2415 0 2383 5 0 5 5 0 8 0 procpl 624 6310 0 6263 4 0 4 4 0 8 0 sosppl 128 58 0 56 16 15 1 1 0 8 0 sockpl 400 2999 0 2979 13 10 3 5 0 8 0 mcl64k 65536 9 0 0 2 0 2 2 0 8 0 mcl16k 16384 10 0 0 2 0 2 2 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 8 0 0 1 0 1 1 0 8 0 mcl8k 8192 7 0 0 1 0 1 1 0 8 0 mcl4k 4096 12 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 183 0 0 21 1 20 21 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 346 0 0 13 0 13 13 0 8 0 bufpl 280 9022 0 2788 446 0 446 446 0 8 0 anonpl 16 297378 0 286826 88 42 46 60 0 124 0 amapchunkpl 152 22368 0 22232 95 89 6 19 0 158 0 amappl16 192 10954 0 10376 90 60 30 42 0 8 0 amappl15 184 214 0 213 1 0 1 1 0 8 0 amappl14 176 421 0 415 1 0 1 1 0 8 0 amappl13 168 540 0 533 1 0 1 1 0 8 0 amappl12 160 285 0 281 1 0 1 1 0 8 0 amappl11 152 574 0 565 1 0 1 1 0 8 0 amappl10 144 273 0 262 1 0 1 1 0 8 0 amappl9 136 708 0 707 1 0 1 1 0 8 0 amappl8 128 1399 0 1351 2 0 2 2 0 8 0 amappl7 120 604 0 588 1 0 1 1 0 8 0 amappl6 112 295 0 289 2 1 1 1 0 8 0 amappl5 104 2035 0 2024 1 0 1 1 0 8 0 amappl4 96 1426 0 1398 1 0 1 1 0 8 0 amappl3 88 444 0 437 1 0 1 1 0 8 0 amappl2 80 15006 0 14940 2 0 2 2 0 8 0 amappl1 72 72970 0 72541 21 11 10 17 0 8 0 amappl 80 7234 0 7187 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 116 0 25 2 0 2 2 0 8 0 uaddrrnd 24 2399 0 2383 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2399 0 2383 1 0 1 1 0 8 0 vmmpekpl 168 22976 0 22946 2 0 2 2 0 8 0 vmmpepl 168 326856 0 325040 180 90 90 99 0 357 4 vmsppl 368 2398 0 2383 2 0 2 2 0 8 0 pdppl 4096 4805 0 4766 9 3 6 6 0 8 0 pvpl 32 819421 0 805623 226 112 114 150 0 265 0 pmappl 232 2398 0 2383 6 5 1 2 0 8 0 extentpl 40 53 0 36 1 0 1 1 0 8 0 phpool 112 289 0 32 8 0 8 8 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffffffff82735ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xc6 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 end of kernel end trace frame: 0x7f7ffffc8540, count: 12 ddb{0}> trace x86_ipi_db(ffffffff82735ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xc6 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 end of kernel end trace frame: 0x7f7ffffc8540, count: -3 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8240f628) at panic+0x15c sys/kern/subr_prf.c:207 ufs_mkdir(ffff80002532e2f8) at ufs_mkdir VOP_RENAME(fffffd8065b4b350,fffffd8065b4b1b0,ffff80002532e508,fffffd8075ae6b78,0,ffff80002532e438) at VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 dorenameat(ffff800020e0a128,10,20000140,e,20000180) at dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 syscall(ffff80002532e6a0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002532e6a0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x96feb953c60, count: 8 ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8240f628) at panic+0x15c sys/kern/subr_prf.c:207 ufs_mkdir(ffff80002532e2f8) at ufs_mkdir VOP_RENAME(fffffd8065b4b350,fffffd8065b4b1b0,ffff80002532e508,fffffd8075ae6b78,0,ffff80002532e438) at VOP_RENAME+0x106 sys/kern/vfs_vops.c:427 dorenameat(ffff800020e0a128,10,20000140,e,20000180) at dorenameat+0x2a3 sys/kern/vfs_syscalls.c:2972 syscall(ffff80002532e6a0) at syscall+0x4a4 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002532e6a0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:570 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x96feb953c60, count: -7