panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 64469 74999 0 0 0 0 syz-executor * 42413 74999 0 0 0x4000000 1K 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(ffff8000371e1de8,ffff8000371e1de8,4a4d4d1252dec50f) at ufs_dirbadentry VOP_LOOKUP(fffffd806b9322a8,ffff8000371e2060,ffff8000371e2090) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371e2030) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371e2030) at namei+0x7aa sys/kern/vfs_lookup.c:250 domknodat(ffff8000ffff1978,ffffff9c,20000000,2000,2e00) at domknodat+0xb4 sys/kern/vfs_syscalls.c:1576 syscall(ffff8000371e2230) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371e2230) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb3b51e31540, 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{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(ffffffff8302e260) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371e1de8,ffff8000371e1de8,4a4d4d1252dec50f) at ufs_dirbadentry VOP_LOOKUP(fffffd806b9322a8,ffff8000371e2060,ffff8000371e2090) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371e2030) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371e2030) at namei+0x7aa sys/kern/vfs_lookup.c:250 domknodat(ffff8000ffff1978,ffffff9c,20000000,2000,2e00) at domknodat+0xb4 sys/kern/vfs_syscalls.c:1576 syscall(ffff8000371e2230) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371e2230) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb3b51e31540, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000371e1c10 rbx 0xffff800029b7cdbf rdx 0xffff8000012a2700 rcx 0xffff8000ffff1978 rax 0xffff800029b7bff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x5f8dc28a80e5f6c7 r11 0x63bb35c9761d6c8 r12 0xffff800029b7cbc0 r13 0 r14 0 r15 0x1 rip 0xffffffff823851f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000371e1c00 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor) tid=42413 pid=74999 tcnt=2 stat=onproc flags process=0 proc=4000000 runpri=17, usrpri=86, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffff1468,0xffffffff835f0b50 process=0xffff8000fffecdb8 user=0xffff8000371dd000, vmspace=0xfffffd806be75728 estcpu=36, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 74999 64469 9525 0 7 0 syz-executor *74999 42413 9525 0 7 0x4000000 syz-executor 72853 14556 81946 -1 3 0x90 nanoslp syz-executor 72853 98144 81946 -1 3 0x4000090 kqread syz-executor 72853 404996 81946 -1 3 0x4000090 fsleep syz-executor 44863 427086 14276 0 3 0x80 nanoslp syz-executor 44863 64548 14276 0 3 0x4000080 pppxread syz-executor 44863 95091 14276 0 3 0x4000080 fsleep syz-executor 74126 249443 14194 0 3 0x80 nanoslp syz-executor 74126 384544 14194 0 3 0x4000080 kqread syz-executor 74126 145699 14194 0 3 0x4000080 fsleep syz-executor 63666 265196 6931 0 3 0x80 nanoslp syz-executor 63666 366992 6931 0 3 0x4000080 ttyout syz-executor 63666 102333 6931 0 3 0x4000080 fsleep syz-executor 63666 126261 6931 0 3 0x4000080 fsleep syz-executor 61480 345581 69500 0 3 0x80 nanoslp syz-executor 61480 412393 69500 0 3 0x4000080 fsleep syz-executor 61480 28029 69500 0 3 0x4000080 sbwait syz-executor 6931 458765 84516 0 3 0x82 nanoslp syz-executor 68946 58610 84516 0 3 0x82 nanoslp syz-executor 9525 391196 84516 0 3 0x82 nanoslp syz-executor 81946 440214 84516 0 3 0x82 nanoslp syz-executor 14194 489243 84516 0 3 0x82 nanoslp syz-executor 14276 192940 84516 0 3 0x82 nanoslp syz-executor 69500 244409 84516 0 3 0x82 nanoslp syz-executor 84516 450545 59857 0 3 0x82 wait syz-executor 59857 218070 5319 0 3 0x10008a sigsusp ksh 5319 29597 32080 0 3 0x98 kqread sshd-session 32080 447775 61474 0 3 0x92 kqread sshd-session 72232 387415 1 0 3 0x100083 ttyin getty 61474 136388 1 0 3 0x88 kqread sshd 36726 162805 95748 74 3 0x1100092 bpf pflogd 95748 487659 1 0 3 0x80 sbwait pflogd 28452 65781 45357 73 3 0x1100090 kqread syslogd 45357 487312 1 0 3 0x100082 sbwait syslogd 50114 270250 1 0 3 0x100080 kqread resolvd 80233 29021 46147 77 3 0x100092 kqread dhcpleased 12505 564 46147 77 3 0x100092 kqread dhcpleased 46147 21217 1 0 3 0x80 kqread dhcpleased 48480 14251 0 0 3 0x14200 bored smr 20286 169567 0 0 3 0x14200 pgzero zerothread 41914 324972 0 0 3 0x14200 aiodoned aiodoned 82513 130882 0 0 3 0x14200 syncer update 26750 431091 0 0 3 0x14200 cleaner cleaner 76235 456303 0 0 3 0x14200 reaper reaper 68189 402870 0 0 3 0x14200 pgdaemon pagedaemon 17686 486847 0 0 3 0x14200 bored viomb 84773 20095 0 0 3 0x40014200 acpi0 acpi0 40421 286609 0 0 3 0x40014200 idle1 34209 112068 0 0 3 0x14200 bored softnet3 89745 454551 0 0 3 0x14200 bored softnet2 1354 36143 0 0 3 0x14200 bored softnet1 53903 406057 0 0 3 0x14200 bored softnet0 86336 329998 0 0 3 0x14200 bored systqmp 80875 242283 0 0 3 0x14200 bored systq 23759 173784 0 0 3 0x14200 tmoslp softclockmp 77543 359413 0 0 3 0x40014200 tmoslp softclock 35226 379753 0 0 3 0x40014200 idle0 1 118893 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 74999 (syz-executor) thread 0xffff8000ffff1978 (42413) 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 __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 domknodat+0xb4 sys/kern/vfs_syscalls.c:1576 #11 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] #11 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #12 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd8071321b48) #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 domknodat+0xb4 sys/kern/vfs_syscalls.c:1576 #8 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] #8 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10193 11187K 11316K 166960K 11423 0 pcb 18 12K 12K 166960K 30 0 rtable 240 6K 7K 166960K 357 0 pf 34 17K 18K 166960K 51 0 ifaddr 43 7K 7K 166960K 48 0 ifgroup 55 2K 2K 166960K 61 0 counters 64 36K 36K 166960K 70 0 ioctlops 0 0K 4K 166960K 1491 0 iov 0 0K 12K 166960K 7 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1374 86K 86K 166960K 1552 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 3 0K 0K 166960K 3 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 17 61K 93K 166960K 213 0 sigio 0 0K 0K 166960K 2 0 proc 72 91K 115K 166960K 531 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 2 0K 0K 166960K 17 0 in_multi 99 7K 7K 166960K 104 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 55 254K 254K 166960K 55 0 exec 0 0K 1K 166960K 370 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 247 73K 77K 166960K 3656 0 UVM aobj 7 2K 2K 166960K 7 0 pinsyscall 42 84K 106K 166960K 1292 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 37 6814K 6878K 166960K 8781 0 kqueue 15 24K 26K 166960K 45 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 36 0 33 1 0 1 1 0 8 0 rtentry 112 114 0 1 4 0 4 4 0 8 0 unpcb 144 87 0 65 1 0 1 1 0 8 0 syncache 336 3 0 3 1 0 1 1 0 8 1 tcpcb 808 26 0 21 1 0 1 1 0 8 0 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 125 0 113 2 0 2 2 0 8 0 nd6 136 27 0 0 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1168 3 0 3 1 0 1 1 0 8 1 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 21 0 0 1 0 1 1 0 8 0 pfstkey 128 21 0 0 1 0 1 1 0 8 0 pfstate 376 21 0 0 3 0 3 3 0 8 0 pfrule 1344 21 0 15 2 0 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 458 0 0 29 0 29 29 0 8 0 art_table 32 459 0 0 4 0 4 4 0 8 0 art_node 16 113 0 10 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 0 1 0 1 1 0 8 0 semapl 112 1 0 0 1 0 1 1 0 8 0 shmpl 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 1803 0 291 95 0 95 95 0 8 0 ffsino 272 1803 0 291 101 0 101 101 0 8 0 nchpl 144 2088 0 400 63 0 63 63 0 8 0 uvmvnodes 80 1960 0 0 40 0 40 40 0 8 0 vnodes 216 1960 0 0 109 0 109 109 0 8 0 namei 1024 7016 0 7015 1 0 1 1 0 8 0 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 5828 0 5828 3 1 2 2 1 8 2 plimitpl 152 40 0 22 1 0 1 1 0 8 0 sigapl 424 514 0 465 7 0 7 7 0 8 1 futexpl 64 1300 0 1294 1 0 1 1 0 8 0 knotepl 120 291 0 0 9 0 9 9 0 8 0 kqueuepl 216 43 0 31 1 0 1 1 0 8 0 pipepl 320 117 0 89 3 0 3 3 0 8 0 fdescpl 496 496 0 465 5 0 5 5 0 8 0 filepl 152 2457 0 2189 13 0 13 13 0 8 1 lockfpl 104 103 0 98 1 0 1 1 0 8 0 lockfspl 48 17 0 13 1 0 1 1 0 8 0 sessionpl 144 22 0 13 1 0 1 1 0 8 0 pgrppl 48 31 0 14 1 0 1 1 0 8 0 ucredpl 104 555 0 541 1 0 1 1 0 8 0 zombiepl 144 467 0 465 1 0 1 1 0 8 0 processpl 1160 514 0 465 5 0 5 5 0 8 1 procpl 648 660 0 599 6 0 6 6 0 8 0 sockpl 664 248 0 211 4 0 4 4 0 8 0 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 153 0 0 20 0 20 20 0 8 0 mcl2k 2048 18 0 0 3 0 3 3 0 8 0 mtagpl 96 5 0 0 1 0 1 1 0 8 0 mbufpl 256 164 0 0 10 0 10 10 0 8 0 bufpl 280 2410 0 93 166 0 166 166 0 8 0 anonpl 24 132672 0 128828 35 1 34 34 0 185 10 amapchunkpl 152 11406 0 10860 26 0 26 26 0 158 2 amappl16 200 3155 0 3130 5 2 3 5 0 8 1 amappl15 192 9 0 9 1 1 0 1 0 8 0 amappl14 184 117 0 105 1 0 1 1 0 8 0 amappl13 176 9 0 9 1 1 0 1 0 8 0 amappl12 168 1139 0 1108 3 1 2 2 0 8 0 amappl11 160 51 0 37 1 0 1 1 0 8 0 amappl10 152 13 0 12 1 0 1 1 0 8 0 amappl9 144 137 0 137 1 1 0 1 0 8 0 amappl8 136 31 0 28 1 0 1 1 0 8 0 amappl7 128 109 0 97 1 0 1 1 0 8 0 amappl6 120 181 0 180 1 0 1 1 0 8 0 amappl5 112 133 0 121 1 0 1 1 0 8 0 amappl4 104 304 0 283 1 0 1 1 0 8 0 amappl3 96 2211 0 2109 3 0 3 3 0 8 0 amappl2 88 764 0 679 3 0 3 3 0 8 0 amappl1 80 7758 0 7186 15 0 15 15 0 8 2 amappl 88 3274 0 3089 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 6 0 0 1 0 1 1 0 8 0 uaddrrnd 24 496 0 465 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 496 0 465 1 0 1 1 0 8 0 vmmpekpl 168 5474 0 5437 2 0 2 2 0 8 0 vmmpepl 168 38345 0 36463 85 0 85 85 0 357 0 vmsppl 448 495 0 465 6 1 5 5 0 8 1 rwobjpl 56 16576 0 13656 42 0 42 42 0 8 0 pdppl 4096 999 0 930 101 30 71 85 0 8 2 pvpl 32 11865 0 0 96 0 96 96 0 265 0 pmappl 248 495 0 465 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 380 0 33 11 0 11 11 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffffffff83504ff0) 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: 0x775390759790, count: 12 ddb{0}> trace x86_ipi_db(ffffffff83504ff0) 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: 0x775390759790, 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(ffffffff8302e260) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371e1de8,ffff8000371e1de8,4a4d4d1252dec50f) at ufs_dirbadentry VOP_LOOKUP(fffffd806b9322a8,ffff8000371e2060,ffff8000371e2090) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371e2030) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371e2030) at namei+0x7aa sys/kern/vfs_lookup.c:250 domknodat(ffff8000ffff1978,ffffff9c,20000000,2000,2e00) at domknodat+0xb4 sys/kern/vfs_syscalls.c:1576 syscall(ffff8000371e2230) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371e2230) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb3b51e31540, count: 6 ddb{1}> 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(ffff8000371e1de8,ffff8000371e1de8,4a4d4d1252dec50f) at ufs_dirbadentry VOP_LOOKUP(fffffd806b9322a8,ffff8000371e2060,ffff8000371e2090) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371e2030) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371e2030) at namei+0x7aa sys/kern/vfs_lookup.c:250 domknodat(ffff8000ffff1978,ffffff9c,20000000,2000,2e00) at domknodat+0xb4 sys/kern/vfs_syscalls.c:1576 syscall(ffff8000371e2230) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371e2230) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xb3b51e31540, count: -9