msdosfs: handle a case when non-dot lookup returned dvp

This means that filesystem is corrupted, there is a loop.

In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
This commit is contained in:
Konstantin Belousov 2021-12-28 15:41:30 +02:00
parent 2c9a1c22c3
commit 1319c433f4

View File

@ -573,6 +573,10 @@ foundroot:
goto restart;
}
} else if (dp->de_StartCluster == scn && isadir) {
if (cnp->cn_namelen != 1 || cnp->cn_nameptr[0] != '.') {
/* fs is corrupted, non-dot lookup returned dvp */
return (EBADF);
}
VREF(vdp); /* we want ourself, ie "." */
*vpp = vdp;
} else {