panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 67950 2947 0 0x2 0 0K 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(ffff80002a0d8a38,ffff80002a0d8a38,4a38ac19dde668e6) at ufs_dirbadentry VOP_LOOKUP(fffffd80626fc1b8,ffff80002a0d8c08,ffff80002a0d8c38) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a0d8bd8) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a0d8bd8) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofstatat(ffff80002a03ef48,ffffff9c,74d9d64a4040,74d9d64a4440,2) at dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 syscall(ffff80002a0d8e50) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0d8e50) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x74d9d64a44f0, 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(ffff80002a0d8a38,ffff80002a0d8a38,4a38ac19dde668e6) at ufs_dirbadentry VOP_LOOKUP(fffffd80626fc1b8,ffff80002a0d8c08,ffff80002a0d8c38) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a0d8bd8) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a0d8bd8) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofstatat(ffff80002a03ef48,ffffff9c,74d9d64a4040,74d9d64a4440,2) at dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 syscall(ffff80002a0d8e50) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0d8e50) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x74d9d64a44f0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a0d8860 rbx 0xffffffff83505dbf cpu_info_full_primary+0x2dbf rdx 0 rcx 0xffff80002a03ef48 rax 0xffffffff83504ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xa85725e211693cf0 r11 0xd09864e99da44ff5 r12 0xffffffff83505bc0 cpu_info_full_primary+0x2bc0 r13 0 r14 0 r15 0x1 rip 0xffffffff823851f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a0d8850 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=67950 pid=2947 tcnt=1 stat=onproc flags process=2 proc=0 runpri=17, usrpri=50, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a03e528,0xffff80002a03f1e0 process=0xffff800029fe8da0 user=0xffff80002a0d3000, vmspace=0xfffffd807bc80008 estcpu=36, cpticks=1, pctcpu=0.14, user=2, sys=29, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 51008 300154 0 0 3 0x14280 nfsidl nfsio 26018 159455 0 0 3 0x14280 nfsidl nfsio 49032 201081 0 0 3 0x14280 nfsidl nfsio 92320 277473 0 0 3 0x14280 nfsidl nfsio 98699 61402 0 0 3 0x14280 nfsidl nfsio 94459 315188 0 0 3 0x14280 nfsidl nfsio 96542 503924 0 0 3 0x14280 nfsidl nfsio 53109 7727 0 0 3 0x14280 nfsidl nfsio 95548 96389 0 0 3 0x14280 nfsidl nfsio 51817 225514 0 0 3 0x14280 nfsidl nfsio 56363 392244 0 0 3 0x14280 nfsidl nfsio 74833 133090 0 0 3 0x14280 nfsidl nfsio 1378 224611 0 0 3 0x14280 nfsidl nfsio 71430 57531 0 0 3 0x14280 nfsidl nfsio 37010 445170 0 0 3 0x14280 nfsidl nfsio 62359 490096 0 0 3 0x14280 nfsidl nfsio 631 178769 0 0 3 0x14280 nfsidl nfsio 98608 355467 0 0 3 0x14280 nfsidl nfsio 46584 478929 0 0 3 0x14280 nfsidl nfsio 74849 138940 0 0 3 0x14280 nfsidl nfsio 99653 270706 95738 0 2 0x480 syz-executor 99653 111455 95738 0 3 0x4000080 netacc syz-executor 99653 437501 95738 0 3 0x4000080 fsleep syz-executor 6678 17744 11621 0 3 0x80 nanoslp syz-executor 6678 286924 11621 0 3 0x4000080 ttyout syz-executor 6678 268846 11621 0 3 0x4000080 fsleep syz-executor 28645 304649 9892 0 2 0x480 syz-executor 28645 121815 9892 0 3 0x4000080 fifor syz-executor 28645 383314 9892 0 3 0x4000080 fsleep syz-executor 28645 501340 9892 0 3 0x4000080 fsleep syz-executor 622 479118 1 0 3 0x100083 ttyin getty 5063 50400 0 0 3 0x14200 bored sosplice 11621 150009 47947 0 2 0x482 syz-executor 9892 430933 47947 0 2 0x482 syz-executor * 2947 67950 47947 0 7 0x2 syz-executor 26895 334211 47947 0 2 0x482 syz-executor 95738 214074 47947 0 2 0x482 syz-executor 47947 266793 26359 0 3 0x82 wait syz-executor 26359 44132 59270 0 3 0x10008a sigsusp ksh 59270 501638 84518 0 3 0x98 kqread sshd-session 84518 18209 20133 0 3 0x92 kqread sshd-session 20133 328246 1 0 3 0x88 kqread sshd 51200 27114 7611 74 3 0x1100092 bpf pflogd 7611 288087 1 0 3 0x80 sbwait pflogd 38045 435628 73304 73 3 0x1100090 kqread syslogd 73304 486897 1 0 3 0x100082 sbwait syslogd 47057 417276 1 0 3 0x100080 kqread resolvd 88194 474809 94788 77 3 0x100092 kqread dhcpleased 48347 198103 94788 77 3 0x100092 kqread dhcpleased 94788 354711 1 0 3 0x80 kqread dhcpleased 77368 232807 0 0 3 0x14200 bored smr 25956 43432 0 0 3 0x14200 pgzero zerothread 70186 344567 0 0 3 0x14200 aiodoned aiodoned 29449 167076 0 0 3 0x14200 syncer update 70417 168001 0 0 3 0x14200 cleaner cleaner 26261 391321 0 0 3 0x14200 reaper reaper 60331 190907 0 0 3 0x14200 pgdaemon pagedaemon 35830 301291 0 0 3 0x14200 bored viomb 37254 425027 0 0 3 0x40014200 acpi0 acpi0 13742 256956 0 0 7 0x40014200 idle1 29296 486487 0 0 3 0x14200 bored softnet3 75198 328492 0 0 3 0x14200 bored softnet2 66526 458054 0 0 3 0x14200 bored softnet1 71648 203353 0 0 3 0x14200 bored softnet0 29508 236865 0 0 3 0x14200 bored systqmp 44899 171059 0 0 3 0x14200 bored systq 84049 419745 0 0 3 0x14200 tmoslp softclockmp 72540 343011 0 0 2 0x40014200 softclock 57475 382639 0 0 3 0x40014200 idle0 1 121208 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 2947 (syz-executor) thread 0xffff80002a03ef48 (67950) exclusive rrwlock inode r = 0 (0xfffffd8062984818) #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 vget+0x2bd sys/kern/vfs_subr.c:678 #6 cache_lookup+0x36e sys/kern/vfs_cache.c:222 #7 ufs_lookup+0x218 sys/ufs/ufs/ufs_lookup.c:160 #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 dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 #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 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 syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:178 [inline] #1 syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10206 11184K 11563K 166960K 11816 0 pcb 18 12K 12K 166960K 86 0 rtable 194 7K 8K 166960K 398 0 pf 31 17K 18K 166960K 51 0 ifaddr 34 5K 7K 166960K 49 0 ifgroup 47 2K 2K 166960K 59 0 sysctl 2 0K 0K 166960K 2 0 counters 60 35K 36K 166960K 68 0 ioctlops 0 0K 4K 166960K 1510 0 iov 0 0K 17K 166960K 25 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1373 86K 87K 166960K 1752 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 12 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 13 0 dirhash 12 2K 2K 166960K 24 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 13 45K 93K 166960K 533 0 sigio 0 0K 0K 166960K 5 0 proc 72 91K 140K 166960K 573 0 subproc 91 5K 6K 166960K 104 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 61 0 in_multi 73 5K 7K 166960K 115 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 103 466K 466K 166960K 103 0 exec 0 0K 1K 166960K 412 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 216 64K 88K 166960K 6624 0 UVM aobj 17 2K 2K 166960K 18 0 pinsyscall 38 76K 103K 166960K 1642 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 26 0 NDP 10 0K 2K 166960K 32 0 temp 55 6823K 6951K 166960K 27605 0 kqueue 13 20K 32K 166960K 92 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 62 0 59 1 0 1 1 0 8 0 rtentry 112 122 0 35 4 0 4 4 0 8 0 unpcb 144 342 0 322 4 0 4 4 0 8 3 syncache 336 9 0 9 3 2 1 1 0 8 1 tcpqe 32 2 0 2 1 0 1 1 0 8 1 tcpcb 808 224 0 214 8 0 8 8 0 8 6 arp 120 20 0 6 1 0 1 1 0 8 0 inpcb 336 745 0 731 7 0 7 7 0 8 3 nd6 136 27 0 9 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 1 0 1 0 8 0 kcovpl 48 8 0 1 1 0 1 1 0 8 0 ppxss 1168 2 0 2 1 0 1 1 0 8 1 pfstscr 40 1 0 0 1 0 1 1 0 8 0 pffrag 232 4 0 0 1 0 1 1 0 482 0 pffrnode 88 4 0 0 1 0 1 1 0 8 0 pffrent 40 6 0 2 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 61 0 3 1 0 1 1 0 8 0 pfstkey 128 61 0 3 2 0 2 2 0 8 0 pfstate 376 60 0 3 6 0 6 6 0 8 0 pfrule 1344 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 470 0 110 30 0 30 30 0 8 2 art_table 32 473 0 110 4 0 4 4 0 8 0 art_node 16 121 0 41 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 4 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 11 0 1 1 0 1 1 0 8 0 shmpl 112 15 0 1 1 0 1 1 0 8 0 dirhash 1024 26 0 9 3 0 3 3 0 8 0 dino2pl 256 2338 0 831 95 0 95 95 0 8 0 ffsino 272 2338 0 831 102 0 102 102 0 8 0 nchpl 144 3112 0 1428 63 0 63 63 0 8 0 uvmvnodes 80 2634 0 0 54 0 54 54 0 8 0 vnodes 216 2634 0 0 147 0 147 147 0 8 0 namei 1024 10286 0 10285 3 2 1 2 0 8 0 percpumem 16 48 0 4 1 0 1 1 0 8 0 kstatmem 264 28 0 8 2 0 2 2 0 8 0 scsiplug 72 2 0 2 2 1 1 1 0 8 1 scxspl 216 9010 0 9010 4 3 1 2 1 8 1 plimitpl 152 208 0 191 1 0 1 1 0 8 0 sigapl 424 860 0 793 9 1 8 8 0 8 0 futexpl 64 6715 0 6711 1 0 1 1 0 8 0 knotepl 120 562 0 0 17 0 17 17 0 8 0 kqueuepl 216 137 0 128 1 0 1 1 0 8 0 pipepl 320 153 0 126 3 0 3 3 0 8 0 fdescpl 496 821 0 794 5 0 5 5 0 8 1 filepl 152 4838 0 4596 15 0 15 15 0 8 3 lockfpl 104 189 0 186 1 0 1 1 0 8 0 lockfspl 48 74 0 71 1 0 1 1 0 8 0 sessionpl 144 30 0 21 1 0 1 1 0 8 0 pgrppl 48 43 0 26 1 0 1 1 0 8 0 ucredpl 104 776 0 763 1 0 1 1 0 8 0 zombiepl 144 797 0 793 2 1 1 1 0 8 0 processpl 1160 860 0 793 7 1 6 6 0 8 0 procpl 648 1499 0 1425 8 0 8 8 0 8 0 srpgc 96 6 0 6 1 0 1 1 0 8 1 sosppl 168 2 0 2 1 1 0 1 0 8 0 sockpl 664 1153 0 1116 9 0 9 9 0 8 4 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 161 0 0 21 0 21 21 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 28 0 0 4 0 4 4 0 8 0 mtagpl 96 10 0 0 1 0 1 1 0 8 0 mbufpl 256 212 0 0 13 0 13 13 0 8 0 bufpl 280 3236 0 103 224 0 224 224 0 8 0 anonpl 24 220958 0 212648 105 4 101 101 0 185 27 amapchunkpl 152 22132 0 21631 32 0 32 32 0 158 3 amappl16 200 6223 0 5973 43 9 34 39 0 8 8 amappl15 192 16 0 16 1 1 0 1 0 8 0 amappl14 184 134 0 122 1 0 1 1 0 8 0 amappl13 176 29 0 29 1 1 0 1 0 8 0 amappl12 168 1481 0 1454 3 1 2 2 0 8 0 amappl11 160 57 0 43 1 0 1 1 0 8 0 amappl10 152 49 0 49 1 1 0 1 0 8 0 amappl9 144 178 0 178 1 1 0 1 0 8 0 amappl8 136 23 0 20 1 0 1 1 0 8 0 amappl7 128 114 0 102 1 0 1 1 0 8 0 amappl6 120 165 0 163 1 0 1 1 0 8 0 amappl5 112 173 0 161 1 0 1 1 0 8 0 amappl4 104 333 0 314 1 0 1 1 0 8 0 amappl3 96 3982 0 3902 3 0 3 3 0 8 0 amappl2 88 1163 0 1082 3 0 3 3 0 8 0 amappl1 80 10188 0 9631 16 0 16 16 0 8 1 amappl 88 6182 0 6028 5 0 5 5 0 92 0 dma32768 32768 1 0 1 1 1 0 1 0 8 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 254 0 254 2 1 1 1 0 8 1 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 17 0 1 1 0 1 1 0 8 0 uaddrrnd 24 821 0 794 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 821 0 794 1 0 1 1 0 8 0 vmmpekpl 168 8552 0 8494 3 0 3 3 0 8 0 vmmpepl 168 62116 0 60200 116 1 115 115 0 357 15 vmsppl 448 820 0 794 6 2 4 5 0 8 0 rwobjpl 56 24838 0 21063 58 1 57 57 0 8 1 pdppl 4096 1649 0 1588 117 42 75 85 0 8 14 pvpl 32 22618 0 0 184 1 183 183 0 265 0 pmappl 248 820 0 794 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 423 0 51 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(ffff80002a0d8a38,ffff80002a0d8a38,4a38ac19dde668e6) at ufs_dirbadentry VOP_LOOKUP(fffffd80626fc1b8,ffff80002a0d8c08,ffff80002a0d8c38) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a0d8bd8) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a0d8bd8) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofstatat(ffff80002a03ef48,ffffff9c,74d9d64a4040,74d9d64a4440,2) at dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 syscall(ffff80002a0d8e50) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0d8e50) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x74d9d64a44f0, 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 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: 10 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 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: -5