Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2023 10:34:14 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bb8ecf259f96 - main - vfs cache: Fallback to namei to resolve symlinks with leading / in target for non-native ABI
Message-ID:  <202310191034.39JAYEE9095527@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dchagin:

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

commit bb8ecf259f96510b9c2146d846403393543061b7
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-10-19 10:33:58 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-10-19 10:33:58 +0000

    vfs cache: Fallback to namei to resolve symlinks with leading / in target for non-native ABI
    
    This is a temporary solution to fix PR before release.
    During 15.0 it's necessary to refactor symlinks handling
    between vfs & namecache.
    
    PR:                     273414
    Reported by:            Vincent Milum Jr, Dan Kotowski, glebius
    Tested by:              Dan Kotowski, glebius
    Reviewed by:
    Differential Revision:  https://reviews.freebsd.org/D41806
    MFC after:              3 days
---
 sys/kern/vfs_cache.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 99e293d5a873..4b51b3558739 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -5426,12 +5426,14 @@ cache_fplookup_symlink(struct cache_fpl *fpl)
 	struct nameidata *ndp;
 	struct componentname *cnp;
 	struct vnode *dvp, *tvp;
+	struct pwd *pwd;
 	int error;
 
 	ndp = fpl->ndp;
 	cnp = fpl->cnp;
 	dvp = fpl->dvp;
 	tvp = fpl->tvp;
+	pwd = *(fpl->pwd);
 
 	if (cache_fpl_islastcn(ndp)) {
 		if ((cnp->cn_flags & FOLLOW) == 0) {
@@ -5487,6 +5489,9 @@ cache_fplookup_symlink(struct cache_fpl *fpl)
 			cache_fpl_checkpoint(fpl);
 			return (cache_fpl_partial(fpl));
 		}
+		if (__predict_false(pwd->pwd_adir != pwd->pwd_rdir)) {
+			return (cache_fpl_aborted(fpl));
+		}
 	}
 	return (0);
 }



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