panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *188382 28098 0 0 0x4000000 0K syz-executor 285521 81338 0 0x2 0 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8302e260) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371d8bd8,ffff8000371d8bd8,54cd1d14e97ba5a1) at ufs_dirbadentry VOP_LOOKUP(fffffd80696d0528,ffff8000371d8e58,ffff8000371d8e88) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371d8e28) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371d8e28) at namei+0x7aa sys/kern/vfs_lookup.c:250 dorenameat(ffff8000371c6f58,ffffff9c,20001640,ffffff9c,200002c0) at dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 syscall(ffff8000371d9020) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371d9020) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdd446a78480, 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 *cpu0: bad dir ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8302e260) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371d8bd8,ffff8000371d8bd8,54cd1d14e97ba5a1) at ufs_dirbadentry VOP_LOOKUP(fffffd80696d0528,ffff8000371d8e58,ffff8000371d8e88) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371d8e28) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371d8e28) at namei+0x7aa sys/kern/vfs_lookup.c:250 dorenameat(ffff8000371c6f58,ffffff9c,20001640,ffffff9c,200002c0) at dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 syscall(ffff8000371d9020) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371d9020) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdd446a78480, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000371d8a00 rbx 0xffffffff83505dbf cpu_info_full_primary+0x2dbf rdx 0xffff8000012a7740 rcx 0xffff8000371c6f58 rax 0xffffffff83504ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x78c30275328d0351 r11 0x86168f4001b8d99a r12 0xffffffff83505bc0 cpu_info_full_primary+0x2bc0 r13 0 r14 0 r15 0x1 rip 0xffffffff823851f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000371d89f0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=188382 pid=28098 tcnt=2 stat=onproc flags process=0 proc=4000000 runpri=17, usrpri=50, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000371c6538,0xffff8000371c67d0 process=0xffff8000371a3b08 user=0xffff8000371d4000, vmspace=0xfffffd8069149e28 estcpu=36, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 71343 157424 24466 0 2 0 syz-executor 71343 71682 24466 0 3 0x4000080 fsleep syz-executor 71343 192097 24466 0 3 0x4000080 lockf syz-executor 8017 490462 37536 0 2 0 syz-executor 77690 98429 68809 0 2 0 syz-executor 77690 95347 68809 0 2 0x4000080 syz-executor 13587 326041 89390 0 2 0 syz-executor 13587 193166 89390 0 3 0x4000080 fsleep syz-executor 28098 176670 83388 0 2 0 syz-executor *28098 188382 83388 0 7 0x4000000 syz-executor 95399 436935 81338 0 2 0 syz-executor 95399 453137 81338 0 2 0x4000000 syz-executor 95399 197777 81338 0 3 0x4000080 fsleep syz-executor 37536 242021 78407 0 2 0x482 syz-executor 83388 458795 78407 0 3 0x82 nanoslp syz-executor 89390 208940 78407 0 2 0x482 syz-executor 68809 113585 78407 0 3 0x82 nanoslp syz-executor 24466 253533 78407 0 3 0x82 nanoslp syz-executor 81338 285521 78407 0 7 0x2 syz-executor 20793 313811 78407 0 2 0x82 syz-executor 78407 425539 9882 0 3 0x82 wait syz-executor 9882 269694 14456 0 3 0x10008a sigsusp ksh 14456 219233 577 0 3 0x98 kqread sshd-session 577 88870 70405 0 3 0x92 kqread sshd-session 53547 246789 1 0 3 0x100083 ttyin getty 70405 446448 1 0 3 0x88 kqread sshd 64889 291342 46052 74 3 0x1100092 bpf pflogd 46052 336848 1 0 3 0x80 sbwait pflogd 82348 308498 15971 73 3 0x1100090 kqread syslogd 15971 222592 1 0 3 0x100082 sbwait syslogd 15700 514538 1 0 3 0x100080 kqread resolvd 66216 306646 84241 77 3 0x100092 kqread dhcpleased 83862 152495 84241 77 3 0x100092 kqread dhcpleased 84241 12391 1 0 3 0x80 kqread dhcpleased 51933 16437 0 0 3 0x14200 bored smr 51639 70096 0 0 2 0x14200 zerothread 89668 203613 0 0 3 0x14200 aiodoned aiodoned 71097 439313 0 0 3 0x14200 syncer update 10935 127375 0 0 3 0x14200 cleaner cleaner 95585 209175 0 0 3 0x14200 reaper reaper 42447 265745 0 0 3 0x14200 pgdaemon pagedaemon 13521 432515 0 0 3 0x14200 bored viomb 64120 501561 0 0 3 0x40014200 acpi0 acpi0 67167 316138 0 0 3 0x40014200 idle1 58747 338684 0 0 3 0x14200 bored softnet3 75851 473424 0 0 3 0x14200 bored softnet2 49209 303090 0 0 3 0x14200 bored softnet1 41539 365416 0 0 3 0x14200 bored softnet0 30250 378512 0 0 3 0x14200 bored systqmp 34023 304035 0 0 3 0x14200 bored systq 47099 98134 0 0 3 0x14200 tmoslp softclockmp 92185 496122 0 0 2 0x40014200 softclock 14098 76844 0 0 3 0x40014200 idle0 1 102958 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 28098 (syz-executor) thread 0xffff8000371c6f58 (188382) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8358f6c8) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 __mp_acquire_count+0x58 #2 mi_switch+0x4b7 sys/kern/sched_bsd.c:441 #3 sleep_finish+0x2f2 sys/kern/kern_synch.c:425 #4 biowait+0xc1 sys/kern/vfs_bio.c:1246 #5 ffs_bufatoff+0x16f sys/ufs/ffs/ffs_subr.c:71 #6 ufsdirhash_lookup+0x68c sys/ufs/ufs/ufs_dirhash.c:403 #7 ufs_lookup+0xf58 sys/ufs/ufs/ufs_lookup.c:214 #8 VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 #9 vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 #10 namei+0x7aa sys/kern/vfs_lookup.c:250 #11 dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 #12 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] #12 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #13 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd8074ae55f0) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 rw_enter+0x41b sys/kern/kern_rwlock.c:309 #2 rrw_enter+0xbe sys/kern/kern_rwlock.c:464 #3 VOP_LOCK+0xa6 sys/kern/vfs_vops.c:524 #4 vn_lock+0xa4 sys/kern/vfs_vnops.c:564 #5 vfs_lookup+0x109 sys/kern/vfs_lookup.c:418 #6 namei+0x7aa sys/kern/vfs_lookup.c:250 #7 dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 #8 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] #8 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #9 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10185 11177K 11182K 166960K 11274 0 pcb 17 12K 12K 166960K 26 0 rtable 236 6K 6K 166960K 350 0 pf 34 17K 18K 166960K 45 0 ifaddr 43 7K 7K 166960K 45 0 ifgroup 55 2K 2K 166960K 55 0 counters 64 36K 36K 166960K 64 0 ioctlops 0 0K 4K 166960K 1485 0 iov 0 0K 0K 166960K 1 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1372 86K 86K 166960K 1406 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 1K 166960K 2 0 VM map 2 1K 1K 166960K 2 0 sem 3 0K 0K 166960K 5 0 dirhash 15 2K 2K 166960K 15 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 16 57K 93K 166960K 162 0 proc 71 91K 128K 166960K 533 0 subproc 104 6K 6K 166960K 104 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 1 0K 0K 166960K 3 0 in_multi 99 7K 7K 166960K 99 0 ether_multi 1 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 31 148K 148K 166960K 31 0 exec 0 0K 1K 166960K 360 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 215 72K 77K 166960K 3012 0 UVM aobj 3 2K 2K 166960K 3 0 pinsyscall 41 82K 104K 166960K 1231 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 2 0 NDP 28 2K 2K 166960K 28 0 temp 34 6814K 6878K 166960K 4394 0 kqueue 14 22K 22K 166960K 24 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 24 0 0 1 0 1 1 0 8 0 rtpcb 120 33 0 30 1 0 1 1 0 8 0 rtentry 112 112 0 1 4 0 4 4 0 8 0 unpcb 144 48 0 31 1 0 1 1 0 8 0 syncache 336 3 0 3 2 1 1 1 0 8 1 tcpcb 808 15 0 11 1 0 1 1 0 8 0 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 87 0 79 2 0 2 2 0 8 1 nd6 136 25 0 0 1 0 1 1 0 8 0 kcovpl 48 8 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 18 0 0 1 0 1 1 0 8 0 pfstkey 128 18 0 0 1 0 1 1 0 8 0 pfstate 376 18 0 0 2 0 2 2 0 8 0 pfrule 1344 21 0 15 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 455 0 0 29 0 29 29 0 8 0 art_table 32 456 0 0 4 0 4 4 0 8 0 art_node 16 111 0 10 1 0 1 1 0 8 0 semapl 112 2 0 1 1 0 1 1 0 8 0 dirhash 1024 19 0 0 3 0 3 3 0 8 0 dino2pl 256 1606 0 88 96 0 96 96 0 8 0 ffsino 272 1606 0 88 102 0 102 102 0 8 0 nchpl 144 1819 0 132 63 0 63 63 0 8 0 uvmvnodes 80 1734 0 0 36 0 36 36 0 8 0 vnodes 216 1734 0 0 97 0 97 97 0 8 0 namei 1024 5555 0 5554 2 0 2 2 0 8 1 percpumem 16 46 0 0 1 0 1 1 0 8 0 kstatmem 264 24 0 0 2 0 2 2 0 8 0 scxspl 216 5288 0 5287 3 1 2 2 1 8 1 plimitpl 152 27 0 10 1 0 1 1 0 8 0 sigapl 424 460 0 411 7 0 7 7 0 8 1 futexpl 64 425 0 422 1 0 1 1 0 8 0 knotepl 120 57 0 0 2 0 2 2 0 8 0 kqueuepl 216 21 0 11 1 0 1 1 0 8 0 pipepl 320 109 0 80 3 0 3 3 0 8 0 fdescpl 496 442 0 412 5 0 5 5 0 8 0 filepl 152 1560 0 1304 11 0 11 11 0 8 0 lockfpl 104 23 0 15 1 0 1 1 0 8 0 lockfspl 48 12 0 6 1 0 1 1 0 8 0 sessionpl 144 22 0 13 1 0 1 1 0 8 0 pgrppl 48 31 0 14 1 0 1 1 0 8 0 ucredpl 104 69 0 56 1 0 1 1 0 8 0 zombiepl 144 413 0 411 1 0 1 1 0 8 0 processpl 1160 460 0 411 5 0 5 5 0 8 1 procpl 648 520 0 464 6 0 6 6 0 8 1 srpgc 96 2 0 2 1 0 1 1 0 8 1 sockpl 664 169 0 141 3 0 3 3 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 151 0 0 19 0 19 19 0 8 0 mcl2k 2048 18 0 0 3 0 3 3 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 149 0 0 10 0 10 10 0 8 0 bufpl 280 2253 0 96 155 0 155 155 0 8 0 anonpl 24 152300 0 149083 25 0 25 25 0 185 3 amapchunkpl 152 9879 0 9457 20 0 20 20 0 158 2 amappl16 200 4262 0 4248 5 0 5 5 0 8 4 amappl15 192 8 0 8 1 0 1 1 0 8 1 amappl14 184 118 0 105 1 0 1 1 0 8 0 amappl13 176 26 0 26 1 0 1 1 0 8 1 amappl12 168 1115 0 1086 3 1 2 2 0 8 0 amappl11 160 56 0 42 1 0 1 1 0 8 0 amappl10 152 9 0 9 1 0 1 1 0 8 1 amappl9 144 141 0 141 1 0 1 1 0 8 1 amappl8 136 21 0 19 1 0 1 1 0 8 0 amappl7 128 105 0 92 1 0 1 1 0 8 0 amappl6 120 164 0 163 1 0 1 1 0 8 0 amappl5 112 131 0 120 1 0 1 1 0 8 0 amappl4 104 311 0 293 1 0 1 1 0 8 0 amappl3 96 1843 0 1761 3 0 3 3 0 8 0 amappl2 88 707 0 626 3 0 3 3 0 8 0 amappl1 80 7468 0 6911 14 0 14 14 0 8 1 amappl 88 2647 0 2496 4 0 4 4 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 72 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 442 0 412 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 442 0 412 1 0 1 1 0 8 0 vmmpekpl 168 5090 0 5052 2 0 2 2 0 8 0 vmmpepl 168 36277 0 34522 82 0 82 82 0 357 2 vmsppl 448 441 0 412 6 1 5 5 0 8 1 rwobjpl 56 16736 0 14119 38 0 38 38 0 8 0 pdppl 4096 891 0 824 101 16 85 85 0 8 18 pvpl 32 9318 0 0 77 1 76 76 0 265 0 pmappl 248 441 0 412 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 381 0 20 11 0 11 11 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8302e260) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371d8bd8,ffff8000371d8bd8,54cd1d14e97ba5a1) at ufs_dirbadentry VOP_LOOKUP(fffffd80696d0528,ffff8000371d8e58,ffff8000371d8e88) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371d8e28) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371d8e28) at namei+0x7aa sys/kern/vfs_lookup.c:250 dorenameat(ffff8000371c6f58,ffffff9c,20001640,ffffff9c,200002c0) at dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 syscall(ffff8000371d9020) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371d9020) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdd446a78480, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff800029b7bff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x38 sys/dev/kcov.c:159 __mp_lock(ffffffff8358f4c0) at __mp_lock+0x1a3 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff8358f4c0) at __mp_lock+0x1a3 sys/kern/kern_lock.c:144 syscall(ffff80002a0ba720) at syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0ba720) at syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x745138226350, count: 8 ddb{1}> trace x86_ipi_db(ffff800029b7bff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x38 sys/dev/kcov.c:159 __mp_lock(ffffffff8358f4c0) at __mp_lock+0x1a3 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff8358f4c0) at __mp_lock+0x1a3 sys/kern/kern_lock.c:144 syscall(ffff80002a0ba720) at syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0ba720) at syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x745138226350, count: -7