panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *226544 89246 0 0 0x4000000 0K syz-executor 180201 31934 0 0x14000 0x200 1 reaper 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(ffff8000371ccb68,ffff8000371ccb68,f658fe108353fe5) at ufs_dirbadentry VOP_LOOKUP(fffffd8068fdd6c8,ffff8000371ccde8,ffff8000371cce18) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371ccdb8) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371ccdb8) at namei+0x7aa sys/kern/vfs_lookup.c:250 dorenameat(ffff80003579dc00,ffffff9c,20000000,ffffff9c,20000080) at dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 syscall(ffff8000371ccfb0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371ccfb0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x116467b8ac0, 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(ffffffff83036195) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371ccb68,ffff8000371ccb68,f658fe108353fe5) at ufs_dirbadentry VOP_LOOKUP(fffffd8068fdd6c8,ffff8000371ccde8,ffff8000371cce18) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371ccdb8) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371ccdb8) at namei+0x7aa sys/kern/vfs_lookup.c:250 dorenameat(ffff80003579dc00,ffffff9c,20000000,ffffff9c,20000080) at dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 syscall(ffff8000371ccfb0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371ccfb0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x116467b8ac0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000371cc990 rbx 0xffffffff83473dbf cpu_info_full_primary+0x2dbf rdx 0 rcx 0xffff80003579dc00 rax 0xffffffff83472ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x65fa9b8b0fd28c71 r11 0x95a6c08d16ece677 r12 0xffffffff83473bc0 cpu_info_full_primary+0x2bc0 r13 0 r14 0 r15 0x1 rip 0xffffffff817ca965 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000371cc980 ss 0 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=226544 pid=89246 tcnt=3 stat=onproc flags process=0 proc=4000000 runpri=17, usrpri=59, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003579d978,0xffff8000ffff7c08 process=0xffff800035fa1240 user=0xffff8000371c8000, vmspace=0xfffffd8068f95aa8 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 11586 503029 30924 0 2 0x2 ndp 87963 85131 43428 0 2 0x10 syz-executor 87963 383928 43428 0 2 0x4000010 syz-executor 89246 448119 16181 0 2 0 syz-executor 89246 42499 16181 0 3 0x4000000 inode syz-executor *89246 226544 16181 0 7 0x4000000 syz-executor 20988 492100 54988 0 2 0 syz-executor 20988 117727 54988 0 3 0x4000080 netcon syz-executor 18524 208542 22808 0 2 0 syz-executor 18524 44648 22808 0 3 0x4000080 fsleep syz-executor 30924 10708 93145 0 3 0x10008a sigsusp sh 6861 7980 44323 0 3 0x82 wait syz-executor 16181 103830 44323 0 3 0x82 nanoslp syz-executor 43428 383561 44323 0 3 0x82 nanoslp syz-executor 93145 516822 44323 0 3 0x82 wait syz-executor 54988 347499 44323 0 3 0x82 nanoslp syz-executor 22808 371152 44323 0 3 0x82 nanoslp syz-executor 44323 456374 76050 0 3 0x82 wait syz-executor 76050 94844 49473 0 3 0x10008a sigsusp ksh 49473 66130 61526 0 3 0x98 kqread sshd-session 61526 186166 57509 0 3 0x92 kqread sshd-session 84495 250528 1 0 3 0x100083 ttyin getty 57509 506742 1 0 3 0x88 kqread sshd 62561 167868 68809 74 3 0x1100092 bpf pflogd 68809 367341 1 0 3 0x80 sbwait pflogd 9457 378915 87561 73 3 0x1100090 kqread syslogd 87561 134242 1 0 3 0x100082 sbwait syslogd 54837 368938 1 0 3 0x100080 kqread resolvd 8353 520837 81977 77 3 0x100092 kqread dhcpleased 6384 255169 81977 77 3 0x100092 kqread dhcpleased 81977 116404 1 0 3 0x80 kqread dhcpleased 46241 297303 0 0 3 0x14200 bored smr 67071 454669 0 0 2 0x14200 zerothread 57729 229693 0 0 3 0x14200 aiodoned aiodoned 17708 47956 0 0 3 0x14200 syncer update 38322 458175 0 0 3 0x14200 cleaner cleaner 31934 180201 0 0 7 0x14200 reaper 46510 188562 0 0 3 0x14200 pgdaemon pagedaemon 94718 290297 0 0 3 0x14200 bored viomb 67991 73901 0 0 3 0x40014200 acpi0 acpi0 71132 497110 0 0 3 0x40014200 idle1 12930 372235 0 0 3 0x14200 bored softnet3 40526 183716 0 0 3 0x14200 bored softnet2 44019 235776 0 0 3 0x14200 bored softnet1 7918 46808 0 0 3 0x14200 bored softnet0 11301 335867 0 0 3 0x14200 bored systqmp 93072 167987 0 0 3 0x14200 bored systq 30047 386516 0 0 3 0x14200 tmoslp softclockmp 2754 396673 0 0 3 0x40014200 tmoslp softclock 19117 498718 0 0 3 0x40014200 idle0 1 390960 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 89246 (syz-executor) thread 0xffff80003579dc00 (226544) 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 dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 #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 (0xfffffd8068f65b40) #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 dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 #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 10188 11178K 11178K 166960K 11267 0 pcb 17 12K 12K 166960K 17 0 rtable 232 6K 6K 166960K 342 0 pf 34 17K 18K 166960K 45 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 1484 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1367 86K 86K 166960K 1391 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 2 0K 0K 166960K 2 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 16 57K 89K 166960K 138 0 sigio 0 0K 0K 166960K 1 0 proc 70 91K 140K 166960K 529 0 subproc 104 6K 6K 166960K 104 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 in_multi 99 7K 7K 166960K 99 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 25 122K 122K 166960K 25 0 exec 0 0K 1K 166960K 358 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 212 72K 72K 166960K 2835 0 UVM aobj 3 2K 2K 166960K 3 0 pinsyscall 42 84K 101K 166960K 1207 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 NDP 28 2K 2K 166960K 28 0 temp 33 6814K 6878K 166960K 3868 0 kqueue 13 20K 20K 166960K 22 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 32 0 29 1 0 1 1 0 8 0 rtentry 112 110 0 1 4 0 4 4 0 8 0 unpcb 144 37 0 20 1 0 1 1 0 8 0 syncache 336 3 0 3 2 1 1 1 0 8 1 tcpcb 808 10 0 5 1 0 1 1 0 8 0 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 71 0 62 1 0 1 1 0 8 0 nd6 136 23 0 0 1 0 1 1 0 8 0 kcovpl 48 8 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 pfstitem 24 18 0 0 1 0 1 1 0 8 0 pfstkey 128 18 0 0 1 0 1 1 0 8 0 pfstate 376 18 0 0 2 0 2 2 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 451 0 0 29 0 29 29 0 8 0 art_table 32 452 0 0 4 0 4 4 0 8 0 art_node 16 109 0 10 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1556 0 51 95 0 95 95 0 8 0 ffsino 272 1556 0 51 101 0 101 101 0 8 0 nchpl 144 1741 0 58 63 0 63 63 0 8 0 uvmvnodes 80 1677 0 0 35 0 35 35 0 8 0 vnodes 216 1677 0 0 94 0 94 94 0 8 0 namei 1024 5339 0 5337 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 5077 0 5077 3 1 2 2 1 8 2 plimitpl 152 27 0 10 1 0 1 1 0 8 0 sigapl 424 436 0 387 8 1 7 7 0 8 0 futexpl 64 73 0 72 1 0 1 1 0 8 0 knotepl 120 57 0 0 2 0 2 2 0 8 0 kqueuepl 216 18 0 9 1 0 1 1 0 8 0 pipepl 320 105 0 78 3 0 3 3 0 8 0 fdescpl 496 418 0 388 5 0 5 5 0 8 0 filepl 152 1475 0 1231 11 0 11 11 0 8 1 lockfpl 104 6 0 4 1 0 1 1 0 8 0 lockfspl 48 4 0 2 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 59 0 45 1 0 1 1 0 8 0 zombiepl 144 390 0 387 1 0 1 1 0 8 0 processpl 1160 436 0 387 5 0 5 5 0 8 1 procpl 648 450 0 396 6 1 5 5 0 8 0 sockpl 664 140 0 111 3 0 3 3 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 147 0 0 19 0 19 19 0 8 0 mcl2k 2048 9 0 0 2 0 2 2 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 151 0 0 10 0 10 10 0 8 0 bufpl 280 2204 0 97 151 0 151 151 0 8 0 anonpl 24 141127 0 137992 25 0 25 25 0 185 4 amapchunkpl 152 9096 0 8679 18 0 18 18 0 158 0 amappl16 200 3832 0 3827 5 0 5 5 0 8 4 amappl15 192 14 0 14 1 0 1 1 0 8 1 amappl14 184 107 0 95 1 0 1 1 0 8 0 amappl13 176 41 0 41 1 0 1 1 0 8 1 amappl12 168 1069 0 1038 4 1 3 3 0 8 0 amappl11 160 52 0 38 1 0 1 1 0 8 0 amappl10 152 14 0 14 1 0 1 1 0 8 1 amappl9 144 150 0 150 1 0 1 1 0 8 1 amappl8 136 37 0 36 1 0 1 1 0 8 0 amappl7 128 107 0 94 1 0 1 1 0 8 0 amappl6 120 163 0 161 1 0 1 1 0 8 0 amappl5 112 137 0 126 1 0 1 1 0 8 0 amappl4 104 316 0 297 1 0 1 1 0 8 0 amappl3 96 1696 0 1615 3 0 3 3 0 8 0 amappl2 88 675 0 594 2 0 2 2 0 8 0 amappl1 80 7418 0 6835 14 0 14 14 0 8 0 amappl 88 2472 0 2323 4 0 4 4 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 418 0 388 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 418 0 388 1 0 1 1 0 8 0 vmmpekpl 168 4963 0 4927 2 0 2 2 0 8 0 vmmpepl 168 34733 0 33008 80 0 80 80 0 357 0 vmsppl 448 417 0 388 6 1 5 5 0 8 0 rwobjpl 56 16027 0 13439 38 0 38 38 0 8 0 pdppl 4096 843 0 776 95 12 83 83 0 8 16 pvpl 32 8803 0 0 71 0 71 71 0 265 0 pmappl 248 417 0 388 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 371 0 16 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(ffffffff83036195) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371ccb68,ffff8000371ccb68,f658fe108353fe5) at ufs_dirbadentry VOP_LOOKUP(fffffd8068fdd6c8,ffff8000371ccde8,ffff8000371cce18) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371ccdb8) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371ccdb8) at namei+0x7aa sys/kern/vfs_lookup.c:250 dorenameat(ffff80003579dc00,ffffff9c,20000000,ffffff9c,20000080) at dorenameat+0x91 sys/kern/vfs_syscalls.c:2976 syscall(ffff8000371ccfb0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371ccfb0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x116467b8ac0, 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(ffffffff83632fd8) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff83632fd8) at __mp_lock+0x192 sys/kern/kern_lock.c:144 reaper(ffff800029fd96d0) at reaper+0x24b sys/kern/kern_exit.c:478 end trace frame: 0x0, count: 10 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(ffffffff83632fd8) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff83632fd8) at __mp_lock+0x192 sys/kern/kern_lock.c:144 reaper(ffff800029fd96d0) at reaper+0x24b sys/kern/kern_exit.c:478 end trace frame: 0x0, count: -5