panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *295266 77368 0 0 0x4000000 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:212 ufs_dirbadentry(ffff800014a2c9b8,ffff800014a2c9b8,43f46ba2517d6410) at ufs_dirbadentry VOP_LOOKUP(fffffd803efda3e8,ffff800014a2cbb8,ffff800014a2cc08) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800014a2cb88) at vfs_lookup+0x55d sys/kern/vfs_lookup.c:523 namei(ffff800014a2cb88) at namei+0x45f sys/kern/vfs_lookup.c:224 dorenameat(ffff8000149c79e0,ffffff9c,20000000,ffffff9c,200000c0) at dorenameat+0x106 sys/kern/vfs_syscalls.c:2772 syscall(ffff800014a2ce70) at syscall+0x511 Xsyscall(6,0,ffffffffffffffc2,0,2,7c5cc9a40d8) at Xsyscall+0x128 end of kernel end trace frame: 0x2dc, 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic bad dir ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:212 ufs_dirbadentry(ffff800014a2c9b8,ffff800014a2c9b8,43f46ba2517d6410) at ufs_dirbadentry VOP_LOOKUP(fffffd803efda3e8,ffff800014a2cbb8,ffff800014a2cc08) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800014a2cb88) at vfs_lookup+0x55d sys/kern/vfs_lookup.c:523 namei(ffff800014a2cb88) at namei+0x45f sys/kern/vfs_lookup.c:224 dorenameat(ffff8000149c79e0,ffffff9c,20000000,ffffff9c,200000c0) at dorenameat+0x106 sys/kern/vfs_syscalls.c:2772 syscall(ffff800014a2ce70) at syscall+0x511 Xsyscall(6,0,ffffffffffffffc2,0,2,7c5cc9a40d8) at Xsyscall+0x128 end of kernel end trace frame: 0x2dc, count: -9 ddb> show registers rdi 0xffffffff81a73677 db_enter+0x17 rsi 0x25d9 __ALIGN_SIZE+0x15d9 rbp 0xffff800014a2c7d0 rbx 0xffff800014a2c880 rdx 0x25da __ALIGN_SIZE+0x15da rcx 0xffff800004b96000 rax 0xffff800004b96000 r8 0xffff800014a2c790 r9 0x1 r10 0xffff800000984880 r11 0x3bd4157d643fdac8 r12 0x3000000008 r13 0xffff800014a2c7e0 r14 0x100 r15 0x1 rip 0xffffffff81a73678 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800014a2c7c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=295266 stat=onproc flags process=0 proc=4000000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff92c8,0xffff8000149c6280 process=0xffff8000ffff6358 user=0xffff800014a27000, vmspace=0xfffffd803f014b58 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 77368 246912 72463 0 2 0x480 syz-executor.0 77368 150953 72463 0 3 0x4000080 fsleep syz-executor.0 *77368 295266 72463 0 7 0x4000000 syz-executor.0 77368 505631 72463 0 3 0x4000000 biowait syz-executor.0 77368 167322 72463 0 3 0x4000000 inode syz-executor.0 77368 238559 72463 0 3 0x4000080 fsleep syz-executor.0 22197 512438 75609 0 2 0x480 syz-executor.1 22197 515915 75609 0 2 0x4000000 syz-executor.1 22197 128792 75609 0 3 0x4000080 fsleep syz-executor.1 72463 496090 50806 0 3 0x82 nanosleep syz-executor.0 20433 315053 0 0 3 0x14200 bored sosplice 75609 426955 50806 0 2 0x482 syz-executor.1 50806 146842 17333 0 3 0x82 thrsleep syz-fuzzer 50806 384459 17333 0 3 0x4000082 thrsleep syz-fuzzer 50806 346207 17333 0 3 0x4000082 kqread syz-fuzzer 50806 16958 17333 0 3 0x4000082 thrsleep syz-fuzzer 50806 193795 17333 0 3 0x4000082 thrsleep syz-fuzzer 50806 277399 17333 0 3 0x4000082 thrsleep syz-fuzzer 50806 137527 17333 0 3 0x4000082 thrsleep syz-fuzzer 17333 72565 94868 0 3 0x10008a pause ksh 94868 391509 25953 0 3 0x92 select sshd 77077 109089 1 0 3 0x100083 ttyin getty 25953 97657 1 0 3 0x80 select sshd 74697 452602 21247 73 2 0x100090 syslogd 21247 427922 1 0 3 0x100082 netio syslogd 72172 35492 1 77 3 0x100090 poll dhclient 22740 260834 1 0 3 0x80 poll dhclient 97612 502260 0 0 3 0x14200 pgzero zerothread 30998 177175 0 0 3 0x14200 aiodoned aiodoned 13292 352645 0 0 3 0x14200 syncer update 13899 150931 0 0 3 0x14200 cleaner cleaner 94650 308029 0 0 3 0x14200 reaper reaper 55818 53202 0 0 3 0x14200 pgdaemon pagedaemon 66804 301502 0 0 3 0x14200 bored crynlk 52036 339340 0 0 3 0x14200 bored crypto 19701 487646 0 0 3 0x40014200 acpi0 acpi0 46017 73506 0 0 3 0x14200 bored softnet 6385 260275 0 0 3 0x14200 bored systqmp 9297 278838 0 0 3 0x14200 bored systq 36518 52649 0 0 3 0x40014200 bored softclock 89199 137880 0 0 3 0x40014200 idle0 75167 501896 0 0 3 0x14200 bored smr 1 107707 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9469 6329K 6716K 78643K 10980 0 0 pcb 25 9K 10K 78643K 193 0 0 rtable 108 3K 4K 78643K 274 0 0 ifaddr 46 11K 11K 78643K 71 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 25 0 0 iov 0 0K 20K 78643K 42 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1197 75K 75K 78643K 1367 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 1K 78643K 2 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 1K 78643K 26 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 6 17K 25K 78643K 238 0 0 sigio 0 0K 0K 78643K 4 0 0 proc 42 30K 62K 78643K 344 0 0 subproc 64 65538K 69634K 78643K 102 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 10 0 0 in_multi 33 2K 2K 78643K 45 0 0 ether_multi 1 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 208 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 85 20K 21K 78643K 1388 0 0 UVM aobj 11 2K 2K 78643K 12 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 24 0 0 NDP 8 0K 0K 78643K 20 0 0 temp 120 2701K 2828K 78643K 6005 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 8 0 2 1 0 1 1 0 8 0 inpcbpl 280 134 0 127 1 0 1 1 0 8 0 plimitpl 152 25 0 18 1 0 1 1 0 8 0 rtentry 112 56 0 12 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 44 0 40 1 0 1 1 0 8 0 nd6 48 9 0 3 1 0 1 1 0 8 0 ppxss 1128 3 0 3 2 1 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 232 0 44 12 0 12 12 0 8 0 art_table 32 233 0 44 2 0 2 2 0 8 0 art_node 16 55 0 15 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 4 1 0 1 1 0 8 0 semapl 112 22 0 12 1 0 1 1 0 8 0 shmpl 112 10 0 1 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1752 0 338 46 0 46 46 0 8 0 ffsino 240 1752 0 338 84 0 84 84 0 8 0 nchpl 144 2263 0 627 61 0 61 61 0 8 0 uvmvnodes 72 1900 0 0 35 0 35 35 0 8 0 vnodes 200 1900 0 0 100 0 100 100 0 8 0 namei 1024 6103 0 6099 2 1 1 1 0 8 0 scxspl 192 13227 0 13226 11 8 3 7 0 8 2 sigapl 432 405 0 391 2 0 2 2 0 8 0 futexpl 56 3488 0 3485 1 0 1 1 0 8 0 knotepl 112 98 0 79 1 0 1 1 0 8 0 kqueuepl 104 38 0 36 1 0 1 1 0 8 0 pipepl 112 280 0 259 2 1 1 1 0 8 0 fdescpl 424 406 0 391 2 0 2 2 0 8 0 filepl 120 2250 0 2146 4 0 4 4 0 8 0 lockfpl 104 87 0 86 3 2 1 1 0 8 0 lockfspl 48 33 0 32 3 2 1 1 0 8 0 sessionpl 112 18 0 8 1 0 1 1 0 8 0 pgrppl 48 20 0 10 1 0 1 1 0 8 0 ucredpl 96 315 0 308 1 0 1 1 0 8 0 zombiepl 144 391 0 391 2 1 1 1 0 8 1 processpl 840 421 0 391 4 0 4 4 0 8 0 procpl 600 697 0 654 4 0 4 4 0 8 0 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 384 286 0 267 3 0 3 3 0 8 1 mcl64k 65536 270 0 270 33 25 8 33 0 8 8 mcl12k 12288 4 0 4 2 1 1 1 0 8 1 mcl9k 9216 7 0 7 1 0 1 1 0 8 1 mcl8k 8192 5 0 5 2 1 1 1 0 8 1 mcl4k 4096 20 0 20 3 2 1 1 0 8 1 mcl2k 2048 57805 0 57762 14 8 6 11 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 95405 0 95322 24 16 8 22 0 8 1 bufpl 256 19336 0 16228 198 0 198 198 0 8 0 anonpl 16 55993 0 44992 59 14 45 58 0 62 0 amapchunkpl 152 2028 0 1906 7 2 5 6 0 158 0 amappl16 192 2119 0 1474 44 11 33 40 0 8 0 amappl15 184 96 0 95 1 0 1 1 0 8 0 amappl14 176 91 0 90 2 1 1 1 0 8 0 amappl13 168 6 0 6 1 1 0 1 0 8 0 amappl12 160 57 0 53 1 0 1 1 0 8 0 amappl11 152 46 0 32 1 0 1 1 0 8 0 amappl10 144 73 0 70 2 1 1 1 0 8 0 amappl9 136 566 0 563 1 0 1 1 0 8 0 amappl8 128 132 0 117 1 0 1 1 0 8 0 amappl7 120 40 0 32 1 0 1 1 0 8 0 amappl6 112 57 0 47 1 0 1 1 0 8 0 amappl5 104 182 0 171 1 0 1 1 0 8 0 amappl4 96 600 0 571 2 1 1 2 0 8 0 amappl3 88 128 0 122 1 0 1 1 0 8 0 amappl2 80 2457 0 2394 2 0 2 2 0 8 0 amappl1 72 16767 0 16331 23 13 10 19 0 8 0 amappl 72 965 0 922 1 0 1 1 0 75 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 11 0 1 1 0 1 1 0 8 0 uaddrrnd 24 406 0 391 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 406 0 391 1 0 1 1 0 8 0 vmmpekpl 168 6962 0 6942 2 0 2 2 0 8 0 vmmpepl 168 49664 0 47986 122 36 86 107 0 357 13 vmsppl 264 405 0 391 2 1 1 2 0 8 0 pdppl 4096 818 0 782 6 1 5 6 0 8 0 pvpl 32 168500 0 154434 148 18 130 143 0 265 16 pmappl 200 405 0 391 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 385 0 56 11 0 11 11 0 8 0