panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 83268 20254 0 0 0x4000000 0 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(ffff800014a1c1b8,ffff800014a1c1b8,2cc712ab0bfaa7a9) at ufs_dirbadentry VOP_LOOKUP(fffffd803efda640,ffff800014a1c3b8,ffff800014a1c408) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800014a1c388) at vfs_lookup+0x55d sys/kern/vfs_lookup.c:523 namei(ffff800014a1c388) at namei+0x45f sys/kern/vfs_lookup.c:224 dounlinkat(ffff8000ffff3080,ffffff9c,20000380,8) at dounlinkat+0x99 sys/kern/vfs_syscalls.c:1673 syscall(ffff800014a1c590) at syscall+0x511 Xsyscall(6,0,ffffffffffffffc4,0,1,bf956b9c010) at Xsyscall+0x128 end of kernel end trace frame: 0x2e2, 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic bad dir ddb> 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(ffff800014a1c1b8,ffff800014a1c1b8,2cc712ab0bfaa7a9) at ufs_dirbadentry VOP_LOOKUP(fffffd803efda640,ffff800014a1c3b8,ffff800014a1c408) at VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:90 vfs_lookup(ffff800014a1c388) at vfs_lookup+0x55d sys/kern/vfs_lookup.c:523 namei(ffff800014a1c388) at namei+0x45f sys/kern/vfs_lookup.c:224 dounlinkat(ffff8000ffff3080,ffffff9c,20000380,8) at dounlinkat+0x99 sys/kern/vfs_syscalls.c:1673 syscall(ffff800014a1c590) at syscall+0x511 Xsyscall(6,0,ffffffffffffffc4,0,1,bf956b9c010) at Xsyscall+0x128 end of kernel end trace frame: 0x2e2, count: -9 ddb> show registers rdi 0xffffffff81a73677 db_enter+0x17 rsi 0x2143 __ALIGN_SIZE+0x1143 rbp 0xffff800014a1bfd0 rbx 0xffff800014a1c080 rdx 0x2144 __ALIGN_SIZE+0x1144 rcx 0xffff800000994000 rax 0xffff800000994000 r8 0xffff800014a1bf90 r9 0x1 r10 0xffff800001794580 r11 0x392938da9c311046 r12 0x3000000008 r13 0xffff800014a1bfe0 r14 0x100 r15 0x1 rip 0xffffffff81a73678 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800014a1bfc0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=83268 stat=onproc flags process=0 proc=4000000 pri=17, usrpri=73, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3788,0xffff8000ffff24d8 process=0xffff8000ffffa9e0 user=0xffff800014a17000, vmspace=0xfffffd803f014d68 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 20254 181643 16432 0 2 0 syz-executor.1 *20254 83268 16432 0 7 0x4000000 syz-executor.1 61033 466020 39954 0 2 0 syz-executor.0 61033 73475 39954 0 3 0x4000080 msgwait syz-executor.0 61033 93959 39954 0 3 0x4000080 fsleep syz-executor.0 16432 346211 5555 0 3 0x82 nanosleep syz-executor.1 39954 262561 5555 0 3 0x82 nanosleep syz-executor.0 6187 47728 1 0 3 0x100083 ttyin getty 29439 284864 0 0 3 0x14200 bored sosplice 5555 303494 67275 0 3 0x82 thrsleep syz-fuzzer 5555 255121 67275 0 3 0x4000082 thrsleep syz-fuzzer 5555 486783 67275 0 3 0x4000082 thrsleep syz-fuzzer 5555 438678 67275 0 3 0x4000082 thrsleep syz-fuzzer 5555 1885 67275 0 3 0x4000082 thrsleep syz-fuzzer 5555 522239 67275 0 3 0x4000082 kqread syz-fuzzer 5555 176786 67275 0 3 0x4000082 thrsleep syz-fuzzer 5555 475380 67275 0 3 0x4000082 thrsleep syz-fuzzer 67275 462622 55086 0 3 0x10008a pause ksh 55086 188027 81228 0 3 0x92 select sshd 81228 48578 1 0 3 0x80 select sshd 66446 269310 27986 73 2 0x100090 syslogd 27986 495255 1 0 3 0x100082 netio syslogd 17635 487788 1 77 3 0x100090 poll dhclient 74554 117122 1 0 3 0x80 poll dhclient 439 274811 0 0 2 0x14200 zerothread 93415 327439 0 0 3 0x14200 aiodoned aiodoned 30377 340342 0 0 3 0x14200 syncer update 1294 499572 0 0 3 0x14200 cleaner cleaner 5506 64785 0 0 3 0x14200 reaper reaper 66333 38076 0 0 3 0x14200 pgdaemon pagedaemon 93683 516074 0 0 3 0x14200 bored crynlk 49744 88248 0 0 3 0x14200 bored crypto 6971 26933 0 0 3 0x40014200 acpi0 acpi0 11031 443026 0 0 3 0x14200 bored softnet 66328 153143 0 0 3 0x14200 bored systqmp 24860 517536 0 0 3 0x14200 bored systq 72131 228421 0 0 3 0x40014200 bored softclock 28179 486338 0 0 3 0x40014200 idle0 18931 158845 0 0 3 0x14200 bored smr 1 255515 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9497 6347K 6796K 78643K 12222 0 0 pcb 23 9K 10K 78643K 430 0 0 rtable 108 3K 4K 78643K 622 0 0 ifaddr 56 13K 14K 78643K 158 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 44 0 0 iov 0 0K 24K 78643K 95 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1197 75K 76K 78643K 1898 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 17 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 1K 78643K 123 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 6 17K 25K 78643K 797 0 0 sigio 0 0K 0K 78643K 14 0 0 proc 41 30K 62K 78643K 642 0 0 subproc 64 65538K 69634K 78643K 306 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 93 0 0 in_multi 33 2K 2K 78643K 135 0 0 ether_multi 1 0K 0K 78643K 4 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 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 327 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 79 20K 38K 78643K 2818 0 0 UVM aobj 49 2K 2K 78643K 55 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 20 0 0 NDP 11 0K 0K 78643K 52 0 0 temp 158 2708K 2833K 78643K 8353 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 20 0 14 1 0 1 1 0 8 0 inpcbpl 280 305 0 297 1 0 1 1 0 8 0 plimitpl 152 52 0 45 1 0 1 1 0 8 0 rtentry 112 122 0 78 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 96 0 92 1 0 1 1 0 8 0 nd6 48 27 0 21 1 0 1 1 0 8 0 ppxss 1128 12 0 12 3 2 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 508 0 317 12 0 12 12 0 8 0 art_table 32 509 0 317 2 0 2 2 0 8 0 art_node 16 121 0 81 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 4 2 1 1 1 0 8 0 semapl 112 121 0 111 1 0 1 1 0 8 0 shmpl 112 53 0 6 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2562 0 1124 47 0 47 47 0 8 0 ffsino 240 2562 0 1124 85 0 85 85 0 8 0 nchpl 144 3735 0 2078 62 0 62 62 0 8 0 uvmvnodes 72 3085 0 0 57 0 57 57 0 8 0 vnodes 200 3085 0 0 163 0 163 163 0 8 0 namei 1024 11242 0 11241 2 1 1 1 0 8 0 scxspl 192 21894 0 21894 12 11 1 6 0 8 1 sigapl 432 947 0 933 2 0 2 2 0 8 0 futexpl 56 11944 0 11943 1 0 1 1 0 8 0 knotepl 112 316 0 296 1 0 1 1 0 8 0 kqueuepl 104 188 0 185 1 0 1 1 0 8 0 pipepl 112 556 0 535 2 1 1 1 0 8 0 fdescpl 424 948 0 933 2 0 2 2 0 8 0 filepl 120 5283 0 5183 4 0 4 4 0 8 0 lockfpl 104 262 0 262 2 1 1 1 0 8 1 lockfspl 48 90 0 90 2 1 1 1 0 8 1 sessionpl 112 25 0 15 1 0 1 1 0 8 0 pgrppl 48 37 0 27 1 0 1 1 0 8 0 ucredpl 96 760 0 753 1 0 1 1 0 8 0 zombiepl 144 933 0 933 2 1 1 1 0 8 1 processpl 840 963 0 933 4 0 4 4 0 8 0 procpl 600 1854 0 1814 4 0 4 4 0 8 0 sosppl 128 7 0 7 2 1 1 1 0 8 1 sockpl 384 694 0 676 3 0 3 3 0 8 1 mcl64k 65536 26 0 26 5 4 1 1 0 8 1 mcl16k 16384 4 0 4 2 2 0 1 0 8 0 mcl12k 12288 16 0 16 3 2 1 1 0 8 1 mcl9k 9216 11 0 11 4 4 0 1 0 8 0 mcl8k 8192 9 0 9 4 3 1 1 0 8 1 mcl4k 4096 42 0 42 3 2 1 1 0 8 1 mcl2k2 2112 7 0 7 3 2 1 1 0 8 1 mcl2k 2048 58546 0 58502 15 8 7 11 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 99923 0 99854 11 3 8 8 0 8 0 bufpl 256 24722 0 21615 198 0 198 198 0 8 0 anonpl 16 110607 0 101202 67 15 52 61 0 62 6 amapchunkpl 152 5058 0 4953 18 12 6 14 0 158 0 amappl16 192 4844 0 4250 60 22 38 42 0 8 8 amappl15 184 101 0 101 2 2 0 1 0 8 0 amappl14 176 147 0 144 2 1 1 1 0 8 0 amappl13 168 33 0 31 3 2 1 1 0 8 0 amappl12 160 19 0 18 1 0 1 1 0 8 0 amappl11 152 64 0 50 1 0 1 1 0 8 0 amappl10 144 169 0 168 2 1 1 1 0 8 0 amappl9 136 955 0 952 1 0 1 1 0 8 0 amappl8 128 509 0 490 1 0 1 1 0 8 0 amappl7 120 151 0 146 1 0 1 1 0 8 0 amappl6 112 60 0 51 1 0 1 1 0 8 0 amappl5 104 173 0 162 1 0 1 1 0 8 0 amappl4 96 1128 0 1099 2 1 1 2 0 8 0 amappl3 88 234 0 228 1 0 1 1 0 8 0 amappl2 80 6743 0 6676 2 0 2 2 0 8 0 amappl1 72 27354 0 26923 24 15 9 19 0 8 0 amappl 72 2224 0 2187 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 54 0 6 1 0 1 1 0 8 0 uaddrrnd 24 948 0 933 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 948 0 933 1 0 1 1 0 8 0 vmmpekpl 168 10218 0 10203 1 0 1 1 0 8 0 vmmpepl 168 106871 0 105254 124 36 88 88 0 357 15 vmsppl 264 947 0 933 2 1 1 2 0 8 0 pdppl 4096 1902 0 1866 6 1 5 6 0 8 0 pvpl 32 352297 0 339751 220 43 177 212 0 265 63 pmappl 200 947 0 933 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 350 0 26 10 0 10 10 0 8 0