git: accbd5ad06c3 - releng/14.0 - vfs cache: Fallback to namei to resolve symlinks with leading / in target for non-native ABI
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Oct 2023 18:47:15 UTC
The branch releng/14.0 has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=accbd5ad06c3eeb17d75cde05597f70f1fedb061
commit accbd5ad06c3eeb17d75cde05597f70f1fedb061
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-10-19 10:33:58 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-10-22 18:46:22 +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.
Approved by: re (gjb)
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
(cherry picked from commit bb8ecf259f96510b9c2146d846403393543061b7)
(cherry picked from commit b84a836ef02de42e262ce44d46c859be288df4b0)
---
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 115d0bdd3993..8917666950c1 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -5337,12 +5337,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) {
@@ -5398,6 +5400,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);
}