panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 338762 54013 0 0 0 0 syz-executor * 65770 54013 0 0 0x4000000 1K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83036195) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371c7e28,ffff8000371c7e28,ecfb5d45313973) at ufs_dirbadentry VOP_LOOKUP(fffffd80618079a8,ffff8000371c8130,ffff8000371c8160) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371c8100) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371c8100) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371c8100,102,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 sys_ktrace(ffff80002a03e7b8,ffff8000371c82e0,ffff8000371c8230) at sys_ktrace+0x9a sys/kern/kern_ktrace.c:542 syscall(ffff8000371c82e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371c82e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf12cf8ba2c0, count: 5 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic *cpu1: bad dir ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83036195) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371c7e28,ffff8000371c7e28,ecfb5d45313973) at ufs_dirbadentry VOP_LOOKUP(fffffd80618079a8,ffff8000371c8130,ffff8000371c8160) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371c8100) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371c8100) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371c8100,102,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 sys_ktrace(ffff80002a03e7b8,ffff8000371c82e0,ffff8000371c8230) at sys_ktrace+0x9a sys/kern/kern_ktrace.c:542 syscall(ffff8000371c82e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371c82e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf12cf8ba2c0, count: -10 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000371c7c50 rbx 0xffff800029b7cdbf rdx 0 rcx 0xffff80002a03e7b8 rax 0xffff800029b7bff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x8c20fee81f34fc23 r11 0x7f93ef76a9ed017e r12 0xffff800029b7cbc0 r13 0 r14 0 r15 0x1 rip 0xffffffff817ca965 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000371c7c40 ss 0 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor) tid=65770 pid=54013 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=0xffff80002a03ef50,0xffffffff83601b88 process=0xffff8000ffff2460 user=0xffff8000371c3000, vmspace=0xfffffd806a8168e8 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 11813 210420 46847 0 2 0 syz-executor 11813 74848 46847 0 3 0x4000080 fsleep syz-executor 11813 347187 46847 0 3 0x4000080 fsleep syz-executor 36122 209682 29862 0 2 0 syz-executor 36122 333237 29862 0 3 0x4000080 lockf syz-executor 54013 338762 75359 0 7 0 syz-executor *54013 65770 75359 0 7 0x4000000 syz-executor 88625 261586 46910 0 2 0 syz-executor 88625 256242 46910 0 2 0x4000000 syz-executor 18657 516900 24079 0 2 0 syz-executor 87793 362489 83669 0 2 0 syz-executor 87793 2581 83669 0 3 0x4000080 kqpoll syz-executor 87793 96952 83669 0 3 0x4000080 fsleep syz-executor 79046 335070 42552 60928 3 0x90 nanoslp syz-executor 79046 213599 42552 60928 2 0x4000010 syz-executor 79046 503362 42552 60928 3 0x4000090 fsleep syz-executor 84844 279117 0 0 3 0x14200 bored sosplice 23866 134830 1 0 3 0x100083 ttyin getty 73203 311008 26844 0 3 0x100082 sbwait ndp 26844 74389 92352 0 3 0x10008a sigsusp sh 29862 335193 65844 0 3 0x82 nanoslp syz-executor 46847 520802 65844 0 3 0x82 nanoslp syz-executor 83669 486380 65844 0 3 0x82 nanoslp syz-executor 24079 157425 65844 0 3 0x82 nanoslp syz-executor 46910 439449 65844 0 3 0x82 nanoslp syz-executor 75359 167306 65844 0 3 0x82 nanoslp syz-executor 42552 296 65844 0 3 0x82 nanoslp syz-executor 92352 86464 65844 0 3 0x82 wait syz-executor 65844 361772 28016 0 3 0x82 kqread syz-executor 28016 327707 76458 0 3 0x10008a sigsusp ksh 76458 300061 92425 0 3 0x98 kqread sshd-session 92425 321259 99489 0 3 0x92 kqread sshd-session 99489 56311 1 0 3 0x88 kqread sshd 35534 118891 48518 74 3 0x1100092 bpf pflogd 48518 4471 1 0 3 0x80 sbwait pflogd 44596 254951 37091 73 3 0x1100090 kqread syslogd 37091 34768 1 0 3 0x100082 sbwait syslogd 24930 25659 1 0 3 0x100080 kqread resolvd 69872 297718 90957 77 3 0x100092 kqread dhcpleased 98400 388265 90957 77 3 0x100092 kqread dhcpleased 90957 144948 1 0 3 0x80 kqread dhcpleased 56319 496776 0 0 3 0x14200 bored smr 42160 148707 0 0 2 0x14200 zerothread 5874 275205 0 0 3 0x14200 aiodoned aiodoned 75489 28927 0 0 3 0x14200 syncer update 19801 243041 0 0 3 0x14200 cleaner cleaner 27318 268364 0 0 3 0x14200 reaper reaper 95856 424885 0 0 3 0x14200 pgdaemon pagedaemon 5727 294612 0 0 3 0x14200 bored viomb 37455 488594 0 0 3 0x40014200 acpi0 acpi0 4570 358136 0 0 3 0x40014200 idle1 37699 407046 0 0 3 0x14200 bored softnet3 93976 426935 0 0 3 0x14200 bored softnet2 84697 317258 0 0 3 0x14200 bored softnet1 50376 458221 0 0 3 0x14200 bored softnet0 41033 377537 0 0 3 0x14200 bored systqmp 77451 8713 0 0 3 0x14200 bored systq 8700 439394 0 0 3 0x14200 tmoslp softclockmp 19379 241922 0 0 3 0x40014200 tmoslp softclock 99765 47940 0 0 3 0x40014200 idle0 1 215739 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 54013 (syz-executor) thread 0xffff80002a03e7b8 (65770) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff836331e0) #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 ufs_lookup+0x548 sys/ufs/ufs/ufs_lookup.c:256 #7 VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 #8 vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 #9 namei+0x7aa sys/kern/vfs_lookup.c:250 #10 vn_open+0x13f sys/kern/vfs_vnops.c:140 #11 sys_ktrace+0x9a sys/kern/kern_ktrace.c:542 #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 (0xfffffd8069c881b8) #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 vn_open+0x13f sys/kern/vfs_vnops.c:140 #8 sys_ktrace+0x9a sys/kern/kern_ktrace.c:542 #9 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] #9 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #10 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10197 11251K 11447K 166960K 11506 0 pcb 17 14K 16K 166960K 109 0 rtable 224 6K 6K 166960K 349 0 pf 35 17K 20K 166960K 54 0 ifaddr 42 7K 7K 166960K 48 0 ifgroup 55 2K 2K 166960K 68 0 counters 64 36K 36K 166960K 70 0 ioctlops 0 0K 4K 166960K 1497 0 iov 0 0K 12K 166960K 6 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1372 86K 86K 166960K 1456 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 6 0K 0K 166960K 7 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 19 69K 97K 166960K 217 0 sigio 0 0K 0K 166960K 2 0 proc 72 91K 128K 166960K 547 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 13 0 in_multi 95 7K 7K 166960K 102 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 55 254K 254K 166960K 55 0 exec 0 0K 1K 166960K 362 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 236 72K 74K 166960K 3733 0 UVM aobj 3 2K 2K 166960K 3 0 pinsyscall 45 90K 106K 166960K 1305 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 4 0 NDP 12 0K 2K 166960K 31 0 temp 39 6815K 6879K 166960K 4363 0 kqueue 15 24K 26K 166960K 50 0 SYN cache 2 16K 16K 166960K 2 0 ddb{1}> 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 39 0 35 1 0 1 1 0 8 0 rtentry 112 111 0 6 4 0 4 4 0 8 0 unpcb 144 79 0 62 1 0 1 1 0 8 0 syncache 336 6 0 6 2 1 1 1 0 8 1 tcpqe 32 2 0 2 1 0 1 1 0 8 1 tcpcb 808 33 0 26 2 0 2 2 0 8 1 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 195 0 185 7 0 7 7 0 8 5 nd6 136 24 0 2 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 pfstscr 40 1 0 1 1 0 1 1 0 8 1 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 1 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 pftag 88 1 0 0 1 0 1 1 0 8 0 pfstitem 24 26 0 0 1 0 1 1 0 8 0 pfstkey 128 28 0 2 1 0 1 1 0 8 0 pfstate 376 27 0 1 3 0 3 3 0 8 0 pfrule 1344 22 0 16 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 453 0 16 29 0 29 29 0 8 0 art_table 32 454 0 16 4 0 4 4 0 8 0 art_node 16 110 0 14 1 0 1 1 0 8 0 sysvmsgpl 40 33 0 1 1 0 1 1 0 8 0 semapl 112 4 0 0 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 1717 0 210 95 0 95 95 0 8 0 ffsino 272 1717 0 210 102 0 102 102 0 8 0 nchpl 144 2002 0 317 63 0 63 63 0 8 0 uvmvnodes 80 1872 0 0 39 0 39 39 0 8 0 vnodes 216 1872 0 0 104 0 104 104 0 8 0 namei 1024 6177 0 6176 3 1 2 2 0 8 1 percpumem 16 49 0 3 1 0 1 1 0 8 0 kstatmem 264 30 0 6 2 0 2 2 0 8 0 scxspl 216 5772 0 5772 3 2 1 2 1 8 1 plimitpl 152 42 0 25 1 0 1 1 0 8 0 sigapl 424 520 0 468 7 0 7 7 0 8 0 futexpl 64 1277 0 1273 1 0 1 1 0 8 0 knotepl 120 553 0 0 17 0 17 17 0 8 0 kqueuepl 216 58 0 46 1 0 1 1 0 8 0 pipepl 320 113 0 86 3 0 3 3 0 8 0 fdescpl 496 501 0 468 6 0 6 6 0 8 1 filepl 152 1986 0 1735 13 0 13 13 0 8 2 lockfpl 104 35 0 29 1 0 1 1 0 8 0 lockfspl 48 17 0 13 1 0 1 1 0 8 0 sessionpl 144 26 0 17 1 0 1 1 0 8 0 pgrppl 48 34 0 17 1 0 1 1 0 8 0 ucredpl 104 177 0 163 1 0 1 1 0 8 0 zombiepl 144 468 0 468 1 0 1 1 0 8 1 processpl 1160 520 0 468 5 0 5 5 0 8 0 procpl 648 665 0 604 6 0 6 6 0 8 0 sockpl 664 316 0 285 9 0 9 9 0 8 5 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 150 0 0 19 0 19 19 0 8 0 mcl2k 2048 28 0 0 4 0 4 4 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 261 0 0 17 0 17 17 0 8 0 bufpl 280 2324 0 100 159 0 159 159 0 8 0 anonpl 24 194577 0 191135 27 4 23 25 0 185 0 amapchunkpl 152 12654 0 12166 22 0 22 22 0 158 2 amappl16 200 5714 0 5700 5 4 1 5 0 8 0 amappl15 192 20 0 20 1 1 0 1 0 8 0 amappl14 184 124 0 111 1 0 1 1 0 8 0 amappl13 176 13 0 13 1 1 0 1 0 8 0 amappl12 168 1153 0 1120 4 1 3 3 0 8 0 amappl11 160 62 0 48 1 0 1 1 0 8 0 amappl10 152 15 0 15 1 1 0 1 0 8 0 amappl9 144 148 0 148 1 1 0 1 0 8 0 amappl8 136 29 0 27 1 0 1 1 0 8 0 amappl7 128 110 0 97 1 0 1 1 0 8 0 amappl6 120 168 0 165 1 0 1 1 0 8 0 amappl5 112 218 0 207 1 0 1 1 0 8 0 amappl4 104 325 0 306 1 0 1 1 0 8 0 amappl3 96 2141 0 2045 3 0 3 3 0 8 0 amappl2 88 795 0 710 3 0 3 3 0 8 0 amappl1 80 8498 0 7905 14 0 14 14 0 8 0 amappl 88 3335 0 3164 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 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 501 0 468 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 501 0 468 1 0 1 1 0 8 0 vmmpekpl 168 5869 0 5835 2 0 2 2 0 8 0 vmmpepl 168 42255 0 40354 90 0 90 90 0 357 5 vmsppl 448 500 0 468 6 1 5 5 0 8 0 rwobjpl 56 19797 0 16967 41 0 41 41 0 8 0 pdppl 4096 1009 0 936 103 30 73 87 0 8 0 pvpl 32 11639 0 0 94 0 94 94 0 265 0 pmappl 248 500 0 468 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 398 0 35 11 0 11 11 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffffffff83472ff0) 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: 0x79b306f9ad00, count: 12 ddb{0}> trace x86_ipi_db(ffffffff83472ff0) 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: 0x79b306f9ad00, count: -3 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x25: addq $0x8,%rsp db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83036195) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371c7e28,ffff8000371c7e28,ecfb5d45313973) at ufs_dirbadentry VOP_LOOKUP(fffffd80618079a8,ffff8000371c8130,ffff8000371c8160) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371c8100) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371c8100) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371c8100,102,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 sys_ktrace(ffff80002a03e7b8,ffff8000371c82e0,ffff8000371c8230) at sys_ktrace+0x9a sys/kern/kern_ktrace.c:542 syscall(ffff8000371c82e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371c82e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf12cf8ba2c0, count: 5 ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83036195) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371c7e28,ffff8000371c7e28,ecfb5d45313973) at ufs_dirbadentry VOP_LOOKUP(fffffd80618079a8,ffff8000371c8130,ffff8000371c8160) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371c8100) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371c8100) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371c8100,102,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 sys_ktrace(ffff80002a03e7b8,ffff8000371c82e0,ffff8000371c8230) at sys_ktrace+0x9a sys/kern/kern_ktrace.c:542 syscall(ffff8000371c82e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371c82e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xf12cf8ba2c0, count: -10