Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177563387
D59271.1794739226.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D59271.1794739226.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
@@ -614,6 +614,7 @@
struct thread *td;
struct pwd *pwd;
int error;
+ bool readlink_vnode;
enum cache_fpl_status status;
cnp = &ndp->ni_cnd;
@@ -770,6 +771,8 @@
error = namei_follow_link(ndp);
if (error != 0)
break;
+ readlink_vnode = ndp->ni_vp->v_type != VLNK &&
+ (ndp->ni_vp->v_vflag & VV_READLINK) != 0;
vput(ndp->ni_vp);
dp = ndp->ni_dvp;
/*
@@ -787,7 +790,7 @@
* /compat/linux, including the ELF interpreter symlink,
* incorrectly escape to the native root (PR 289739).
*/
- if ((cnp->cn_flags & ISRESTARTED) != 0)
+ if ((cnp->cn_flags & ISRESTARTED) != 0 || readlink_vnode)
ndp->ni_rootdir = pwd->pwd_rdir;
vrele(dp);
error = namei_handle_root(ndp, &dp);
@@ -1398,11 +1401,13 @@
dp = ndp->ni_vp;
/*
- * Check for symbolic link
+ * Check for symbolic link, or a VV_READLINK vnode with more path
+ * components left.
*/
- if ((dp->v_type == VLNK) &&
+ if ((dp->v_type == VLNK &&
((cnp->cn_flags & FOLLOW) || (cnp->cn_flags & TRAILINGSLASH) ||
- *ndp->ni_next == '/')) {
+ *ndp->ni_next == '/')) ||
+ ((dp->v_vflag & VV_READLINK) != 0 && *ndp->ni_next == '/')) {
cnp->cn_flags |= ISSYMLINK;
if (VN_IS_DOOMED(dp)) {
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 10:40 AM (18 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37663760
Default Alt Text
D59271.1794739226.diff (1 KB)
Attached To
Mode
D59271: vfs: allow lookup through VV_READLINK vnodes
Attached
Detach File
Event Timeline