Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jan 2022 00:51:38 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1bcbcd68f590 - stable/13 - msdosfs: handle a case when non-dot lookup returned dvp
Message-ID:  <202201150051.20F0pcwV031151@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=1bcbcd68f59099f8813f9767e0781a150b1b7918

commit 1bcbcd68f59099f8813f9767e0781a150b1b7918
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-12-28 13:41:30 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-01-14 18:11:02 +0000

    msdosfs: handle a case when non-dot lookup returned dvp
    
    (cherry picked from commit 1319c433f4e5d67f8ea6fd2369c604069f733c94)
---
 sys/fs/msdosfs/msdosfs_lookup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c
index 9940800a72c2..2478cab84a0a 100644
--- a/sys/fs/msdosfs/msdosfs_lookup.c
+++ b/sys/fs/msdosfs/msdosfs_lookup.c
@@ -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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201150051.20F0pcwV031151>