Message ID | 20190822035134.GK1131@ZenIV.linux.org.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RFC] fix d_absolute_path() interplay with fsmount() | expand |
On 2019/08/22 12:51, Al Viro wrote: > [bringing a private thread back to the lists] > > There's a bug in interplay of fsmount() and d_absolute_path(). > Namely, the check in d_absolute_path() treats the > not-yet-attached mount as "reached absolute root". I think you can send this patch to linux-next.
diff --git a/fs/d_path.c b/fs/d_path.c index a7d0a96b35ce..0f1fc1743302 100644 --- a/fs/d_path.c +++ b/fs/d_path.c @@ -116,8 +116,10 @@ static int prepend_path(const struct path *path, vfsmnt = &mnt->mnt; continue; } - if (!error) - error = is_mounted(vfsmnt) ? 1 : 2; + if (is_mounted(vfsmnt) && !is_anon_ns(mnt->mnt_ns)) + error = 1; // absolute root + else + error = 2; // detached or not attached yet break; } parent = dentry->d_parent;