panic: bad dir Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *476341 79790 0 0 0x4000000 0K syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8302b552) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371ea128,ffff8000371ea128,34f52b34fde1fd9d) at ufs_dirbadentry VOP_LOOKUP(fffffd8060c6dc30,ffff8000371ea4c8,ffff8000371ea4f8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371ea498) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371ea498) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371ea498,1,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 doopenat(ffff8000ffff0f58,ffffff9c,20000140,0,0,ffff8000371ea640) at doopenat+0x31d sys/kern/vfs_syscalls.c:1123 syscall(ffff8000371ea6f0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371ea6f0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4425d801ea0, 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{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(ffffffff8302b552) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371ea128,ffff8000371ea128,34f52b34fde1fd9d) at ufs_dirbadentry VOP_LOOKUP(fffffd8060c6dc30,ffff8000371ea4c8,ffff8000371ea4f8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371ea498) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371ea498) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371ea498,1,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 doopenat(ffff8000ffff0f58,ffffff9c,20000140,0,0,ffff8000371ea640) at doopenat+0x31d sys/kern/vfs_syscalls.c:1123 syscall(ffff8000371ea6f0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371ea6f0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4425d801ea0, count: -10 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000371e9f50 rbx 0xffffffff83465dbf cpu_info_full_primary+0x2dbf rdx 0xffff80000129ff00 rcx 0xffff8000ffff0f58 rax 0xffffffff83464ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xcf57630d956aee8b r11 0xb6186b0842f98924 r12 0xffffffff83465bc0 cpu_info_full_primary+0x2bc0 r13 0 r14 0 r15 0x1 rip 0xffffffff813f0bf5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff8000371e9f40 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor) tid=476341 pid=79790 tcnt=3 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=0xffff8000ffff07c0,0xffff8000ffff1478 process=0xffff8000fffec020 user=0xffff8000371e5000, vmspace=0xfffffd806bedd3a0 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 79790 519084 7971 0 3 0x80 nanoslp syz-executor *79790 476341 7971 0 7 0x4000000 syz-executor 79790 258288 7971 0 3 0x4000080 fsleep syz-executor 1540 217121 4355 0 3 0x80 nanoslp syz-executor 1540 152326 4355 0 3 0x4000080 kqsel syz-executor 1540 169289 4355 0 3 0x4000080 kqsel syz-executor 1540 75155 4355 0 3 0x4000080 fsleep syz-executor 65739 160709 0 0 3 0x14200 acct acct 58791 38093 1 0 3 0x100083 ttyin getty 70670 269146 0 0 3 0x14200 bored sosplice 7971 52279 87782 0 3 0x82 nanoslp syz-executor 4355 114662 87782 0 3 0x82 nanoslp syz-executor 87782 289515 22585 0 3 0x82 wait syz-executor 22585 517330 46353 0 3 0x10008a sigsusp ksh 46353 138438 67734 0 3 0x98 kqread sshd-session 67734 420111 90694 0 3 0x92 kqread sshd-session 90694 70730 1 0 3 0x88 kqread sshd 87451 290162 85098 74 3 0x1100092 bpf pflogd 85098 11621 1 0 3 0x80 sbwait pflogd 56693 242664 47659 73 3 0x1100090 kqread syslogd 47659 449717 1 0 3 0x100082 sbwait syslogd 23954 417533 1 0 3 0x100080 kqread resolvd 64262 98583 80812 77 3 0x100092 kqread dhcpleased 54922 224339 80812 77 3 0x100092 kqread dhcpleased 80812 332465 1 0 3 0x80 kqread dhcpleased 76470 121508 0 0 3 0x14200 bored smr 97431 322562 0 0 3 0x14200 pgzero zerothread 63955 52383 0 0 3 0x14200 aiodoned aiodoned 12990 466130 0 0 3 0x14200 syncer update 19609 340282 0 0 3 0x14200 cleaner cleaner 39940 480917 0 0 3 0x14200 reaper reaper 60286 185772 0 0 3 0x14200 pgdaemon pagedaemon 67499 407944 0 0 3 0x14200 bored viomb 19779 143308 0 0 3 0x40014200 acpi0 acpi0 15834 109379 0 0 7 0x40014200 idle1 82408 209893 0 0 3 0x14200 bored softnet3 858 228720 0 0 3 0x14200 bored softnet2 67304 212103 0 0 3 0x14200 bored softnet1 21595 172869 0 0 3 0x14200 bored softnet0 43718 206168 0 0 3 0x14200 bored systqmp 39932 430458 0 0 3 0x14200 bored systq 89438 118389 0 0 3 0x14200 tmoslp softclockmp 10286 184142 0 0 3 0x40014200 tmoslp softclock 91155 276958 0 0 3 0x40014200 idle0 1 304296 0 0 3 0x80082 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 79790 (syz-executor) thread 0xffff8000ffff0f58 (476341) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff835d30c0) #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+0x278 sys/kern/kern_synch.c:417 #4 biowait+0xc1 sys/kern/vfs_bio.c:1254 #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 doopenat+0x31d sys/kern/vfs_syscalls.c:1123 #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 (0xfffffd806ddc01b8) #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 doopenat+0x31d sys/kern/vfs_syscalls.c:1123 #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10190 11116K 11327K 166960K 11597 0 pcb 19 12K 12K 166960K 94 0 rtable 213 6K 7K 166960K 400 0 pf 36 18K 18K 166960K 68 0 ifaddr 39 6K 7K 166960K 60 0 ifgroup 58 2K 2K 166960K 86 0 sysctl 1 0K 0K 166960K 1 0 counters 64 36K 36K 166960K 80 0 ioctlops 0 0K 4K 166960K 1508 0 iov 0 0K 12K 166960K 5 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1396 88K 88K 166960K 1614 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 7 0 VM map 2 1K 1K 166960K 2 0 sem 10 0K 0K 166960K 19 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 12 41K 85K 166960K 426 0 sigio 0 0K 0K 166960K 16 0 proc 72 91K 128K 166960K 583 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 317 0 in_multi 79 5K 7K 166960K 139 0 ether_multi 1 0K 0K 166960K 2 0 mrt 3 0K 0K 166960K 4 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 73 334K 334K 166960K 73 0 exec 0 0K 1K 166960K 455 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 195 71K 76K 166960K 5608 0 UVM aobj 12 2K 2K 166960K 12 0 pinsyscall 37 74K 101K 166960K 1514 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 28 0 NDP 13 0K 1K 166960K 41 0 temp 48 6813K 6878K 166960K 7167 0 kqueue 15 24K 26K 166960K 87 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 49 0 46 1 0 1 1 0 8 0 rtentry 112 125 0 27 4 0 4 4 0 8 0 unpcb 144 188 0 171 2 0 2 2 0 8 1 syncache 336 5 0 5 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 808 83 0 78 2 0 2 2 0 8 1 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 582 0 570 7 0 7 7 0 8 5 nd6 136 29 0 11 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1168 5 0 5 1 0 1 1 0 8 1 pfstscr 40 2 0 2 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 3 0 2 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 56 0 0 1 0 1 1 0 8 0 pfstkey 128 58 0 2 2 0 2 2 0 8 0 pfstate 376 56 0 1 6 0 6 6 0 8 0 pfrule 1344 22 0 15 2 0 2 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 548 0 155 28 1 27 28 0 8 1 art_table 32 550 0 155 4 0 4 4 0 8 0 art_node 16 122 0 32 1 0 1 1 0 8 0 sysvmsgpl 40 3 0 1 1 0 1 1 0 8 0 semapl 112 14 0 6 1 0 1 1 0 8 0 shmpl 112 9 0 0 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2088 0 587 95 0 95 95 0 8 0 ffsino 272 2088 0 587 102 0 102 102 0 8 0 nchpl 144 2728 0 1044 63 0 63 63 0 8 0 uvmvnodes 80 2336 0 0 48 0 48 48 0 8 0 vnodes 216 2336 0 0 130 0 130 130 0 8 0 namei 1024 9234 0 9233 2 1 1 2 0 8 0 percpumem 16 54 0 8 1 0 1 1 0 8 0 kstatmem 264 40 0 16 2 0 2 2 0 8 0 scsiplug 72 2 0 2 1 0 1 1 0 8 1 scxspl 216 7745 0 7745 4 2 2 2 1 8 2 plimitpl 152 159 0 141 1 0 1 1 0 8 0 sigapl 424 731 0 685 7 1 6 7 0 8 0 futexpl 64 4863 0 4861 1 0 1 1 0 8 0 knotepl 120 317 0 0 10 0 10 10 0 8 0 kqueuepl 216 110 0 97 1 0 1 1 0 8 0 pipepl 320 149 0 122 3 0 3 3 0 8 0 fdescpl 496 711 0 685 5 0 5 5 0 8 1 filepl 152 3680 0 3431 13 0 13 13 0 8 2 lockfpl 104 118 0 116 1 0 1 1 0 8 0 lockfspl 48 52 0 50 1 0 1 1 0 8 0 sessionpl 144 24 0 15 1 0 1 1 0 8 0 pgrppl 48 33 0 16 1 0 1 1 0 8 0 ucredpl 104 366 0 353 1 0 1 1 0 8 0 zombiepl 144 691 0 685 1 0 1 1 0 8 0 processpl 1160 731 0 685 5 1 4 5 0 8 0 procpl 648 1245 0 1194 6 0 6 6 0 8 0 srpgc 96 2 0 2 1 0 1 1 0 8 1 sosppl 168 3 0 3 1 0 1 1 0 8 1 sockpl 664 844 0 812 9 0 9 9 0 8 5 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 145 0 0 19 0 19 19 0 8 0 mcl2k 2048 20 0 0 3 0 3 3 0 8 0 mtagpl 96 5 0 0 1 0 1 1 0 8 0 mbufpl 256 158 0 0 10 0 10 10 0 8 0 bufpl 280 2786 0 98 192 0 192 192 0 8 0 anonpl 24 164917 0 161822 24 1 23 24 0 185 0 amapchunkpl 152 18033 0 17667 24 0 24 24 0 158 4 amappl16 200 4099 0 4078 5 3 2 5 0 8 0 amappl15 192 6 0 6 1 1 0 1 0 8 0 amappl14 184 146 0 134 1 0 1 1 0 8 0 amappl13 176 12 0 12 1 1 0 1 0 8 0 amappl12 168 1355 0 1329 3 1 2 2 0 8 0 amappl11 160 51 0 37 1 0 1 1 0 8 0 amappl10 152 6 0 6 1 1 0 1 0 8 0 amappl9 144 137 0 137 1 1 0 1 0 8 0 amappl8 136 46 0 44 1 0 1 1 0 8 0 amappl7 128 110 0 98 1 0 1 1 0 8 0 amappl6 120 168 0 166 1 0 1 1 0 8 0 amappl5 112 137 0 125 1 0 1 1 0 8 0 amappl4 104 323 0 304 1 0 1 1 0 8 0 amappl3 96 3409 0 3337 3 0 3 3 0 8 0 amappl2 88 989 0 910 2 0 2 2 0 8 0 amappl1 80 8600 0 8044 14 0 14 14 0 8 0 amappl 88 5204 0 5071 5 0 5 5 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 2 0 1 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 254 0 254 2 1 1 1 0 8 1 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 0 1 0 1 1 0 8 0 uaddrrnd 24 711 0 685 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 711 0 685 1 0 1 1 0 8 0 vmmpekpl 168 7355 0 7307 3 0 3 3 0 8 0 vmmpepl 168 51268 0 49671 90 0 90 90 0 357 8 vmsppl 448 710 0 685 6 2 4 5 0 8 0 rwobjpl 56 20308 0 17077 47 0 47 47 0 8 0 pdppl 4096 1429 0 1370 101 30 71 83 0 8 12 pvpl 32 10552 0 0 86 0 86 86 0 265 0 pmappl 248 710 0 685 3 0 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 387 0 36 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(ffffffff8302b552) at panic+0x1e5 sys/kern/subr_prf.c:198 ufs_dirbadentry(ffff8000371ea128,ffff8000371ea128,34f52b34fde1fd9d) at ufs_dirbadentry VOP_LOOKUP(fffffd8060c6dc30,ffff8000371ea4c8,ffff8000371ea4f8) at VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000371ea498) at vfs_lookup+0x8fa sys/kern/vfs_lookup.c:566 namei(ffff8000371ea498) at namei+0x7aa sys/kern/vfs_lookup.c:250 vn_open(ffff8000371ea498,1,0) at vn_open+0x13f sys/kern/vfs_vnops.c:140 doopenat(ffff8000ffff0f58,ffffff9c,20000140,0,0,ffff8000371ea640) at doopenat+0x31d sys/kern/vfs_syscalls.c:1123 syscall(ffff8000371ea6f0) at syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:178 [inline] syscall(ffff8000371ea6f0) at syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4425d801ea0, count: -10 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 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 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 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff800029b7bff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: -5