panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *375367 36470 0 0x2 0x4000000 0 syz-fuzzer 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(ffff8000149d0328,ffff8000149d0328,44d8142a486132e) at ufs_dirbadentry VOP_LOOKUP(fffffd803efda7d0,ffff8000149d0528,ffff8000149d0578) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff8000149d04f8) at vfs_lookup+0x55d sys/kern/vfs_lookup.c:523 namei(ffff8000149d04f8) at namei+0x45f sys/kern/vfs_lookup.c:224 dofstatat(ffff8000ffff5c30,ffffff9c,c00198078a,c0000700f8,0) at dofstatat+0xab sys/kern/vfs_syscalls.c:1892 syscall(ffff8000149d07a0) at syscall+0x511 Xsyscall(6,26,c00002c000,26,0,95829f) at Xsyscall+0x128 end of kernel end trace frame: 0xc0015078d0, 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(ffff8000149d0328,ffff8000149d0328,44d8142a486132e) at ufs_dirbadentry VOP_LOOKUP(fffffd803efda7d0,ffff8000149d0528,ffff8000149d0578) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff8000149d04f8) at vfs_lookup+0x55d sys/kern/vfs_lookup.c:523 namei(ffff8000149d04f8) at namei+0x45f sys/kern/vfs_lookup.c:224 dofstatat(ffff8000ffff5c30,ffffff9c,c00198078a,c0000700f8,0) at dofstatat+0xab sys/kern/vfs_syscalls.c:1892 syscall(ffff8000149d07a0) at syscall+0x511 Xsyscall(6,26,c00002c000,26,0,95829f) at Xsyscall+0x128 end of kernel end trace frame: 0xc0015078d0, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000149d0140 rbx 0xffff8000149d01f0 rdx 0x2 rcx 0 rax 0 r8 0xffff8000149d0100 r9 0x1 r10 0 r11 0x16d551a581c97627 r12 0x3000000008 r13 0xffff8000149d0150 r14 0x100 r15 0x1 rip 0xffffffff81a73678 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000149d0130 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-fuzzer) pid=375367 stat=onproc flags process=2 proc=4000000 pri=17, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff5780,0xffff8000ffff8720 process=0xffff8000149529f0 user=0xffff8000149cb000, vmspace=0xfffffd803f014210 estcpu=0, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 74304 73418 36470 0 3 0x82 piperd syz-executor.1 26734 454783 0 0 3 0x14200 bored sosplice 36470 123113 59471 0 3 0x82 thrsleep syz-fuzzer 36470 93054 59471 0 2 0x4000482 syz-fuzzer 36470 201666 59471 0 3 0x4000082 thrsleep syz-fuzzer 36470 212009 59471 0 3 0x4000082 kqread syz-fuzzer 36470 143051 59471 0 3 0x4000082 thrsleep syz-fuzzer *36470 375367 59471 0 7 0x4000002 syz-fuzzer 36470 95422 59471 0 3 0x4000082 thrsleep syz-fuzzer 36470 264528 59471 0 3 0x4000082 thrsleep syz-fuzzer 59471 450363 24333 0 3 0x10008a pause ksh 24333 267893 99460 0 3 0x92 select sshd 51019 262444 1 0 3 0x100083 ttyin getty 99460 286064 1 0 3 0x80 select sshd 11643 310531 70529 73 2 0x100090 syslogd 70529 417166 1 0 3 0x100082 netio syslogd 89053 453706 1 77 3 0x100090 poll dhclient 98127 13336 1 0 3 0x80 poll dhclient 90675 263364 0 0 3 0x14200 pgzero zerothread 50445 223616 0 0 3 0x14200 aiodoned aiodoned 56091 464921 0 0 3 0x14200 syncer update 87167 218470 0 0 3 0x14200 cleaner cleaner 2539 138573 0 0 3 0x14200 reaper reaper 97401 432846 0 0 3 0x14200 pgdaemon pagedaemon 75865 403301 0 0 3 0x14200 bored crynlk 81414 395875 0 0 3 0x14200 bored crypto 64350 237403 0 0 3 0x40014200 acpi0 acpi0 38329 169100 0 0 3 0x14200 bored softnet 93259 169569 0 0 3 0x14200 bored systqmp 56799 459617 0 0 3 0x14200 bored systq 73580 110592 0 0 3 0x40014200 bored softclock 47072 124098 0 0 3 0x40014200 idle0 32116 416750 0 0 3 0x14200 bored smr 1 482577 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 9461 6318K 6838K 78643K 11022 0 0 pcb 23 9K 11K 78643K 163 0 0 rtable 86 3K 4K 78643K 264 0 0 ifaddr 39 10K 11K 78643K 59 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 24 0 0 iov 0 0K 14K 78643K 34 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1204 75K 76K 78643K 1388 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 6 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 1K 78643K 38 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 3 5K 25K 78643K 263 0 0 sigio 0 0K 0K 78643K 2 0 0 proc 41 30K 62K 78643K 339 0 0 subproc 32 32769K 69634K 78643K 104 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 16 0 0 in_multi 22 1K 2K 78643K 45 0 0 ether_multi 1 0K 0K 78643K 1 0 0 mrt 0 0K 0K 78643K 2 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 212 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 68 12K 29K 78643K 1391 0 0 UVM aobj 13 2K 2K 78643K 13 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 14 0 0 NDP 7 0K 0K 78643K 17 0 0 temp 85 2697K 2825K 78643K 6020 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 4 1 0 1 1 0 8 0 inpcbpl 280 134 0 127 1 0 1 1 0 8 0 plimitpl 152 21 0 15 1 0 1 1 0 8 0 rtentry 112 56 0 23 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 6 1 0 1 1 0 8 0 ppxss 1128 1 0 1 1 0 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 233 0 88 12 0 12 12 0 8 1 art_table 32 234 0 88 2 0 2 2 0 8 0 art_node 16 55 0 25 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 2 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 34 0 24 1 0 1 1 0 8 0 shmpl 112 11 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1769 0 357 46 0 46 46 0 8 0 ffsino 240 1769 0 357 84 0 84 84 0 8 0 nchpl 144 2316 0 703 61 0 61 61 0 8 0 uvmvnodes 72 1943 0 0 36 0 36 36 0 8 0 vnodes 200 1943 0 0 103 0 103 103 0 8 0 namei 1024 6133 0 6132 2 1 1 1 0 8 0 scxspl 192 14326 0 14326 8 7 1 6 0 8 1 sigapl 432 430 0 419 2 0 2 2 0 8 0 futexpl 56 3377 0 3377 1 0 1 1 0 8 1 knotepl 112 88 0 75 1 0 1 1 0 8 0 kqueuepl 104 30 0 28 1 0 1 1 0 8 0 pipepl 112 306 0 293 3 2 1 2 0 8 0 fdescpl 424 431 0 419 2 0 2 2 0 8 0 filepl 120 2204 0 2133 5 1 4 5 0 8 1 lockfpl 104 88 0 88 2 1 1 1 0 8 1 lockfspl 48 32 0 32 2 1 1 1 0 8 1 sessionpl 112 18 0 9 1 0 1 1 0 8 0 pgrppl 48 18 0 9 1 0 1 1 0 8 0 ucredpl 96 271 0 264 1 0 1 1 0 8 0 zombiepl 144 419 0 419 2 1 1 1 0 8 1 processpl 840 446 0 419 4 0 4 4 0 8 0 procpl 600 706 0 672 4 0 4 4 0 8 1 sosppl 128 4 0 4 1 1 0 1 0 8 0 sockpl 384 250 0 233 4 1 3 4 0 8 1 mcl64k 65536 14 0 14 1 1 0 1 0 8 0 mcl16k 16384 1 0 1 1 1 0 1 0 8 0 mcl12k 12288 3 0 3 2 1 1 1 0 8 1 mcl9k 9216 4 0 4 1 1 0 1 0 8 0 mcl8k 8192 3 0 3 1 0 1 1 0 8 1 mcl4k 4096 22 0 22 2 1 1 1 0 8 1 mcl2k2 2112 1 0 1 1 0 1 1 0 8 1 mcl2k 2048 58173 0 58133 13 7 6 10 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 95609 0 95546 11 3 8 9 0 8 1 bufpl 256 19171 0 16064 199 1 198 198 0 8 0 anonpl 16 55376 0 46711 68 8 60 60 0 62 15 amapchunkpl 152 2185 0 2089 9 4 5 9 0 158 0 amappl16 192 1914 0 1337 42 0 42 42 0 8 12 amappl14 176 45 0 42 2 1 1 1 0 8 0 amappl13 168 7 0 7 1 1 0 1 0 8 0 amappl12 160 16 0 15 1 0 1 1 0 8 0 amappl11 152 41 0 27 1 0 1 1 0 8 0 amappl10 144 82 0 80 1 0 1 1 0 8 0 amappl9 136 628 0 625 1 0 1 1 0 8 0 amappl8 128 221 0 205 1 0 1 1 0 8 0 amappl7 120 55 0 49 1 0 1 1 0 8 0 amappl6 112 55 0 49 1 0 1 1 0 8 0 amappl5 104 191 0 181 1 0 1 1 0 8 0 amappl4 96 608 0 582 2 1 1 2 0 8 0 amappl3 88 125 0 118 1 0 1 1 0 8 0 amappl2 80 2428 0 2385 2 0 2 2 0 8 0 amappl1 72 17089 0 16700 23 13 10 19 0 8 0 amappl 72 972 0 942 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 12 0 0 1 0 1 1 0 8 0 uaddrrnd 24 431 0 419 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 431 0 419 1 0 1 1 0 8 0 vmmpekpl 168 7310 0 7290 1 0 1 1 0 8 0 vmmpepl 168 53164 0 51804 108 25 83 89 0 357 15 vmsppl 264 430 0 419 3 2 1 2 0 8 0 pdppl 4096 868 0 838 6 1 5 6 0 8 0 pvpl 32 185728 0 174241 167 14 153 153 0 265 41 pmappl 200 430 0 419 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 339 0 18 10 0 10 10 0 8 0