panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 403438 51892 0 0 0 0 syz-executor.1 *216850 51892 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(ffff800020c27168,ffff800020c27168,aec4c7dfd04934a4) at ufs_dirbadentry VOP_LOOKUP(fffffd807efbd7d0,ffff800020c27368,ffff800020c273b8) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800020c27338) at vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 namei(ffff800020c27338) at namei+0x45f sys/kern/vfs_lookup.c:224 sys_chroot(ffff800020b69080,ffff800020c27468,ffff800020c274d0) at sys_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:856 [inline] sys_chroot(ffff800020b69080,ffff800020c27468,ffff800020c274d0) at sys_chroot+0x87 sys/kern/vfs_syscalls.c:829 syscall(ffff800020c27540) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c27540) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,fffffffffffffedb,0,1,f1b3afbc010) at Xsyscall+0x128 end of kernel end trace frame: 0x27, 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(ffff800020c27168,ffff800020c27168,aec4c7dfd04934a4) at ufs_dirbadentry VOP_LOOKUP(fffffd807efbd7d0,ffff800020c27368,ffff800020c273b8) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800020c27338) at vfs_lookup+0x575 sys/kern/vfs_lookup.c:523 namei(ffff800020c27338) at namei+0x45f sys/kern/vfs_lookup.c:224 sys_chroot(ffff800020b69080,ffff800020c27468,ffff800020c274d0) at sys_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:856 [inline] sys_chroot(ffff800020b69080,ffff800020c27468,ffff800020c274d0) at sys_chroot+0x87 sys/kern/vfs_syscalls.c:829 syscall(ffff800020c27540) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c27540) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,fffffffffffffedb,0,1,f1b3afbc010) at Xsyscall+0x128 end of kernel end trace frame: 0x27, count: -9 ddb{1}> show registers rdi 0xffffffff816ce867 db_enter+0x17 rsi 0x2811 __ALIGN_SIZE+0x1811 rbp 0xffff800020c26f80 rbx 0xffff800020c27030 rdx 0x2812 __ALIGN_SIZE+0x1812 rcx 0xffff8000009be000 rax 0xffff8000009be000 r8 0xffffffff812d2ac3 kprintf+0x173 r9 0x1 r10 0x25 r11 0x290da02c210f3588 r12 0x3000000008 r13 0xffff800020c26f90 r14 0x100 r15 0x1 rip 0xffffffff816ce868 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c26f70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=216850 stat=onproc flags process=0 proc=4000000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b69530,0xffffffff82341258 process=0xffff800020b8c6a8 user=0xffff800020c22000, vmspace=0xfffffd807effe5a0 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 51892 403438 98727 0 7 0 syz-executor.1 *51892 216850 98727 0 7 0x4000000 syz-executor.1 98727 135110 28968 0 3 0x82 nanosleep syz-executor.1 71374 137648 1 0 3 0x100083 ttyin getty 66995 56539 0 0 3 0x14200 bored sosplice 33139 116264 28968 0 3 0x2 biowait syz-executor.0 28968 484453 67856 0 3 0x82 thrsleep syz-fuzzer 28968 234179 67856 0 3 0x4000082 nanosleep syz-fuzzer 28968 196512 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 177160 67856 0 3 0x4000082 kqread syz-fuzzer 28968 337002 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 142329 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 295721 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 279333 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 309404 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 514133 67856 0 3 0x4000082 thrsleep syz-fuzzer 28968 409660 67856 0 3 0x4000082 thrsleep syz-fuzzer 67856 108641 4873 0 3 0x10008a pause ksh 4873 136064 58552 0 3 0x92 select sshd 58552 353967 1 0 3 0x80 select sshd 75008 447190 19275 74 3 0x100092 bpf pflogd 19275 213525 1 0 3 0x80 netio pflogd 21143 235515 19142 73 2 0x100090 syslogd 19142 181719 1 0 3 0x100082 netio syslogd 29634 432913 1 77 3 0x100090 poll dhclient 50427 357946 1 0 3 0x80 poll dhclient 36901 306113 0 0 3 0x14200 pgzero zerothread 88301 330414 0 0 3 0x14200 aiodoned aiodoned 43857 92929 0 0 3 0x14200 syncer update 86810 518842 0 0 3 0x14200 cleaner cleaner 48911 127364 0 0 3 0x14200 reaper reaper 621 8140 0 0 3 0x14200 pgdaemon pagedaemon 47081 113342 0 0 3 0x14200 bored crynlk 81921 88693 0 0 3 0x14200 bored crypto 55897 224024 0 0 3 0x40014200 acpi0 acpi0 34738 32617 0 0 3 0x40014200 idle1 7116 112939 0 0 3 0x14200 bored softnet 68647 421345 0 0 3 0x14200 bored systqmp 75612 254221 0 0 3 0x14200 bored systq 64429 223991 0 0 3 0x40014200 bored softclock 55676 282843 0 0 3 0x40014200 idle0 45443 379694 0 0 3 0x14200 bored smr 1 407898 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 51892 (syz-executor.1) thread 0xffff800020b69080 (216850) 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_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:856 [inline] #12 sys_chroot+0x87 sys/kern/vfs_syscalls.c:829 #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_chroot+0x87 change_dir sys/kern/vfs_syscalls.c:856 [inline] #7 sys_chroot+0x87 sys/kern/vfs_syscalls.c:829 #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 33139 (syz-executor.0) thread 0xffff800020b69788 (116264) exclusive rrwlock inode r = 0 (0xfffffd807ed12f80) #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 ufs_ihashins+0x45 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x133 sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1cf sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_mkdir+0xf4 sys/ufs/ufs/ufs_vnops.c:1164 #7 VOP_MKDIR+0x6a sys/kern/vfs_vops.c:449 #8 domkdirat+0x121 sys/kern/vfs_syscalls.c:2881 #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 exclusive rrwlock inode r = 0 (0xfffffd806bd84b40) #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 domkdirat+0x75 sys/kern/vfs_syscalls.c:2866 #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 9515 6412K 6930K 78643K 11814 0 0 pcb 25 9K 11K 78643K 301 0 0 rtable 108 4K 4K 78643K 483 0 0 ifaddr 59 13K 13K 78643K 138 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1491 0 0 iov 0 0K 16K 78643K 54 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1204 75K 76K 78643K 1658 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 6 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 52 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 5 13K 25K 78643K 533 0 0 sigio 0 0K 0K 78643K 4 0 0 proc 53 50K 91K 78643K 552 0 0 subproc 64 65538K 69634K 78643K 204 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 36 0 0 in_multi 33 2K 2K 78643K 84 0 0 ether_multi 1 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 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 291 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 82 20K 21K 78643K 2573 0 0 UVM aobj 29 2K 2K 78643K 36 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 26 0 0 NDP 12 0K 0K 78643K 42 0 0 temp 164 2729K 2857K 78643K 7765 0 0 kqueue 0 0K 0K 78643K 4 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 14 0 8 1 0 1 1 0 8 0 inpcbpl 280 249 0 242 1 0 1 1 0 8 0 plimitpl 152 37 0 29 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 89 0 45 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 68 0 64 1 0 1 1 0 8 0 nd6 48 18 0 12 1 0 1 1 0 8 0 ppxss 1128 10 0 10 3 2 1 1 0 8 1 pffrag 232 1 0 1 1 1 0 1 0 482 0 pffrnode 88 1 0 1 1 1 0 1 0 8 0 pffrent 40 2 0 2 1 1 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 17 0 8 1 0 1 1 0 8 0 pfstkey 112 17 0 8 1 0 1 1 0 8 0 pfstate 328 17 0 8 2 1 1 2 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 373 0 182 12 0 12 12 0 8 0 art_table 32 374 0 182 2 0 2 2 0 8 0 art_node 16 88 0 48 1 0 1 1 0 8 0 sysvmsgpl 40 14 0 1 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 46 0 36 1 0 1 1 0 8 0 shmpl 112 34 0 7 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2127 0 688 47 0 47 47 0 8 0 ffsino 272 2127 0 688 96 0 96 96 0 8 0 nchpl 144 2985 0 1332 62 0 62 62 0 8 0 uvmvnodes 72 2515 0 0 46 0 46 46 0 8 0 vnodes 200 2515 0 0 133 0 133 133 0 8 0 namei 1024 8692 0 8690 2 1 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 17795 0 17794 7 6 1 6 0 8 0 sigapl 432 721 0 706 3 1 2 3 0 8 0 futexpl 56 5286 0 5286 1 0 1 1 0 8 1 knotepl 112 227 0 208 1 0 1 1 0 8 0 kqueuepl 104 104 0 102 1 0 1 1 0 8 0 pipepl 112 484 0 465 4 2 2 2 0 8 1 fdescpl 488 722 0 706 4 1 3 3 0 8 0 filepl 152 3832 0 3732 6 1 5 6 0 8 0 lockfpl 104 168 0 168 2 1 1 1 0 8 1 lockfspl 48 60 0 60 2 1 1 1 0 8 1 sessionpl 112 23 0 12 1 0 1 1 0 8 0 pgrppl 48 27 0 16 1 0 1 1 0 8 0 ucredpl 96 481 0 472 1 0 1 1 0 8 0 zombiepl 144 706 0 706 2 1 1 1 0 8 1 processpl 840 738 0 706 4 0 4 4 0 8 0 procpl 600 1692 0 1649 4 0 4 4 0 8 0 srpgc 64 24 0 24 3 2 1 1 0 8 1 sosppl 128 7 0 7 3 3 0 1 0 8 0 sockpl 384 503 0 484 5 1 4 4 0 8 2 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 118 0 0 14 0 14 14 0 8 0 mtagpl 80 3 0 0 1 0 1 1 0 8 0 mbufpl 256 174 0 0 9 0 9 9 0 8 0 bufpl 256 22345 0 16134 392 1 391 392 0 8 0 anonpl 16 76974 0 67467 58 4 54 54 0 125 7 amapchunkpl 152 4277 0 4174 12 6 6 10 0 158 1 amappl16 192 2971 0 2358 44 4 40 43 0 8 8 amappl15 184 8 0 8 1 1 0 1 0 8 0 amappl14 176 72 0 68 2 1 1 1 0 8 0 amappl13 168 32 0 30 3 2 1 1 0 8 0 amappl12 160 33 0 28 1 0 1 1 0 8 0 amappl11 152 59 0 40 1 0 1 1 0 8 0 amappl10 144 486 0 483 1 0 1 1 0 8 0 amappl9 136 666 0 663 1 0 1 1 0 8 0 amappl8 128 196 0 179 1 0 1 1 0 8 0 amappl7 120 456 0 451 1 0 1 1 0 8 0 amappl6 112 60 0 52 1 0 1 1 0 8 0 amappl5 104 149 0 135 1 0 1 1 0 8 0 amappl4 96 972 0 939 2 1 1 2 0 8 0 amappl3 88 128 0 121 1 0 1 1 0 8 0 amappl2 80 4806 0 4750 2 0 2 2 0 8 0 amappl1 72 25960 0 25526 25 15 10 20 0 8 0 amappl 72 2021 0 1985 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 35 0 7 1 0 1 1 0 8 0 uaddrrnd 24 722 0 706 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 722 0 706 1 0 1 1 0 8 0 vmmpekpl 168 10220 0 10194 2 0 2 2 0 8 0 vmmpepl 168 85194 0 83585 136 43 93 111 0 357 19 vmsppl 360 721 0 706 2 0 2 2 0 8 0 pdppl 4096 1452 0 1412 7 1 6 6 0 8 0 pvpl 32 253663 0 240978 153 13 140 140 0 265 22 pmappl 232 721 0 706 2 1 1 2 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 545 0 6 16 0 16 16 0 8 0