Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102775721
D39773.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39773.diff
View Options
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -1083,12 +1083,16 @@
pr = pr->pr_parent)
if (dp == pr->pr_root)
break;
- if (dp == ndp->ni_rootdir ||
- dp == ndp->ni_topdir ||
- dp == rootvnode ||
- pr != NULL ||
- ((dp->v_vflag & VV_ROOT) != 0 &&
- (cnp->cn_flags & NOCROSSMOUNT) != 0)) {
+ bool isroot = dp == ndp->ni_rootdir ||
+ dp == ndp->ni_topdir || dp == rootvnode ||
+ pr != NULL;
+ if (isroot && (ndp->ni_lcf &
+ NI_LCF_STRICTRELATIVE) != 0) {
+ error = ENOTCAPABLE;
+ goto capdotdot;
+ }
+ if (isroot || ((dp->v_vflag & VV_ROOT) != 0 &&
+ (cnp->cn_flags & NOCROSSMOUNT) != 0)) {
ndp->ni_dvp = dp;
ndp->ni_vp = dp;
VREF(dp);
@@ -1109,6 +1113,7 @@
LK_RETRY, ISDOTDOT));
error = nameicap_check_dotdot(ndp, dp);
if (error != 0) {
+capdotdot:
#ifdef KTRACE
if (KTRPOINT(curthread, KTR_CAPFAIL))
ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 12:37 AM (22 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14687656
Default Alt Text
D39773.diff (1 KB)
Attached To
Mode
D39773: lookup(): ensure that openat("/", "..", O_RESOLVE_BENEATH) fails
Attached
Detach File
Event Timeline
Log In to Comment