From nobody Sat Nov 30 01:57:37 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D79E3A267; Thu, 12 Sep 2024 13:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; cv=none; b=n0hSrYcjDhqetp7q1LZANuEp4Hz3a5lPilTlSHnuGFHt1BxtuoxlVB4DOiTlEXxmgAicDY3YDFI6J5+QVZGwOhJYcParX831dM/Qn3IHGYkqq7/65LV0RjCGiVi+ewyzaVmM/B1svEo/QEcPMprSF05yPTvz7XeHlkolW0KbRtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; c=relaxed/simple; bh=eyR+pOiVzBa/kDDxhPyz/knSOuyik7GIQNAJydI0rtI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=EtvIkDFnzLs+2cigyqm46VNyqpLW9ADx7griReOFYH7BUpMbdXd41ljcG4eXL6ips4Y8H5NflAgrHPyCdMtloi5MZcRU49kKxfMSd8lJObyiseSpsKltsSbOVV7aI9vWWogId48w8bOrKHqkQ9qOdHCwDsWVITROsaWrEpI7DqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z0v2BHbK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z0v2BHbK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AACD7C4CEC5; Thu, 12 Sep 2024 13:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726146160; bh=eyR+pOiVzBa/kDDxhPyz/knSOuyik7GIQNAJydI0rtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z0v2BHbKkEaXkmJ0sranppcJunUhVPleXYNPPkXCXcQMNLLT06qoRrg9k7RC9OIWJ Fit9MJjjlyt2nM3/1DIxqaiSgqxFqSk6hrhcM12drFVsHLL+wuhfxtojjzoe0aNKCS Vtz81u8kBo2uirJUEHNAs+RrNYcnbHISWJ4GA/EF7zVVs9brTfJqm9K7yXgwa8GEGr NskVkVvz/cbbIBcUNF9k2HdB//rCjfuONxut1TxhQf5M2YjpyC50o6N05Q7AgjVqcy G0iDYjSkAnbvzoXzzi0m9iId8ijL1edJ/eueeEITP5H/GalrQsfyjzbvC1Crxqaxtm 8IFuxuc+5Mo/w== Received: by pali.im (Postfix) id 827F0A11; Thu, 12 Sep 2024 15:02:35 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] nfs: Fix support for NFS3 mount with -o sec=none from Linux MNTv3 server Date: Thu, 12 Sep 2024 15:02:16 +0200 Message-Id: <20240912130220.17032-2-pali@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912130220.17032-1-pali@kernel.org> References: <20240912130220.17032-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Linux MNTv3 server does not announce AUTH_NULL in auth_info response. This is a MNTv3 server bug and prevents kernel to mount exports with AUTH_NULL flavor. So as a workaround when user explicitly specifies only AUTH_NULL flavor via mount option -o sec=3Dnone then allow to continue mounting export via AUTH_NULL. This change fixes mounting of NFS3 AUTH_NULL exports from Linux NFS3 servers. Signed-off-by: Pali Roh=C3=A1r Cc: stable@vger.kernel.org --- fs/nfs/super.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 97b386032b71..3fef2afd94bd 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -819,6 +819,20 @@ static int nfs_verify_authflavors(struct nfs_fs_contex= t *ctx, goto out; } =20 + /* + * Linux MNTv3 server does not announce AUTH_NULL in auth_info response. + * This is a MNTv3 server bug and prevents kernel to mount exports with + * AUTH_NULL flavor. So as a workaround when user explicitly specifies + * only AUTH_NULL flavor via mount option -o sec=3Dnone then allow to + * continue mounting export via AUTH_NULL. + */ + if (ctx->auth_info.flavor_len =3D=3D 1 && ctx->auth_info.flavors[0] =3D= =3D RPC_AUTH_NULL) { + dfprintk(MOUNT, + "NFS: requested auth flavor \"none\" is not announced by server, conti= nuing anyway\n"); + flavor =3D RPC_AUTH_NULL; + goto out; + } + dfprintk(MOUNT, "NFS: specified auth flavors not supported by server\n"); return -EACCES; --=20 2.20.1 From nobody Sat Nov 30 01:57:37 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D7341D52B; Thu, 12 Sep 2024 13:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; cv=none; b=LWX+t5KXd2LD6+MbSBpDhecjMaqom2nycaJNimz8Bb/oXySjRcD9knw5nYw7dLEuTbdoIlDGiEhh7hzqPIckA9GHHcOqAmuFkNqPLHlNE2sHF9sjxoiUI8dYaz2tiPya7cRGwMoNgbhgbJi51rAqgEiSRBQ3Irm/IWBgDB1kLvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; c=relaxed/simple; bh=DhkEH8ExzFb5xrRh5wL4/exJl72OCo+ono29/8YfNxo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=oEl57XeQyZYz4/PpfHVnjAVO+mzP1DHm8bMhAJsj6MJB6Mir8+rTD7M30ley00Ll2LIoo8jTcIeMRPWaT3r01Usz1fp7/x1JYO3NrwmO07DSke3UPtMc261qUt1WPj36vpBkXJo2qw2XMBObBxsQoUlwXCQq6wJqB7efobTam5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bbDXu4Vb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bbDXu4Vb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A835CC4CECC; Thu, 12 Sep 2024 13:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726146160; bh=DhkEH8ExzFb5xrRh5wL4/exJl72OCo+ono29/8YfNxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbDXu4Vbs2li49y06D9uXknvzsgdhVblx8o7SmcwgvuFkYOyBxhw/r1wrv7IJ/VgX iR7dvoBBz38agIOmm92Fnaxka27pRmejtuOcWmcQCs7jSsLn0+2oZmYktsqJmXhK7g YGFJLgYsO6vDbV0zV2ThoZ6YWKGudB3GE7i50RmUcP9pzPQRxAZ2PEqt6wJDX7Mh7f ro/xSKx5s+i3zw3wLqBHE39WsREl2kk7GPvQn8bi5h7438XY3bPkxladoSeo9vSi8U aaij2zA5UurcsmIK7JJwPiQWQosGZqVAt511V+j5vYJ6XWPuiFgcmcWi7ho3VoaZ7J 3RmDzG4VWTiLA== Received: by pali.im (Postfix) id B4368A4E; Thu, 12 Sep 2024 15:02:35 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] nfs: Propagate AUTH_NULL/AUTH_UNIX PATHCONF NFS3ERR_ACCESS failures Date: Thu, 12 Sep 2024 15:02:17 +0200 Message-Id: <20240912130220.17032-3-pali@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912130220.17032-1-pali@kernel.org> References: <20240912130220.17032-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Linux NFS3 server returns NFS3ERR_ACCESS for PATHCONF procedure if client-selected auth flavor is not enabled for export which is being mounted. Ignoring this error results in choosing wrong auth flavor during mount and so making the mount point inaccessible. It is because Linux NFS3 server allows to call other procedures used during mount time (FSINFO and GETATTR) also with auth flavor which is explicitly disabled on particular export. This is particularly problem with mounting AUTH_NULL-only exports from Linux NFS3 server as kernel client first try to use AUTH_UNIX auth flavor, even when AUTH_UNIX is not announced by the MNTv3 server. Do not propagate this failure for other auth methods, like GSS, as Linux NFS3 server expects that accessing root export GSS dir may be done also by other auth methods. Signed-off-by: Pali Roh=C3=A1r Cc: stable@vger.kernel.org --- fs/nfs/client.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 8286edd6062d..5171ae112355 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -864,7 +864,19 @@ static int nfs_probe_fsinfo(struct nfs_server *server,= struct nfs_fh *mntfh, str pathinfo.fattr =3D fattr; nfs_fattr_init(fattr); =20 - if (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >=3D 0) + error =3D clp->rpc_ops->pathconf(server, mntfh, &pathinfo); + /* + * Linux NFS3 server for PATHCONF procedure returns back error + * NFS3ERR_ACCESS when selected auth flavor is not enabled for + * export. For auth flavors without authentication (none and + * sys) propagate error back to nfs_probe_server() caller and + * allow to choose different auth flavor. + */ + if (error =3D=3D -EACCES && ( + server->client->cl_auth->au_flavor =3D=3D RPC_AUTH_UNIX || + server->client->cl_auth->au_flavor =3D=3D RPC_AUTH_NULL)) + return error; + else if (error >=3D 0) server->namelen =3D pathinfo.max_namelen; } =20 --=20 2.20.1 From nobody Sat Nov 30 01:57:37 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90B981A724C; Thu, 12 Sep 2024 13:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; cv=none; b=t64hseHhS/6fGDIMvu4q6NVBdd3Bb2X8QrIYPWQ9csAwRZ0xQYiCemiCwgDCS1PF3pEYnmNHAENR/1aIdz+2t3Mcig+EsVFZkW40L8jttPV7lZo3qKRtgZhsmwIGws3MuUwh3NrmyXDUMiLYvMMWXu+MqV1xh5vlbVFCazxWSk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; c=relaxed/simple; bh=ptLyRrhx22moDL3wpObMavhKGoI23EYMx3FtOroktGw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=XA+DtkzDnV++DH29zoYdwxp0hjDd0vU/1hzZiLP95cPSq5qa1m1sP69XjvBxRBfXdsYk5JhVMcjOcu9Id7n+lJ5i+poE7Z3vHwNyA5/oB3kxAv1BNtTz19+AaF/qJHHOrPyvav3w4ROPcxpqbsV6BkQSCsyKK5x/qaxdpytnVq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NVPwUt1a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NVPwUt1a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E93C4AF09; Thu, 12 Sep 2024 13:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726146161; bh=ptLyRrhx22moDL3wpObMavhKGoI23EYMx3FtOroktGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NVPwUt1aEVG660iImRNCEn7rEEzTdgJCW0yUhaj8QCcriZTT54nm6r86kioqqLbt3 PUHZMr2Aa65eIA1FkeAGziopwEk8jt4jefGOCyJUfv4CvALEZBsyYEO36DXDThtS/o h9IIydnAfopM6RLKPFgoYT97Kys0jmMrQqpoMKZYpsbW4QornRTEUsEpAUIdJjFZ7p vIFafvYI2+1bf4mmPAMBhZXM/XZF0FSxjhIbSyFig95PxoarUwkKrPn0Sh4ab/HAWv Pv8CyeW65/y8NG5WjoNgN/3EO0nmhnmLN9l1rfdqjDv7OtR1G8Zh0/niD36a0htWZH LlYRsoqaLMcTA== Received: by pali.im (Postfix) id EA5C3B9A; Thu, 12 Sep 2024 15:02:35 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] nfs: Try to use AUTH_NULL for NFS3 mount when no -o sec was given Date: Thu, 12 Sep 2024 15:02:18 +0200 Message-Id: <20240912130220.17032-4-pali@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912130220.17032-1-pali@kernel.org> References: <20240912130220.17032-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable As an absolutely last chance, after all previous failed attempts, try to use also AUTH_NULL when mounting NFS3 export. Try AUTH_NULL also when MNTv3 server does not announce it because of Linux MNTv3 server rpc.mountd bug which does not announce AUTH_NULL even when this is the only allowed method on the server. Currently AUTH_NULL is always skipped in nfs_try_mount_request() function even when MNTv3 server announces it and so it is not possible to mount NFS3 export with AUTH_UNIX disallowed on server. nfs_try_mount_request() function currently tries AUTH_UNIX method even when server does not announces it. But it does not try to use AUTH_NULL when server announces AUTH_NULL. With this patch, AUTH_UNIX behavior as described above is not changed and after the AUTH_UNIX attempt is added AUTH_NULL attempt as the absolutely last chance. With this patch it is possible to mount NFS3 exports with AUTH_NULL method if all other methods are rejected by server. AUTH_NULL method is useful for public read-only data exports which do not require any user authentication. This change fixes mounting of NFS3 AUTH_NULL-only exports without need to specify any special mount options, like -o sec. Signed-off-by: Pali Roh=C3=A1r Cc: stable@vger.kernel.org --- fs/nfs/super.c | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 3fef2afd94bd..4cb319be55ca 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -911,6 +911,7 @@ static struct nfs_server *nfs_try_mount_request(struct = fs_context *fc) struct nfs_fs_context *ctx =3D nfs_fc2context(fc); int status; unsigned int i; + int first_err =3D 0; bool tried_auth_unix =3D false; bool auth_null_in_list =3D false; struct nfs_server *server =3D ERR_PTR(-EACCES); @@ -947,7 +948,8 @@ static struct nfs_server *nfs_try_mount_request(struct = fs_context *fc) /* * No sec=3D option was provided. RFC 2623, section 2.7 suggests we * SHOULD prefer the flavor listed first. However, some servers list - * AUTH_NULL first. Avoid ever choosing AUTH_NULL. + * AUTH_NULL first. So skip AUTH_NULL here and try it as an absolutely + * last chance at the end of this function. */ for (i =3D 0; i < authlist_len; ++i) { rpc_authflavor_t flavor; @@ -971,20 +973,46 @@ static struct nfs_server *nfs_try_mount_request(struc= t fs_context *fc) server =3D ctx->nfs_mod->rpc_ops->create_server(fc); if (!IS_ERR(server)) return server; + if (!first_err) + first_err =3D PTR_ERR(server); } =20 /* - * Nothing we tried so far worked. At this point, give up if we've - * already tried AUTH_UNIX or if the server's list doesn't contain - * AUTH_NULL + * If AUTH_UNIX was not available in the server's list and AUTH_NULL was + * then for compatibility with old NFS3 servers try also AUTH_UNIX. */ - if (tried_auth_unix || !auth_null_in_list) + if (!tried_auth_unix && auth_null_in_list) { + dfprintk(MOUNT, + "NFS: attempting to use auth flavor %u%s\n", + RPC_AUTH_UNIX, + ", even it was not announced by server"); + ctx->selected_flavor =3D RPC_AUTH_UNIX; + server =3D ctx->nfs_mod->rpc_ops->create_server(fc); + if (!IS_ERR(server)) + return server; + tried_auth_unix =3D true; + } + + /* + * Linux MNTv3 server rpc.mountd since nfs-utils version 1.1.3, commit + * https://git.linux-nfs.org/?p=3Dsteved/nfs-utils.git;a=3Dcommit;h=3D3c1= bb23c0379 + * does not include AUTH_NULL into server's list export response even + * when AUTH_NULL is supported and enabled for that export on Linux + * NFS3 server. AUTH_NULL was skipped when processing server's list, + * so always try AUTH_NULL as an absolutely last chance and also when + * it was not available in the server's list. + */ + dfprintk(MOUNT, + "NFS: attempting to use auth flavor %u%s\n", + RPC_AUTH_NULL, + auth_null_in_list ? "" : ", even it was not announced by server"); + ctx->selected_flavor =3D RPC_AUTH_NULL; + server =3D ctx->nfs_mod->rpc_ops->create_server(fc); + if (!IS_ERR(server)) return server; =20 - /* Last chance! Try AUTH_UNIX */ - dfprintk(MOUNT, "NFS: attempting to use auth flavor %u\n", RPC_AUTH_UNIX); - ctx->selected_flavor =3D RPC_AUTH_UNIX; - return ctx->nfs_mod->rpc_ops->create_server(fc); + /* Prefer error code from the first attempt of server's list. */ + return first_err ? ERR_PTR(first_err) : server; } =20 int nfs_try_get_tree(struct fs_context *fc) --=20 2.20.1 From nobody Sat Nov 30 01:57:37 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6CB41AB52D; Thu, 12 Sep 2024 13:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146162; cv=none; b=N7SdKnLHd40Zz2EaPJfx2v+NDDycrEJsQHhLWbTp25pBcj723zTbCQthgiO/7StacJftuTMB2wLh0mHzZD3Ur/vWAEy8oUUXLg9ce9ItkYvnrsKEhlE6PWieoIsmJJAbNQbjg2fpz3i8UvQl4JgA5BBDh4ot8dYoQFoRhFRB/0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146162; c=relaxed/simple; bh=vYTxFFsCzvfKqDGXjnJvxAnURll9M3pNR5qgFnoTbWE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ivSnMhMJHu1ORJhfptohjfDq4EMdY46pOZCqwnQvxbIWoDzVtXXi5kFXjlVcoJaW/YU1dqOmoxBSEvNtYaRbHfCdYpEBHSlwBtkG31Ur4uh8BrtfT0uQQpoQBDvXPiGoe666F7jijB0F8dAJsBSB6I3wpbtcsH60tyH9Y57Rk3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CARefJUH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CARefJUH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 947E4C4CEDA; Thu, 12 Sep 2024 13:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726146161; bh=vYTxFFsCzvfKqDGXjnJvxAnURll9M3pNR5qgFnoTbWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CARefJUHwex36sC8d/Ws5NIyyYVmhyrFfOxjr7/uY00eOLLU+fvO6l2D5RV5D5XRr hpJVXWUMyso4+zUed37yU9LmssUYXnpVeCHHfcDomQzOuQBtLOXVE8jqVAIHltaX4v l+OpWZsg+ILIj6/I5ULnui3rq+FbebsW+XD7DNaEJubRnX5W4yhW2rtR26QoYWF//5 sXiQqnNEvujviydngt9NyPAv4iaZNu6w+XVZY0jpZ8NnQ+nM87crBI5oKtaipF6Eqy B5FdY3MCnm2YvKIU+KvdqzhHpu1uueGJN9NM2m/QgkGbm859Mq5VbcA3oCR3a7RPbg 1g4SzRx7RucdQ== Received: by pali.im (Postfix) id 119E4C01; Thu, 12 Sep 2024 15:02:36 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] nfs: Fix -o sec=none output in /proc/mounts Date: Thu, 12 Sep 2024 15:02:19 +0200 Message-Id: <20240912130220.17032-5-pali@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912130220.17032-1-pali@kernel.org> References: <20240912130220.17032-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Linux nfs userspace tools supports AUTH_NULL flavor under name 'none'. This name is used in /etc/exports file and also in '-o sec' mount option. So for compatibility show AUTH_NULL flavor in /proc/mounts output as 'none' instead of 'null'. Signed-off-by: Pali Roh=C3=A1r Cc: stable@vger.kernel.org --- fs/nfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 4cb319be55ca..86d98d15ee22 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -321,7 +321,7 @@ static const char *nfs_pseudoflavour_to_name(rpc_authfl= avor_t flavour) const char *str; } sec_flavours[NFS_AUTH_INFO_MAX_FLAVORS] =3D { /* update NFS_AUTH_INFO_MAX_FLAVORS when this list changes! */ - { RPC_AUTH_NULL, "null" }, + { RPC_AUTH_NULL, "none" }, { RPC_AUTH_UNIX, "sys" }, { RPC_AUTH_GSS_KRB5, "krb5" }, { RPC_AUTH_GSS_KRB5I, "krb5i" }, --=20 2.20.1 From nobody Sat Nov 30 01:57:37 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90B461A724B; Thu, 12 Sep 2024 13:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; cv=none; b=CAKGTGvKPqhV2yJp0oztuqNLqNimValUs0IR+AAkuN7+EXv5NfANMCOItMxB6REAscRdB/zsJoxJtprUMsDOe+enfzOOa2PX4UUNkf2VZWDnlbOC77z0YAYEhyeCLblmYuua4bkxH+n6qDBpxO+tBNV+41OCMVI5Cd0PYvqqWV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726146161; c=relaxed/simple; bh=8NnT5GcEEYmNpynFrCa/PdBFk8587dLDSKFdhXjTYvY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=V67mYshBF04PASdwxHP66YSj3Skn38mC0LCsbLbotvYthY6Ws1ZXEQ8a3UELf6a4gSkFPKNiiOyxF0Bq+Gh0205K4ZNzvPwBZ9DStCoXrn/uoHJ+oF4LNs/13ANavby0PUaTw1Q7L3UHSuQIXFm2Pah0xcIuYHE4qomuFIMKWkk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rJQOTpfc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rJQOTpfc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 319FEC4CED5; Thu, 12 Sep 2024 13:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726146161; bh=8NnT5GcEEYmNpynFrCa/PdBFk8587dLDSKFdhXjTYvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rJQOTpfcIWk1NVNqFo9JqHoubAl88u+eQ7oGyxtJ207285fZo5KjYLikDJJW0NcOV OWQ6IcCWJu3a2/yiTZNeMK51RXxPtr0Bfq21pPAbb2yPDfc09irLU6zlYJf8sU90e7 31hvwOLmUgYR7M7wYZISh7LL3qFy0FJlNSkRxmn7UYhoz/DQwAulnUkF0yX/JNfPu+ CNrfC8TMMiKxJI4BDJ9S+SzSpYbeBynEKfEQLzrrb7Vv0F39CFBwzPsn1/Is605Tmm qwBw3k28nmf9u5Bj203fBFDjXzM73aF1sM8n6zlmcLxPWHpP7wfTwAyDBXKZXk31ME ayvXToHbNJMkw== Received: by pali.im (Postfix) id 4600CC46; Thu, 12 Sep 2024 15:02:36 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] nfs: Remove duplicate debug message 'using auth flavor' Date: Thu, 12 Sep 2024 15:02:20 +0200 Message-Id: <20240912130220.17032-6-pali@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912130220.17032-1-pali@kernel.org> References: <20240912130220.17032-1-pali@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Function nfs_verify_authflavors() prints debug message 'using auth flavor' on success. So not print same debug message after nfs_verify_authflavors() call again. Signed-off-by: Pali Roh=C3=A1r --- fs/nfs/super.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 86d98d15ee22..be487118cedc 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -938,8 +938,6 @@ static struct nfs_server *nfs_try_mount_request(struct = fs_context *fc) */ if (ctx->auth_info.flavor_len > 0) { status =3D nfs_verify_authflavors(ctx, authlist, authlist_len); - dfprintk(MOUNT, "NFS: using auth flavor %u\n", - ctx->selected_flavor); if (status) return ERR_PTR(status); return ctx->nfs_mod->rpc_ops->create_server(fc); --=20 2.20.1