panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 257896 28989 0 0 0 0 syz-executor.1 *484077 28989 0 0 0x4000000 1K syz-executor.1 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(ffff800020c498c8,ffff800020c498c8,f557be14143621ad) at ufs_dirbadentry VOP_LOOKUP(fffffd807efbd708,ffff800020c49ad0,ffff800020c49b20) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800020c49aa0) at vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 namei(ffff800020c49aa0) at namei+0x45f sys/kern/vfs_lookup.c:224 sys_chdir(ffff800020b38270,ffff800020c49bd8,ffff800020c49c40) at sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:856 [inline] sys_chdir(ffff800020b38270,ffff800020c49bd8,ffff800020c49c40) at sys_chdir+0x76 sys/kern/vfs_syscalls.c:802 syscall(ffff800020c49cb0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c49cb0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,fffffffffffffed6,0,1,7281799d330) at Xsyscall+0x128 end of kernel end trace frame: 0x18, 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 bad dir ddb{1}> 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(ffff800020c498c8,ffff800020c498c8,f557be14143621ad) at ufs_dirbadentry VOP_LOOKUP(fffffd807efbd708,ffff800020c49ad0,ffff800020c49b20) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800020c49aa0) at vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 namei(ffff800020c49aa0) at namei+0x45f sys/kern/vfs_lookup.c:224 sys_chdir(ffff800020b38270,ffff800020c49bd8,ffff800020c49c40) at sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:856 [inline] sys_chdir(ffff800020b38270,ffff800020c49bd8,ffff800020c49c40) at sys_chdir+0x76 sys/kern/vfs_syscalls.c:802 syscall(ffff800020c49cb0) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c49cb0) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,fffffffffffffed6,0,1,7281799d330) at Xsyscall+0x128 end of kernel end trace frame: 0x18, count: -9 ddb{1}> show registers rdi 0xffffffff816ce867 db_enter+0x17 rsi 0x2563 __ALIGN_SIZE+0x1563 rbp 0xffff800020c496e0 rbx 0xffff800020c49790 rdx 0x2564 __ALIGN_SIZE+0x1564 rcx 0xffff8000033be000 rax 0xffff8000033be000 r8 0xffffffff812d2ac3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x1f6e0379bd1f430 r12 0x3000000008 r13 0xffff800020c496f0 r14 0x100 r15 0x1 rip 0xffffffff816ce868 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c496d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=484077 stat=onproc flags process=0 proc=4000000 pri=17, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800020b38bd0,0xffffffff82341258 process=0xffff800020b8c9f0 user=0xffff800020c44000, vmspace=0xfffffd807effe708 estcpu=27, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 28989 257896 7508 0 7 0 syz-executor.1 28989 313239 7508 0 3 0x4000000 biowait syz-executor.1 28989 387437 7508 0 3 0x4000000 inode syz-executor.1 28989 235861 7508 0 3 0x4000000 inode syz-executor.1 28989 65450 7508 0 3 0x4000000 inode syz-executor.1 *28989 484077 7508 0 7 0x4000000 syz-executor.1 7508 169588 66439 0 3 0x82 nanosleep syz-executor.1 20646 486186 66439 0 3 0x2 biowait syz-executor.0 66439 340365 35854 0 3 0x82 thrsleep syz-fuzzer 66439 479416 35854 0 3 0x4000082 nanosleep syz-fuzzer 66439 345465 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 204400 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 463676 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 185298 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 332499 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 198876 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 307693 35854 0 3 0x4000082 thrsleep syz-fuzzer 66439 41984 35854 0 3 0x4000082 kqread syz-fuzzer 66439 301243 35854 0 3 0x4000082 thrsleep syz-fuzzer 35854 235025 45758 0 3 0x10008a pause ksh 45758 179545 27212 0 3 0x92 select sshd 75012 372576 1 0 3 0x100083 ttyin getty 27212 407178 1 0 3 0x80 select sshd 11761 478711 97566 74 3 0x100092 bpf pflogd 97566 420821 1 0 3 0x80 netio pflogd 39877 291281 64019 73 2 0x100090 syslogd 64019 305388 1 0 3 0x100082 netio syslogd 33267 79201 1 77 3 0x100090 poll dhclient 2288 249634 1 0 3 0x80 poll dhclient 64980 431937 0 0 3 0x14200 pgzero zerothread 5445 301722 0 0 3 0x14200 aiodoned aiodoned 7850 322060 0 0 3 0x14200 syncer update 80219 337622 0 0 3 0x14200 cleaner cleaner 62656 116243 0 0 3 0x14200 reaper reaper 63631 53737 0 0 3 0x14200 pgdaemon pagedaemon 33656 143450 0 0 3 0x14200 bored crynlk 22150 110376 0 0 3 0x14200 bored crypto 71113 91078 0 0 3 0x40014200 acpi0 acpi0 2918 110552 0 0 3 0x40014200 idle1 94861 516301 0 0 3 0x14200 bored softnet 95790 159443 0 0 3 0x14200 bored systqmp 6723 49795 0 0 3 0x14200 bored systq 16108 459020 0 0 3 0x40014200 bored softclock 64838 299443 0 0 3 0x40014200 idle0 87115 453489 0 0 3 0x14200 bored smr 1 448609 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 28989 (syz-executor.1) thread 0xffff800020b38720 (313239) exclusive rrwlock inode r = 0 (0xfffffd806c2afd60) #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_write+0x169 vn_lock sys/kern/vfs_vnops.c:549 [inline] #4 vn_write+0x169 sys/kern/vfs_vnops.c:393 #5 dofilewritev+0x1a9 sys/kern/sys_generic.c:364 #6 sys_pwritev+0xb8 sys/kern/vfs_syscalls.c:3161 #7 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #7 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #8 Xsyscall+0x128 Process 28989 (syz-executor.1) thread 0xffff800020b38978 (387437) exclusive rrwlock inode r = 0 (0xfffffd806c2afb40) #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 dorenameat+0x7b sys/kern/vfs_syscalls.c:2758 #8 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #8 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #9 Xsyscall+0x128 Process 28989 (syz-executor.1) thread 0xffff800020b38270 (484077) 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 sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:856 [inline] #12 sys_chdir+0x76 sys/kern/vfs_syscalls.c:802 #13 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #13 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd807ed14f78) #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 sys_chdir+0x76 change_dir sys/kern/vfs_syscalls.c:856 [inline] #7 sys_chdir+0x76 sys/kern/vfs_syscalls.c:802 #8 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #8 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #9 Xsyscall+0x128 Process 20646 (syz-executor.0) thread 0xffff800020b14008 (486186) exclusive rrwlock inode r = 0 (0xfffffd806c2afa30) #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 vget+0x1c3 sys/kern/vfs_subr.c:672 #6 ufs_ihashget+0x141 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x74 sys/ufs/ffs/ffs_vfsops.c:1323 #8 ufs_lookup+0x1575 sys/ufs/ufs/ufs_lookup.c:487 #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 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1673 #13 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #13 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806c2af920) #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 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1673 #8 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #8 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9474 6390K 6904K 78643K 10898 0 0 pcb 25 9K 10K 78643K 123 0 0 rtable 108 4K 4K 78643K 242 0 0 ifaddr 43 11K 11K 78643K 67 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1473 0 0 iov 1 12K 16K 78643K 11 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1202 75K 75K 78643K 1318 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 5 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 17 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 5 13K 25K 78643K 164 0 0 proc 53 50K 91K 78643K 365 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 4 0 0 in_multi 33 2K 2K 78643K 33 0 0 ether_multi 1 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 217 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 89 20K 21K 78643K 1382 0 0 UVM aobj 10 2K 2K 78643K 14 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 10 0 0 NDP 7 0K 0K 78643K 17 0 0 temp 100 2717K 2845K 78643K 6131 0 0 kqueue 0 0K 0K 78643K 6 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> 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 107 0 100 1 0 1 1 0 8 0 plimitpl 152 19 0 11 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 tcpcb 544 38 0 34 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 ppxss 1128 4 0 4 1 0 1 1 0 8 1 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 13 0 3 1 0 1 1 0 8 0 pfstkey 112 13 0 3 1 0 1 1 0 8 0 pfstate 328 13 0 3 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 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 13 0 3 1 0 1 1 0 8 0 shmpl 112 12 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1644 0 229 46 0 46 46 0 8 0 ffsino 272 1644 0 229 95 0 95 95 0 8 0 nchpl 144 2045 0 408 61 0 61 61 0 8 0 uvmvnodes 72 1766 0 0 33 0 33 33 0 8 0 vnodes 200 1766 0 0 93 0 93 93 0 8 0 namei 1024 5532 0 5528 2 1 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 12675 0 12673 7 6 1 6 0 8 0 sigapl 432 363 0 348 3 1 2 3 0 8 0 futexpl 56 1729 0 1729 1 0 1 1 0 8 1 knotepl 112 93 0 74 2 1 1 2 0 8 0 kqueuepl 104 53 0 51 1 0 1 1 0 8 0 pipepl 112 210 0 191 2 1 1 1 0 8 0 fdescpl 488 364 0 348 3 0 3 3 0 8 0 filepl 152 1870 0 1769 5 0 5 5 0 8 1 lockfpl 104 63 0 62 2 1 1 1 0 8 0 lockfspl 48 23 0 22 2 1 1 1 0 8 0 sessionpl 112 18 0 7 1 0 1 1 0 8 0 pgrppl 48 20 0 9 1 0 1 1 0 8 0 ucredpl 96 193 0 184 1 0 1 1 0 8 0 zombiepl 144 348 0 348 3 2 1 1 0 8 1 processpl 840 379 0 348 4 0 4 4 0 8 0 procpl 600 678 0 632 4 0 4 4 0 8 0 sockpl 384 203 0 184 4 1 3 3 0 8 1 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 119 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 155 0 0 9 0 9 9 0 8 0 bufpl 256 19308 0 13097 392 0 392 392 0 8 0 anonpl 16 55929 0 45290 61 2 59 59 0 125 15 amapchunkpl 152 1984 0 1874 9 3 6 9 0 158 0 amappl16 192 1973 0 1407 47 8 39 40 0 8 10 amappl14 176 106 0 100 2 1 1 1 0 8 0 amappl13 168 6 0 6 1 1 0 1 0 8 0 amappl12 160 12 0 10 1 0 1 1 0 8 0 amappl11 152 115 0 95 2 1 1 2 0 8 0 amappl10 144 70 0 67 1 0 1 1 0 8 0 amappl9 136 595 0 592 1 0 1 1 0 8 0 amappl8 128 141 0 128 1 0 1 1 0 8 0 amappl7 120 33 0 31 1 0 1 1 0 8 0 amappl6 112 116 0 110 1 0 1 1 0 8 0 amappl5 104 122 0 109 1 0 1 1 0 8 0 amappl4 96 545 0 512 2 1 1 2 0 8 0 amappl3 88 265 0 254 1 0 1 1 0 8 0 amappl2 80 1908 0 1851 3 1 2 2 0 8 0 amappl1 72 17490 0 17050 25 15 10 20 0 8 0 amappl 72 941 0 898 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 13 0 4 1 0 1 1 0 8 0 uaddrrnd 24 364 0 348 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 364 0 348 1 0 1 1 0 8 0 vmmpekpl 168 6889 0 6864 2 0 2 2 0 8 0 vmmpepl 168 47483 0 45912 121 18 103 110 0 357 29 vmsppl 360 363 0 348 2 0 2 2 0 8 0 pdppl 4096 736 0 696 6 0 6 6 0 8 0 pvpl 32 176625 0 162826 156 6 150 150 0 265 33 pmappl 232 363 0 348 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 541 0 4 16 0 16 16 0 8 0