panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *169277 56317 0 0 0x4000000 0K syz-executor 364827 35003 0 0 0x9 1 sshd 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(ffff80002a05a668,ffff80002a05a668,4c622b4d4ea12b8) at ufs_dirbadentry VOP_LOOKUP(fffffd8069c2c558,ffff80002a05a838,ffff80002a05a868) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a05a808) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a05a808) at namei+0x7aa sys/kern/vfs_lookup.c:250 dounlinkat(ffff8000ffff2530,ffffff9c,20000e40,0) at dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 syscall(ffff80002a05a9e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a05a9e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6fd8a744250, 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(ffff80002a05a668,ffff80002a05a668,4c622b4d4ea12b8) at ufs_dirbadentry VOP_LOOKUP(fffffd8069c2c558,ffff80002a05a838,ffff80002a05a868) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a05a808) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a05a808) at namei+0x7aa sys/kern/vfs_lookup.c:250 dounlinkat(ffff8000ffff2530,ffffff9c,20000e40,0) at dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 syscall(ffff80002a05a9e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a05a9e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6fd8a744250, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a05a490 rbx 0xffffffff83505dbf cpu_info_full_primary+0x2dbf rdx 0xffff8000012a2ec0 rcx 0xffff8000ffff2530 rax 0xffffffff83504ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x3a96707949f4d441 r11 0x292337d06bc11a9e r12 0xffffffff83505bc0 cpu_info_full_primary+0x2bc0 r13 0 r14 0 r15 0x1 rip 0xffffffff823851f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a05a480 ss 0 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=169277 pid=56317 tcnt=3 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=0xffff8000371c3c00,0xffffffff835f0b50 process=0xffff8000ffff5b48 user=0xffff80002a055000, vmspace=0xfffffd806cd0ca98 estcpu=36, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 56317 299156 67831 0 2 0 syz-executor 56317 172799 67831 0 2 0x4000000 syz-executor *56317 169277 67831 0 7 0x4000000 syz-executor 45574 465236 83849 0 2 0 syz-executor 45574 423158 83849 0 3 0x4000080 fsleep syz-executor 18058 26975 35003 0 2 0x2 sshd-session 65179 400620 98030 0 2 0 syz-executor 65179 388585 98030 0 3 0x4000080 fsleep syz-executor 11749 183683 70373 0 2 0 syz-executor 11749 18404 70373 0 3 0x4000080 kqread syz-executor 19431 133346 55666 0 2 0 syz-executor 19431 14068 55666 0 3 0x4000080 fsleep syz-executor 19431 453522 55666 0 3 0x4000080 fsleep syz-executor 20385 185372 0 0 3 0x14200 bored sosplice 29358 203751 1 0 3 0x100083 ttyin getty 55666 144280 68192 0 3 0x82 nanoslp syz-executor 83849 50872 68192 0 2 0x482 syz-executor 67831 475181 68192 0 2 0x482 syz-executor 98030 234238 68192 0 2 0x482 syz-executor 70373 319988 68192 0 2 0x482 syz-executor 68192 435221 34602 0 3 0x82 wait syz-executor 34602 261385 21234 0 3 0x10008a sigsusp ksh 21234 340178 55742 0 3 0x98 kqread sshd-session 55742 173551 35003 0 3 0x92 kqread sshd-session 35003 364827 1 0 7 0x9 sshd 16442 382772 62010 74 3 0x1100092 bpf pflogd 62010 274363 1 0 3 0x80 sbwait pflogd 28113 340130 172 73 3 0x1100090 kqread syslogd 172 496388 1 0 3 0x100082 sbwait syslogd 80847 190761 1 0 3 0x100080 kqread resolvd 54210 441655 16212 77 3 0x100092 kqread dhcpleased 34764 94353 16212 77 3 0x100092 kqread dhcpleased 16212 37913 1 0 3 0x80 kqread dhcpleased 3430 522128 0 0 3 0x14200 bored smr 56134 61604 0 0 2 0x14200 zerothread 61335 216076 0 0 3 0x14200 aiodoned aiodoned 68646 255932 0 0 3 0x14200 syncer update 95568 280072 0 0 3 0x14200 cleaner cleaner 5790 437433 0 0 3 0x14200 reaper reaper 92764 407877 0 0 3 0x14200 pgdaemon pagedaemon 70167 412758 0 0 3 0x14200 bored viomb 42053 367987 0 0 3 0x40014200 acpi0 acpi0 70392 437040 0 0 3 0x40014200 idle1 74159 291493 0 0 3 0x14200 bored softnet3 37915 127088 0 0 3 0x14200 bored softnet2 24936 369608 0 0 3 0x14200 bored softnet1 91603 239700 0 0 3 0x14200 bored softnet0 96991 487206 0 0 3 0x14200 bored systqmp 40566 248735 0 0 3 0x14200 bored systq 14425 254906 0 0 3 0x14200 tmoslp softclockmp 71626 482854 0 0 2 0x40014200 softclock 16593 273762 0 0 3 0x40014200 idle0 1 301158 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 56317 (syz-executor) thread 0xffff8000ffff2530 (169277) 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 ufsdirhash_build+0x985 sys/ufs/ufs/ufs_dirhash.c:208 #7 ufs_lookup+0x360 sys/ufs/ufs/ufs_lookup.c:198 #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 dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 #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 (0xfffffd80688e4f80) #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 dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10190 11115K 11347K 166960K 11352 0 pcb 17 12K 12K 166960K 32 0 rtable 236 6K 6K 166960K 350 0 pf 35 17K 19K 166960K 51 0 ifaddr 44 7K 7K 166960K 47 0 ifgroup 55 2K 2K 166960K 60 0 counters 64 36K 36K 166960K 66 0 ioctlops 0 0K 4K 166960K 1490 0 iov 0 0K 4K 166960K 2 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1371 86K 86K 166960K 1444 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 21 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 15 53K 97K 166960K 198 0 sigio 0 0K 0K 166960K 3 0 proc 71 91K 140K 166960K 548 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 6 0 in_multi 103 7K 7K 166960K 105 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 402 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 228 73K 74K 166960K 3419 0 UVM aobj 5 4K 4K 166960K 5 0 pinsyscall 42 84K 110K 166960K 1281 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 30 0 temp 35 6814K 6878K 166960K 5514 0 kqueue 14 22K 26K 166960K 40 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 37 0 32 1 0 1 1 0 8 0 rtentry 112 112 0 1 4 0 4 4 0 8 0 unpcb 144 68 0 49 1 0 1 1 0 8 0 syncache 336 5 0 5 1 0 1 1 0 8 1 tcpcb 808 29 0 20 2 0 2 2 0 8 1 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 121 0 109 2 0 2 2 0 8 0 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 pffrent 40 1 0 1 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 22 0 0 1 0 1 1 0 8 0 pfstkey 128 22 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 454 0 0 29 0 29 29 0 8 0 art_table 32 455 0 0 4 0 4 4 0 8 0 art_node 16 111 0 10 1 0 1 1 0 8 0 semapl 112 1 0 0 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 23 0 6 3 0 3 3 0 8 0 dino2pl 256 1673 0 163 95 0 95 95 0 8 0 ffsino 272 1673 0 163 101 0 101 101 0 8 0 nchpl 144 1946 0 260 63 0 63 63 0 8 0 uvmvnodes 80 1824 0 0 38 0 38 38 0 8 0 vnodes 216 1824 0 0 102 0 102 102 0 8 0 namei 1024 6154 0 6153 2 0 2 2 0 8 1 percpumem 16 47 0 1 1 0 1 1 0 8 0 kstatmem 264 26 0 2 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 0 1 1 0 8 1 scxspl 216 5733 0 5733 3 1 2 2 1 8 2 plimitpl 152 37 0 20 1 0 1 1 0 8 0 sigapl 424 500 0 451 7 0 7 7 0 8 1 futexpl 64 1164 0 1160 1 0 1 1 0 8 0 knotepl 120 366 0 0 12 0 12 12 0 8 0 kqueuepl 216 42 0 32 1 0 1 1 0 8 0 pipepl 320 114 0 86 3 0 3 3 0 8 0 fdescpl 496 481 0 451 6 0 6 6 0 8 1 filepl 152 1889 0 1639 11 0 11 11 0 8 0 lockfpl 104 23 0 20 1 0 1 1 0 8 0 lockfspl 48 13 0 10 1 0 1 1 0 8 0 sessionpl 144 25 0 15 1 0 1 1 0 8 0 pgrppl 48 33 0 15 1 0 1 1 0 8 0 ucredpl 104 114 0 101 1 0 1 1 0 8 0 zombiepl 144 454 0 451 1 0 1 1 0 8 0 processpl 1160 500 0 451 5 0 5 5 0 8 1 procpl 648 607 0 551 6 0 6 6 0 8 0 sockpl 664 227 0 191 4 0 4 4 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 124 0 0 16 0 16 16 0 8 0 mcl2k 2048 18 0 0 3 0 3 3 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 134 0 0 9 0 9 9 0 8 0 bufpl 280 3398 0 98 236 0 236 236 0 8 0 anonpl 24 142174 0 138750 46 0 46 46 0 185 20 amapchunkpl 152 10817 0 10362 22 0 22 22 0 158 2 amappl16 200 3771 0 3753 14 0 14 14 0 8 11 amappl15 192 11 0 11 2 2 0 1 0 8 0 amappl14 184 120 0 107 1 0 1 1 0 8 0 amappl13 176 12 0 12 1 1 0 1 0 8 0 amappl12 168 1133 0 1103 4 1 3 3 0 8 0 amappl11 160 53 0 39 1 0 1 1 0 8 0 amappl10 152 11 0 11 2 1 1 1 0 8 1 amappl9 144 136 0 136 1 1 0 1 0 8 0 amappl8 136 24 0 22 1 0 1 1 0 8 0 amappl7 128 117 0 104 1 0 1 1 0 8 0 amappl6 120 164 0 163 1 0 1 1 0 8 0 amappl5 112 140 0 127 1 0 1 1 0 8 0 amappl4 104 308 0 290 1 0 1 1 0 8 0 amappl3 96 2048 0 1959 3 0 3 3 0 8 0 amappl2 88 767 0 678 3 0 3 3 0 8 0 amappl1 80 8156 0 7520 15 0 15 15 0 8 1 amappl 88 3034 0 2874 6 1 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 4 0 0 1 0 1 1 0 8 0 uaddrrnd 24 481 0 451 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 481 0 451 1 0 1 1 0 8 0 vmmpekpl 168 5581 0 5542 2 0 2 2 0 8 0 vmmpepl 168 38607 0 36744 93 0 93 93 0 357 4 vmsppl 448 480 0 451 6 1 5 5 0 8 1 rwobjpl 56 17208 0 14388 41 0 41 41 0 8 1 pdppl 4096 969 0 902 105 32 73 87 0 8 6 pvpl 32 14166 0 0 115 0 115 115 0 265 0 pmappl 248 480 0 451 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 379 0 35 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(ffff80002a05a668,ffff80002a05a668,4c622b4d4ea12b8) at ufs_dirbadentry VOP_LOOKUP(fffffd8069c2c558,ffff80002a05a838,ffff80002a05a868) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff80002a05a808) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff80002a05a808) at namei+0x7aa sys/kern/vfs_lookup.c:250 dounlinkat(ffff8000ffff2530,ffffff9c,20000e40,0) at dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1852 syscall(ffff80002a05a9e0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a05a9e0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6fd8a744250, 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 __mp_lock(ffffffff8358f4c0) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff8358f4c0) at __mp_lock+0x192 sys/kern/kern_lock.c:144 ktrstruct(ffff80002a040018,ffffffff83033afb,ffff80002a081dc0,18) at ktrstruct+0xe2 sys/kern/kern_ktrace.c:307 doppoll(ffff80002a040018,6544f4dc660,3,0,ffff80002a081ecc,ffff80002a081f70) at doppoll+0x883 sys/kern/sys_generic.c:1023 sys_ppoll(ffff80002a040018,ffff80002a082020,ffff80002a081f70) at sys_ppoll+0x26f sys/kern/sys_generic.c:915 syscall(ffff80002a082020) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a082020) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x724cfd4f1700, count: 6 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 __mp_lock(ffffffff8358f4c0) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff8358f4c0) at __mp_lock+0x192 sys/kern/kern_lock.c:144 ktrstruct(ffff80002a040018,ffffffff83033afb,ffff80002a081dc0,18) at ktrstruct+0xe2 sys/kern/kern_ktrace.c:307 doppoll(ffff80002a040018,6544f4dc660,3,0,ffff80002a081ecc,ffff80002a081f70) at doppoll+0x883 sys/kern/sys_generic.c:1023 sys_ppoll(ffff80002a040018,ffff80002a082020,ffff80002a081f70) at sys_ppoll+0x26f sys/kern/sys_generic.c:915 syscall(ffff80002a082020) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a082020) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x724cfd4f1700, count: -9