From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5174C4332F for ; Thu, 17 Nov 2022 21:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239803AbiKQVBs (ORCPT ); Thu, 17 Nov 2022 16:01:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231919AbiKQVBp (ORCPT ); Thu, 17 Nov 2022 16:01:45 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382271004D; Thu, 17 Nov 2022 13:01:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C453E6223F; Thu, 17 Nov 2022 21:01:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4B04C433C1; Thu, 17 Nov 2022 21:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668718903; bh=pK84Oh+46qGlbj35Fr/fiQAsI8PUo07QeOABAKvF8PQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ZCMFoS4Q5IRm3PIqnwqena3O+EzT5bxvElqtPEk0o/uiFZG4rloq3U+xuL2cekRGB lbsbQxBrjNjWm4c/5iC8INH3e/4E1/xw2b1MnxkAhRwBSbIiTFVnG9KlrcH3ELnYuQ g4/4vdfdR+qQrxh1BQscyEmC7a+L+4OcWtqxYKKYXr4nGFfgMen/C/AsyBbcZ7cO2u FJ3V6g7VkAq9wWjpotrujtpzlbnBtOvXFbcze8b/BAHwfla6I8kSZv+2PWFlqGoiAf nbSTtd0461JVEIV+TGzzJ8imKrlz2Mr1Dd6Afqbinrk1O9oByPojdxdqcVA87JP7hB j4oD+UmKf/fWg== Message-ID: Subject: Re: [PATCH 2/3] fs: namei: Allow follow_down() to uncover auto mounts From: Jeff Layton To: Richard Weinberger , linux-nfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, chuck.lever@oracle.com, anna@kernel.org, trond.myklebust@hammerspace.com, viro@zeniv.linux.org.uk, raven@themaw.net, chris.chilvers@appsbroker.com, david.young@appsbroker.com, luis.turcitu@appsbroker.com, david@sigma-star.at Date: Thu, 17 Nov 2022 16:01:40 -0500 In-Reply-To: <20221117191151.14262-3-richard@nod.at> References: <20221117191151.14262-1-richard@nod.at> <20221117191151.14262-3-richard@nod.at> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >=20 > Signed-off-by: Richard Weinberger > --- > fs/namei.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 =3D path->mnt; > bool jumped; > - int ret =3D traverse_mounts(path, &jumped, NULL, 0); > + int ret =3D traverse_mounts(path, &jumped, NULL, LOOKUP_AUTOMOUNT); > =20 > if (path->mnt !=3D 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? --=20 Jeff Layton