panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *381131 92138 0 0 0x4000000 1K syz-executor 252477 27130 0 0x2 0 0 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(ffff8000357af848,ffff8000357af848,fe9097b45f6fb4c4) at ufs_dirbadentry VOP_LOOKUP(fffffd8068abeb08,ffff8000357afab8,ffff8000357afae8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000357afa88) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000357afa88) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofchmodat(ffff80003559d978,ffffff9c,20000140,208,0) at dofchmodat+0x152 sys/kern/vfs_syscalls.c:2362 syscall(ffff8000357afc80) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000357afc80) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc8dc6ed55f0, 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(ffff8000357af848,ffff8000357af848,fe9097b45f6fb4c4) at ufs_dirbadentry VOP_LOOKUP(fffffd8068abeb08,ffff8000357afab8,ffff8000357afae8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000357afa88) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000357afa88) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofchmodat(ffff80003559d978,ffffff9c,20000140,208,0) at dofchmodat+0x152 sys/kern/vfs_syscalls.c:2362 syscall(ffff8000357afc80) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000357afc80) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc8dc6ed55f0, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff8000357af670 rbx 0xffff800029b7cdbf rdx 0xffff8000012a04c0 rcx 0xffff80003559d978 rax 0xffff800029b7bff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x60639a4ae6f64123 r11 0xe1843394d5f556a4 r12 0xffff800029b7cbc0 r13 0 r14 0 r15 0x1 rip 0xffffffff823851f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000357af660 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor) tid=381131 pid=92138 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=17, usrpri=72, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff800035194a50,0xffff80003559ca58 process=0xffff800035190db8 user=0xffff8000357aa000, vmspace=0xfffffd806bede1e0 estcpu=22, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 92138 102796 86705 0 2 0 syz-executor 92138 234793 86705 0 2 0x4000000 syz-executor *92138 381131 86705 0 7 0x4000000 syz-executor 86530 425139 69723 0 2 0 syz-executor 86530 490152 69723 0 3 0x4000080 fsleep syz-executor 86530 371305 69723 0 3 0x4000080 fsleep syz-executor 86670 102777 60154 0 2 0 syz-executor 86670 410907 60154 0 3 0x4000080 fsleep syz-executor 27130 252477 41718 0 7 0x2 syz-executor 86705 113688 41718 0 3 0x82 nanoslp syz-executor 60154 297049 41718 0 3 0x82 nanoslp syz-executor 69723 112202 41718 0 3 0x82 nanoslp syz-executor 41718 296074 91410 0 3 0x82 wait syz-executor 91410 229054 56478 0 3 0x10008a sigsusp ksh 56478 341547 14846 0 3 0x98 kqread sshd-session 14846 480275 49369 0 3 0x92 kqread sshd-session 86438 432370 1 0 3 0x100083 ttyin getty 49369 416040 1 0 3 0x88 kqread sshd 12624 278283 62566 74 3 0x1100092 bpf pflogd 62566 86981 1 0 3 0x80 sbwait pflogd 70761 397912 76925 73 3 0x1100090 kqread syslogd 76925 153507 1 0 3 0x100082 sbwait syslogd 51840 62071 1 0 3 0x100080 kqread resolvd 43303 200228 91231 77 3 0x100092 kqread dhcpleased 29335 440980 91231 77 3 0x100092 kqread dhcpleased 91231 262694 1 0 3 0x80 kqread dhcpleased 27776 420874 0 0 3 0x14200 pause smr 9046 308733 0 0 2 0x14200 zerothread 1519 388040 0 0 3 0x14200 aiodoned aiodoned 28461 435852 0 0 3 0x14200 syncer update 11200 249194 0 0 3 0x14200 cleaner cleaner 9539 466330 0 0 3 0x14200 reaper reaper 59806 166407 0 0 3 0x14200 pgdaemon pagedaemon 52246 74006 0 0 3 0x14200 bored viomb 5621 78067 0 0 3 0x40014200 acpi0 acpi0 13970 257094 0 0 3 0x40014200 idle1 49719 370173 0 0 3 0x14200 bored softnet3 99507 314616 0 0 3 0x14200 bored softnet2 18803 354797 0 0 3 0x14200 bored softnet1 19183 285495 0 0 3 0x14200 bored softnet0 90836 465713 0 0 3 0x14200 bored systqmp 46238 36853 0 0 3 0x14200 bored systq 35284 487518 0 0 3 0x14200 tmoslp softclockmp 81909 303191 0 0 3 0x40014200 tmoslp softclock 69675 109847 0 0 3 0x40014200 idle0 1 403846 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 92138 (syz-executor) thread 0xffff80003559d978 (381131) 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 dofchmodat+0x152 sys/kern/vfs_syscalls.c:2362 #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 (0xfffffd806e0395f8) #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 dofchmodat+0x152 sys/kern/vfs_syscalls.c:2362 #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 10194 11187K 11437K 166960K 11535 0 pcb 18 12K 12K 166960K 30 0 rtable 234 6K 7K 166960K 361 0 pf 34 17K 19K 166960K 48 0 ifaddr 43 7K 7K 166960K 45 0 ifgroup 55 2K 2K 166960K 55 0 counters 64 36K 36K 166960K 64 0 ioctlops 0 0K 4K 166960K 1491 0 iov 0 0K 8K 166960K 10 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1371 86K 86K 166960K 1461 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 5 0 VM map 2 1K 1K 166960K 2 0 sem 9 0K 0K 166960K 9 0 dirhash 12 2K 2K 166960K 18 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 13 45K 89K 166960K 258 0 sigio 0 0K 0K 166960K 4 0 proc 72 91K 140K 166960K 553 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 16 0 in_multi 99 7K 7K 166960K 100 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 61 281K 281K 166960K 61 0 exec 0 0K 1K 166960K 381 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 205 72K 76K 166960K 4012 0 UVM aobj 11 2K 2K 166960K 12 0 pinsyscall 38 76K 102K 166960K 1360 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 1 0 NDP 12 0K 2K 166960K 28 0 temp 40 6819K 6946K 166960K 5637 0 kqueue 14 22K 26K 166960K 43 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 47 0 44 1 0 1 1 0 8 0 rtentry 112 111 0 1 4 0 4 4 0 8 0 unpcb 144 94 0 76 1 0 1 1 0 8 0 syncache 336 3 0 3 2 2 0 1 0 8 0 tcpcb 808 34 0 30 1 0 1 1 0 8 0 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 134 0 126 2 0 2 2 0 8 1 nd6 136 24 0 0 1 0 1 1 0 8 0 kcovpl 48 8 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 31 0 0 1 0 1 1 0 8 0 pfstkey 128 31 0 0 1 0 1 1 0 8 0 pfstate 376 31 0 0 4 0 4 4 0 8 0 pfrule 1344 23 0 17 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 0 29 0 29 29 0 8 0 art_table 32 454 0 0 4 0 4 4 0 8 0 art_node 16 110 0 10 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 7 1 0 1 1 0 8 0 semapl 112 7 0 0 1 0 1 1 0 8 0 shmpl 112 9 0 1 1 0 1 1 0 8 0 dirhash 1024 21 0 4 3 0 3 3 0 8 0 dino2pl 256 1761 0 251 95 0 95 95 0 8 0 ffsino 272 1761 0 251 101 0 101 101 0 8 0 nchpl 144 2120 0 433 63 0 63 63 0 8 0 uvmvnodes 80 1928 0 0 40 0 40 40 0 8 0 vnodes 216 1928 0 0 108 0 108 108 0 8 0 namei 1024 6597 0 6596 2 0 2 2 0 8 1 percpumem 16 46 0 0 1 0 1 1 0 8 0 kstatmem 264 24 0 0 2 0 2 2 0 8 0 scxspl 216 6176 0 6175 3 2 1 2 1 8 0 plimitpl 152 42 0 25 1 0 1 1 0 8 0 sigapl 424 566 0 521 8 1 7 7 0 8 1 futexpl 64 1891 0 1888 1 0 1 1 0 8 0 knotepl 120 313 0 0 10 0 10 10 0 8 0 kqueuepl 216 118 0 108 5 0 5 5 0 8 4 pipepl 320 117 0 90 3 0 3 3 0 8 0 fdescpl 496 548 0 521 5 0 5 5 0 8 1 filepl 152 2226 0 1984 13 0 13 13 0 8 3 lockfpl 104 38 0 36 1 0 1 1 0 8 0 lockfspl 48 20 0 18 1 0 1 1 0 8 0 sessionpl 144 22 0 13 1 0 1 1 0 8 0 pgrppl 48 30 0 13 1 0 1 1 0 8 0 ucredpl 104 278 0 265 1 0 1 1 0 8 0 zombiepl 144 525 0 521 1 0 1 1 0 8 0 processpl 1160 566 0 521 5 0 5 5 0 8 1 procpl 648 804 0 754 7 1 6 6 0 8 0 sockpl 664 276 0 247 4 0 4 4 0 8 1 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 136 0 0 17 0 17 17 0 8 0 mcl2k 2048 32 0 0 4 0 4 4 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 140 0 0 9 0 9 9 0 8 0 bufpl 280 2399 0 98 165 0 165 165 0 8 0 anonpl 24 160672 0 157454 56 2 54 54 0 185 29 amapchunkpl 152 13018 0 12620 23 0 23 23 0 158 3 amappl16 200 4434 0 4410 20 9 11 18 0 8 8 amappl15 192 5 0 5 1 1 0 1 0 8 0 amappl14 184 116 0 104 1 0 1 1 0 8 0 amappl13 176 9 0 9 1 1 0 1 0 8 0 amappl12 168 1206 0 1179 4 1 3 3 0 8 1 amappl11 160 55 0 41 1 0 1 1 0 8 0 amappl10 152 15 0 14 1 0 1 1 0 8 0 amappl9 144 196 0 196 1 1 0 1 0 8 0 amappl8 136 25 0 22 1 0 1 1 0 8 0 amappl7 128 111 0 99 1 0 1 1 0 8 0 amappl6 120 179 0 178 1 0 1 1 0 8 0 amappl5 112 132 0 121 1 0 1 1 0 8 0 amappl4 104 321 0 301 1 0 1 1 0 8 0 amappl3 96 2224 0 2146 3 0 3 3 0 8 0 amappl2 88 808 0 729 2 0 2 2 0 8 0 amappl1 80 7971 0 7414 14 0 14 14 0 8 1 amappl 88 3629 0 3486 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 11 0 1 1 0 1 1 0 8 0 uaddrrnd 24 548 0 521 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 548 0 521 1 0 1 1 0 8 0 vmmpekpl 168 5850 0 5814 2 0 2 2 0 8 0 vmmpepl 168 42109 0 40460 97 0 97 97 0 357 13 vmsppl 448 547 0 521 6 1 5 5 0 8 1 rwobjpl 56 18246 0 15411 43 0 43 43 0 8 2 pdppl 4096 1103 0 1042 101 30 71 83 0 8 10 pvpl 32 15722 0 0 127 0 127 127 0 265 0 pmappl 248 547 0 521 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 377 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(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 __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 intr_handler(ffff80002a16bd90,ffff800000079f80) at intr_handler+0xe1 sys/arch/amd64/amd64/intr.c:553 Xintr_ioapic_edge23_untramp() at Xintr_ioapic_edge23_untramp+0x18f __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 syscall(ffff80002a16bf60) at syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a16bf60) at syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75b433e47760, count: 6 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 __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 intr_handler(ffff80002a16bd90,ffff800000079f80) at intr_handler+0xe1 sys/arch/amd64/amd64/intr.c:553 Xintr_ioapic_edge23_untramp() at Xintr_ioapic_edge23_untramp+0x18f __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 syscall(ffff80002a16bf60) at syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff80002a16bf60) at syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75b433e47760, count: -9 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(ffff8000357af848,ffff8000357af848,fe9097b45f6fb4c4) at ufs_dirbadentry VOP_LOOKUP(fffffd8068abeb08,ffff8000357afab8,ffff8000357afae8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000357afa88) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000357afa88) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofchmodat(ffff80003559d978,ffffff9c,20000140,208,0) at dofchmodat+0x152 sys/kern/vfs_syscalls.c:2362 syscall(ffff8000357afc80) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000357afc80) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc8dc6ed55f0, 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(ffff8000357af848,ffff8000357af848,fe9097b45f6fb4c4) at ufs_dirbadentry VOP_LOOKUP(fffffd8068abeb08,ffff8000357afab8,ffff8000357afae8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000357afa88) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000357afa88) at namei+0x7aa sys/kern/vfs_lookup.c:250 dofchmodat(ffff80003559d978,ffffff9c,20000140,208,0) at dofchmodat+0x152 sys/kern/vfs_syscalls.c:2362 syscall(ffff8000357afc80) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000357afc80) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc8dc6ed55f0, count: -9