panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 11449 68386 0 0 0 1 syz-executor *243939 36479 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(ffff80002a0da198,ffff80002a0da198,890012e9618ca641) at ufs_dirbadentry VOP_LOOKUP(fffffd807054c890,ffff80002a0da368,ffff80002a0da398) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a0da338) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a0da338) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofstatat(ffff80002a0442a0,ffffff9c,7c48de558b40,7c48de558f40,2) at dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 syscall(ffff80002a0da5b0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0da5b0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c48de558ff0, 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(ffff80002a0da198,ffff80002a0da198,890012e9618ca641) at ufs_dirbadentry VOP_LOOKUP(fffffd807054c890,ffff80002a0da368,ffff80002a0da398) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a0da338) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a0da338) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofstatat(ffff80002a0442a0,ffffff9c,7c48de558b40,7c48de558f40,2) at dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 syscall(ffff80002a0da5b0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0da5b0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c48de558ff0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a0d9fc0 rbx 0xffffffff83505dbf cpu_info_full_primary+0x2dbf rdx 0 rcx 0xffff80002a0442a0 rax 0xffffffff83504ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xcdb4cdc28bed06 r11 0x595dc2e3a182a64b r12 0xffffffff83505bc0 cpu_info_full_primary+0x2bc0 r13 0 r14 0 r15 0x1 rip 0xffffffff823851f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a0d9fb0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=243939 pid=36479 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=0xffff80002a044a38,0xffff80002a045468 process=0xffff800029fe9228 user=0xffff80002a0d5000, vmspace=0xfffffd8077049008 estcpu=36, cpticks=2, pctcpu=0.15, user=0, sys=27, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 83286 74354 15654 0 2 0 syz-executor 83286 521679 15654 0 3 0x4000080 fsleep syz-executor 83286 317283 15654 0 3 0x4000080 fsleep syz-executor 68386 11449 22420 0 7 0 syz-executor 68386 17249 22420 0 2 0x4000000 syz-executor 68386 472543 22420 0 3 0x4000080 fsleep syz-executor 14831 32909 12989 0 2 0 syz-executor 14831 440781 12989 0 3 0x4000080 fsleep syz-executor 40507 316774 2848 0 3 0x80 nanoslp syz-executor 40507 155041 2848 0 3 0x4000080 fsleep syz-executor 40507 375301 2848 0 3 0x4000080 kqsel syz-executor 84849 158897 0 0 3 0x14280 nfsidl nfsio 34795 202494 0 0 3 0x14200 bored sosplice 79792 123932 1 0 3 0x100083 ttyin getty 12989 418485 90300 0 3 0x82 nanoslp syz-executor 15654 418825 90300 0 3 0x82 nanoslp syz-executor 53069 139800 90300 0 3 0x82 nanoslp syz-executor *36479 243939 90300 0 7 0x2 syz-executor 22420 307820 90300 0 3 0x82 nanoslp syz-executor 2848 232354 90300 0 3 0x82 nanoslp syz-executor 90300 197515 78491 0 3 0x82 wait syz-executor 78491 346589 14431 0 3 0x10008a sigsusp ksh 14431 235524 72778 0 3 0x98 kqread sshd-session 72778 437740 59457 0 3 0x92 kqread sshd-session 59457 298239 1 0 3 0x88 kqread sshd 23462 521591 37606 74 3 0x1100092 bpf pflogd 37606 412023 1 0 3 0x80 sbwait pflogd 4895 369782 80912 73 3 0x1100090 kqread syslogd 80912 393566 1 0 3 0x100082 sbwait syslogd 66296 409561 1 0 3 0x100080 kqread resolvd 72517 141163 63521 77 3 0x100092 kqread dhcpleased 43324 468949 63521 77 3 0x100092 kqread dhcpleased 63521 500481 1 0 3 0x80 kqread dhcpleased 21080 211328 0 0 3 0x14200 bored smr 85438 149988 0 0 2 0x14200 zerothread 7110 88415 0 0 3 0x14200 aiodoned aiodoned 797 160194 0 0 3 0x14200 syncer update 93374 223750 0 0 3 0x14200 cleaner cleaner 93706 385432 0 0 3 0x14200 reaper reaper 52267 324427 0 0 3 0x14200 pgdaemon pagedaemon 94862 453675 0 0 3 0x14200 bored viomb 94615 1414 0 0 3 0x40014200 acpi0 acpi0 30194 281663 0 0 3 0x40014200 idle1 80835 89637 0 0 3 0x14200 bored softnet3 61517 239045 0 0 3 0x14200 bored softnet2 85454 184133 0 0 3 0x14200 bored softnet1 18681 38912 0 0 3 0x14200 bored softnet0 70058 13056 0 0 3 0x14200 bored systqmp 44239 181372 0 0 3 0x14200 bored systq 38168 432747 0 0 3 0x14200 tmoslp softclockmp 46363 134847 0 0 3 0x40014200 tmoslp softclock 728 20147 0 0 3 0x40014200 idle0 1 453733 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 36479 (syz-executor) thread 0xffff80002a0442a0 (243939) exclusive rrwlock inode r = 0 (0xfffffd806dfe40a0) #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 11334K 11521K 166960K 11737 0 pcb 17 12K 12K 166960K 77 0 rtable 233 6K 7K 166960K 414 0 pf 37 18K 19K 166960K 59 0 ifaddr 45 8K 8K 166960K 56 0 ifgroup 58 2K 2K 166960K 76 0 sysctl 2 0K 0K 166960K 2 0 counters 64 36K 36K 166960K 72 0 ioctlops 0 0K 4K 166960K 1514 0 iov 0 0K 12K 166960K 16 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1373 86K 87K 166960K 1635 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 9 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 19 0 dirhash 15 2K 2K 166960K 21 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 15 53K 93K 166960K 470 0 sigio 0 0K 0K 166960K 14 0 proc 72 91K 128K 166960K 568 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 0 0K 0K 166960K 41 0 in_multi 99 7K 7K 166960K 123 0 ether_multi 1 0K 0K 166960K 2 0 mrt 1 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 85 387K 387K 166960K 85 0 exec 0 0K 1K 166960K 392 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 222 72K 87K 166960K 6057 0 UVM aobj 17 2K 2K 166960K 19 0 pinsyscall 40 80K 102K 166960K 1560 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 2 0K 0K 166960K 30 0 NDP 12 0K 1K 166960K 33 0 temp 53 6821K 6887K 166960K 14110 0 kqueue 14 22K 30K 166960K 90 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 60 0 57 1 0 1 1 0 8 0 rtentry 112 128 0 20 4 0 4 4 0 8 0 unpcb 144 364 0 347 2 0 2 2 0 8 1 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpqe 32 2 0 2 1 0 1 1 0 8 1 tcpcb 808 174 0 168 8 0 8 8 0 8 7 arp 120 22 0 3 1 0 1 1 0 8 0 inpcb 336 473 0 463 7 0 7 7 0 8 5 nd6 136 25 0 0 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 0 1 1 0 8 1 kcovpl 48 8 0 0 1 0 1 1 0 8 0 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 7 0 3 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 40 0 1 1 0 1 1 0 8 0 pfstkey 128 40 0 1 2 0 2 2 0 8 0 pfstate 376 39 0 1 4 0 4 4 0 8 0 pfrule 1344 22 0 16 2 0 2 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 498 0 53 29 0 29 29 0 8 0 art_table 32 500 0 53 4 0 4 4 0 8 0 art_node 16 126 0 35 1 0 1 1 0 8 0 sysvmsgpl 40 9 0 5 1 0 1 1 0 8 0 semupl 112 3 0 3 1 0 1 1 0 8 1 semapl 112 16 0 6 1 0 1 1 0 8 0 shmpl 112 16 0 2 1 0 1 1 0 8 0 dirhash 1024 23 0 4 3 0 3 3 0 8 0 dino2pl 256 2174 0 674 95 0 95 95 0 8 0 ffsino 272 2174 0 674 101 0 101 101 0 8 0 nchpl 144 2831 0 1146 63 0 63 63 0 8 0 uvmvnodes 80 2433 0 0 50 0 50 50 0 8 0 vnodes 216 2433 0 0 136 0 136 136 0 8 0 namei 1024 9318 0 9317 2 1 1 2 0 8 0 percpumem 16 50 0 4 1 0 1 1 0 8 0 kstatmem 264 32 0 8 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 0 1 1 0 8 1 scxspl 216 8450 0 8450 9 2 7 8 1 8 7 plimitpl 152 72 0 55 1 0 1 1 0 8 0 sigapl 424 794 0 745 8 0 8 8 0 8 1 futexpl 64 5234 0 5229 1 0 1 1 0 8 0 knotepl 120 560 0 0 17 0 17 17 0 8 0 kqueuepl 216 132 0 121 1 0 1 1 0 8 0 pipepl 320 138 0 111 3 0 3 3 0 8 0 fdescpl 496 755 0 726 5 0 5 5 0 8 0 filepl 152 3723 0 3479 14 0 14 14 0 8 3 lockfpl 104 112 0 109 1 0 1 1 0 8 0 lockfspl 48 50 0 47 1 0 1 1 0 8 0 sessionpl 144 26 0 17 1 0 1 1 0 8 0 pgrppl 48 37 0 20 1 0 1 1 0 8 0 ucredpl 104 399 0 385 1 0 1 1 0 8 0 zombiepl 144 748 0 745 1 0 1 1 0 8 0 processpl 1160 794 0 745 6 0 6 6 0 8 0 procpl 648 1370 0 1314 8 0 8 8 0 8 1 sosppl 168 4 0 3 1 0 1 1 0 8 0 sockpl 664 907 0 877 9 0 9 9 0 8 5 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 156 0 0 20 0 20 20 0 8 0 mcl2k 2048 20 0 0 3 0 3 3 0 8 0 mtagpl 96 6 0 0 1 0 1 1 0 8 0 mbufpl 256 253 0 0 16 0 16 16 0 8 0 bufpl 280 2891 0 98 200 0 200 200 0 8 0 anonpl 24 163089 0 159801 45 1 44 44 0 185 13 amapchunkpl 152 19433 0 18983 29 0 29 29 0 158 5 amappl16 200 3942 0 3919 16 5 11 14 0 8 8 amappl15 192 10 0 10 1 1 0 1 0 8 0 amappl14 184 130 0 118 1 0 1 1 0 8 0 amappl13 176 10 0 9 1 0 1 1 0 8 0 amappl12 168 1418 0 1389 3 1 2 2 0 8 0 amappl11 160 55 0 41 1 0 1 1 0 8 0 amappl10 152 14 0 14 1 1 0 1 0 8 0 amappl9 144 164 0 164 1 1 0 1 0 8 0 amappl8 136 15 0 13 1 0 1 1 0 8 0 amappl7 128 109 0 96 1 0 1 1 0 8 0 amappl6 120 179 0 178 1 0 1 1 0 8 0 amappl5 112 134 0 123 1 0 1 1 0 8 0 amappl4 104 317 0 297 1 0 1 1 0 8 0 amappl3 96 3581 0 3492 3 0 3 3 0 8 0 amappl2 88 1064 0 981 3 0 3 3 0 8 0 amappl1 80 9358 0 8797 15 0 15 15 0 8 1 amappl 88 5644 0 5484 5 0 5 5 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 254 0 254 2 2 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 18 0 2 1 0 1 1 0 8 0 uaddrrnd 24 756 0 727 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 756 0 727 1 0 1 1 0 8 0 vmmpekpl 168 7779 0 7739 3 0 3 3 0 8 0 vmmpepl 168 54441 0 52680 93 0 93 93 0 357 6 vmsppl 448 755 0 727 6 2 4 5 0 8 0 rwobjpl 56 21094 0 17726 49 1 48 48 0 8 0 pdppl 4096 1519 0 1454 107 34 73 85 0 8 8 pvpl 32 11995 0 0 98 1 97 97 0 265 0 pmappl 248 755 0 727 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 406 0 39 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(ffff80002a0da198,ffff80002a0da198,890012e9618ca641) at ufs_dirbadentry VOP_LOOKUP(fffffd807054c890,ffff80002a0da368,ffff80002a0da398) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a0da338) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a0da338) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofstatat(ffff80002a0442a0,ffffff9c,7c48de558b40,7c48de558f40,2) at dofstatat+0xd2 sys/kern/vfs_syscalls.c:2069 syscall(ffff80002a0da5b0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a0da5b0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c48de558ff0, 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 end of kernel end trace frame: 0x70be19570170, count: 12 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 end of kernel end trace frame: 0x70be19570170, count: -3