panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *439150 32454 0 0x2004 0x4000000 0K syz-executor.1 18359 866 73 0x100010 0x80 1 syslogd db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:212 ufs_dirbadentry(ffff800020c2ab58,ffff800020c2ab58,26d16bd728a310aa) at ufs_dirbadentry VOP_LOOKUP(fffffd807efbd000,ffff800020c2ae78,ffff800020c2aec8) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800020c2ae48) at vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 namei(ffff800020c2ae48) at namei+0x45f sys/kern/vfs_lookup.c:224 check_exec(ffff800020b39080,ffff800020c2af08) at check_exec+0x77 sys/kern/kern_exec.c:123 sys_execve(ffff800020b39080,ffff800020c2b248,ffff800020c2b2b0) at sys_execve+0x167 sys/kern/kern_exec.c:298 syscall(ffff800020c2b320) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c2b320) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,fffffffffffffee6,0,3,81da42fb010) at Xsyscall+0x128 end of kernel end trace frame: 0x48, 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 bad dir ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:212 ufs_dirbadentry(ffff800020c2ab58,ffff800020c2ab58,26d16bd728a310aa) at ufs_dirbadentry VOP_LOOKUP(fffffd807efbd000,ffff800020c2ae78,ffff800020c2aec8) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800020c2ae48) at vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 namei(ffff800020c2ae48) at namei+0x45f sys/kern/vfs_lookup.c:224 check_exec(ffff800020b39080,ffff800020c2af08) at check_exec+0x77 sys/kern/kern_exec.c:123 sys_execve(ffff800020b39080,ffff800020c2b248,ffff800020c2b2b0) at sys_execve+0x167 sys/kern/kern_exec.c:298 syscall(ffff800020c2b320) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c2b320) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,fffffffffffffee6,0,3,81da42fb010) at Xsyscall+0x128 end of kernel end trace frame: 0x48, count: -10 ddb{0}> show registers rdi 0xffffffff816ce867 db_enter+0x17 rsi 0x25f1 __ALIGN_SIZE+0x15f1 rbp 0xffff800020c2a970 rbx 0xffff800020c2aa20 rdx 0x25f2 __ALIGN_SIZE+0x15f2 rcx 0xffff8000009be000 rax 0xffff8000009be000 r8 0xffffffff812d2ac3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x6c79c31e8cdf3122 r12 0x3000000008 r13 0xffff800020c2a980 r14 0x100 r15 0x1 rip 0xffffffff816ce868 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c2a960 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=439150 stat=onproc flags process=2004 proc=4000000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b38978,0xffff800020b384d8 process=0xffff800020b8c360 user=0xffff800020c26000, vmspace=0xfffffd807effe9d8 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 46930 32811 59177 0 2 0 syz-executor.0 46930 395799 59177 0 3 0x4000000 inode syz-executor.0 32454 122766 21320 0 4 0x82004 syz-executor.1 *32454 439150 21320 0 7 0x4002004 syz-executor.1 83185 187666 0 0 3 0x14200 bored sosplice 21320 21008 37681 0 3 0x82 nanosleep syz-executor.1 59177 196476 37681 0 3 0x82 nanosleep syz-executor.0 37681 80869 44206 0 3 0x82 thrsleep syz-fuzzer 37681 289576 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 169487 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 240648 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 399764 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 257161 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 368824 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 242075 44206 0 3 0x4000082 thrsleep syz-fuzzer 37681 484649 44206 0 3 0x4000082 kqread syz-fuzzer 37681 146057 44206 0 3 0x4000082 thrsleep syz-fuzzer 44206 57528 84740 0 3 0x10008a pause ksh 84740 212684 34843 0 3 0x92 select sshd 65130 453824 1 0 3 0x100083 ttyin getty 34843 259017 1 0 3 0x80 select sshd 65411 477179 39099 74 3 0x100092 bpf pflogd 39099 472746 1 0 3 0x80 netio pflogd 866 18359 51454 73 7 0x100090 syslogd 51454 150559 1 0 3 0x100082 netio syslogd 25035 350351 1 77 3 0x100090 poll dhclient 9670 365768 1 0 3 0x80 poll dhclient 40556 428994 0 0 3 0x14200 pgzero zerothread 41116 364244 0 0 3 0x14200 aiodoned aiodoned 19981 223664 0 0 3 0x14200 syncer update 10357 260061 0 0 3 0x14200 cleaner cleaner 41952 433911 0 0 3 0x14200 reaper reaper 82362 353885 0 0 3 0x14200 pgdaemon pagedaemon 38971 465473 0 0 3 0x14200 bored crynlk 44057 371697 0 0 3 0x14200 bored crypto 28583 112409 0 0 3 0x40014200 acpi0 acpi0 29502 434303 0 0 3 0x40014200 idle1 11353 467844 0 0 3 0x14200 bored softnet 17356 24881 0 0 3 0x14200 bored systqmp 9439 435256 0 0 3 0x14200 bored systq 45166 23526 0 0 3 0x40014200 bored softclock 43530 299047 0 0 3 0x40014200 idle0 62801 382847 0 0 3 0x14200 bored smr 1 72929 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks CPU 1: exclusive sched_lock &sched_lock r = 0 (0xffffffff823695a8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 preempt+0x36 sys/kern/sched_bsd.c:332 #2 ast+0x101 mi_ast sys/sys/syscall_mi.h:171 [inline] #2 ast+0x101 sys/arch/amd64/amd64/trap.c:495 #3 Xsyscall+0x156 Process 32454 (syz-executor.1) thread 0xffff800020b39080 (439150) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82390318) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 __mp_acquire_count+0x51 sys/kern/kern_lock.c:227 #2 mi_switch+0x38c sys/kern/sched_bsd.c:439 #3 sleep_finish+0x110 sys/kern/kern_synch.c:303 #4 sleep_finish_all+0x34 sleep_finish_timeout sys/kern/kern_synch.c:327 [inline] #4 sleep_finish_all+0x34 sys/kern/kern_synch.c:157 #5 tsleep+0x195 sys/kern/kern_synch.c:149 #6 biowait+0xa1 sys/kern/vfs_bio.c:1228 #7 ffs_bufatoff+0x14f sys/ufs/ffs/ffs_subr.c:71 #8 ufs_lookup+0x48d sys/ufs/ufs/ufs_lookup.c:258 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 #10 vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 #11 namei+0x45f sys/kern/vfs_lookup.c:224 #12 check_exec+0x77 sys/kern/kern_exec.c:123 #13 sys_execve+0x167 sys/kern/kern_exec.c:298 #14 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #14 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #15 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd807ed14d58) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 rw_enter+0x414 sys/kern/kern_rwlock.c:278 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:407 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 vfs_lookup+0xec sys/kern/vfs_lookup.c:387 #6 namei+0x45f sys/kern/vfs_lookup.c:224 #7 check_exec+0x77 sys/kern/kern_exec.c:123 #8 sys_execve+0x167 sys/kern/kern_exec.c:298 #9 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #9 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #10 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9536 6427K 6815K 78643K 11778 0 0 pcb 25 9K 10K 78643K 233 0 0 rtable 108 4K 4K 78643K 271 0 0 ifaddr 65 13K 14K 78643K 99 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1481 0 0 iov 0 0K 16K 78643K 60 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1196 75K 76K 78643K 1589 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 15 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 93 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 6 17K 25K 78643K 498 0 0 proc 53 50K 91K 78643K 414 0 0 subproc 64 65538K 69634K 78643K 68 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 81 0 0 in_multi 33 2K 2K 78643K 64 0 0 ether_multi 1 0K 0K 78643K 9 0 0 mrt 0 0K 0K 78643K 2 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 72 318K 318K 78643K 72 0 0 exec 1 0K 1K 78643K 242 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 90 21K 30K 78643K 2487 0 0 UVM aobj 38 2K 2K 78643K 40 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 42 0 0 NDP 14 0K 0K 78643K 26 0 0 temp 176 2729K 2857K 78643K 7203 0 0 kqueue 0 0K 0K 78643K 4 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 6 0 0 1 0 1 1 0 8 0 inpcbpl 280 291 0 284 1 0 1 1 0 8 0 plimitpl 152 39 0 31 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 6 0 6 1 1 0 1 0 8 0 tcpcb 544 104 0 100 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 ppxss 1128 8 0 8 3 3 0 1 0 8 0 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 16 0 9 1 0 1 1 0 8 0 pfstkey 112 16 0 9 1 0 1 1 0 8 0 pfstate 328 16 0 9 1 0 1 1 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 1 1 0 1 1 0 8 1 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 91 0 81 1 0 1 1 0 8 0 shmpl 112 38 0 2 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2182 0 766 46 0 46 46 0 8 0 ffsino 272 2182 0 766 95 0 95 95 0 8 0 nchpl 144 3076 0 1437 61 0 61 61 0 8 0 uvmvnodes 72 2494 0 0 46 0 46 46 0 8 0 vnodes 200 2494 0 0 132 0 132 132 0 8 0 namei 1024 8663 0 8661 3 2 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 1 1 0 1 0 8 0 scxspl 192 17737 0 17737 9 8 1 6 0 8 1 sigapl 432 697 0 681 3 1 2 3 0 8 0 futexpl 56 6062 0 6062 1 0 1 1 0 8 1 knotepl 112 142 0 123 1 0 1 1 0 8 0 kqueuepl 104 103 0 101 1 0 1 1 0 8 0 pipepl 112 460 0 441 2 1 1 1 0 8 0 fdescpl 488 698 0 681 5 2 3 3 0 8 0 filepl 152 3825 0 3723 6 1 5 5 0 8 1 lockfpl 104 201 0 201 3 2 1 1 0 8 1 lockfspl 48 69 0 69 3 2 1 1 0 8 1 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 24 0 13 1 0 1 1 0 8 0 ucredpl 96 536 0 527 1 0 1 1 0 8 0 zombiepl 144 681 0 681 3 2 1 1 0 8 1 processpl 840 714 0 681 4 0 4 4 0 8 0 procpl 600 1768 0 1724 4 0 4 4 0 8 0 sosppl 128 4 0 4 2 2 0 1 0 8 0 sockpl 384 455 0 436 4 1 3 3 0 8 1 mcl64k 65536 8 0 0 1 0 1 1 0 8 0 mcl12k 12288 5 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 7 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 117 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 147 0 0 10 1 9 9 0 8 0 bufpl 256 22271 0 16060 390 1 389 390 0 8 0 anonpl 16 90855 0 79498 74 11 63 63 0 125 16 amapchunkpl 152 4081 0 3962 16 5 11 11 0 158 5 amappl16 192 3997 0 3384 61 22 39 43 0 8 8 amappl14 176 37 0 33 2 1 1 1 0 8 0 amappl13 168 18 0 16 1 0 1 1 0 8 0 amappl12 160 240 0 236 1 0 1 1 0 8 0 amappl11 152 46 0 27 1 0 1 1 0 8 0 amappl10 144 75 0 71 1 0 1 1 0 8 0 amappl9 136 828 0 823 1 0 1 1 0 8 0 amappl8 128 381 0 365 1 0 1 1 0 8 0 amappl7 120 33 0 31 1 0 1 1 0 8 0 amappl6 112 56 0 50 1 0 1 1 0 8 0 amappl5 104 376 0 359 1 0 1 1 0 8 0 amappl4 96 720 0 686 2 1 1 2 0 8 0 amappl3 88 348 0 342 1 0 1 1 0 8 0 amappl2 80 4940 0 4875 3 1 2 2 0 8 0 amappl1 72 24828 0 24366 25 15 10 20 0 8 0 amappl 72 2033 0 1992 1 0 1 1 0 75 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 39 0 2 1 0 1 1 0 8 0 uaddrrnd 24 698 0 681 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 698 0 681 1 0 1 1 0 8 0 vmmpekpl 168 9745 0 9721 2 0 2 2 0 8 0 vmmpepl 168 82692 0 80981 109 23 86 86 0 357 11 vmsppl 360 697 0 681 2 0 2 2 0 8 0 pdppl 4096 1404 0 1362 8 2 6 6 0 8 0 pvpl 32 261740 0 247155 171 17 154 154 0 265 36 pmappl 232 697 0 681 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 544 0 9 16 0 16 16 0 8 0