[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f31d4114f363ed9de0eba66ad6a730fe013896a6.camel@kernel.org>
Date: Thu, 17 Nov 2022 16:01:40 -0500
From: Jeff Layton <jlayton@...nel.org>
To: Richard Weinberger <richard@....at>, linux-nfs@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
chuck.lever@...cle.com, anna@...nel.org,
trond.myklebust@...merspace.com, viro@...iv.linux.org.uk,
raven@...maw.net, chris.chilvers@...sbroker.com,
david.young@...sbroker.com, luis.turcitu@...sbroker.com,
david@...ma-star.at
Subject: Re: [PATCH 2/3] fs: namei: Allow follow_down() to uncover auto
mounts
On Thu, 2022-11-17 at 20:11 +0100, Richard Weinberger wrote:
> This function is only used by NFSD to cross mount points.
> If a mount point is of type auto mount, follow_down() will
> not uncover it. Add LOOKUP_AUTOMOUNT to the lookup flags
> to have ->d_automount() called when NFSD walks down the
> mount tree.
>
> Signed-off-by: Richard Weinberger <richard@....at>
> ---
> fs/namei.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index 578c2110df02..000c4b84e6be 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -1462,7 +1462,7 @@ int follow_down(struct path *path)
> {
> struct vfsmount *mnt = path->mnt;
> bool jumped;
> - int ret = traverse_mounts(path, &jumped, NULL, 0);
> + int ret = traverse_mounts(path, &jumped, NULL, LOOKUP_AUTOMOUNT);
>
> if (path->mnt != mnt)
> mntput(mnt);
What happens when CROSSMOUNT isn't enabled and someone tries to stroll
into an automount point? I'm guessing the automount happens but the
export is denied? It seems like LOOKUP_AUTOMOUNT ought to be conditional
on the parent export having CROSSMOUNT set.
There's also another caller of follow_down too, the UNIX98 pty code.
This may be harmless for it, but it'd be best not to perturb that if we
can help it.
Maybe follow_down can grow a lookupflags argument?
--
Jeff Layton <jlayton@...nel.org>
Powered by blists - more mailing lists