public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
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	[thread overview]
Message-ID: <20240912130220.17032-2-pali@kernel.org> (raw)
In-Reply-To: <20240912130220.17032-1-pali@kernel.org>

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=none 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ár <pali@kernel.org>
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_context *ctx,
 		goto out;
 	}
 
+	/*
+	 * 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=none then allow to
+	 * continue mounting export via AUTH_NULL.
+	 */
+	if (ctx->auth_info.flavor_len == 1 && ctx->auth_info.flavors[0] == RPC_AUTH_NULL) {
+		dfprintk(MOUNT,
+			 "NFS: requested auth flavor \"none\" is not announced by server, continuing anyway\n");
+		flavor = RPC_AUTH_NULL;
+		goto out;
+	}
+
 	dfprintk(MOUNT,
 		 "NFS: specified auth flavors not supported by server\n");
 	return -EACCES;
-- 
2.20.1


  reply	other threads:[~2024-09-12 13:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 13:02 [PATCH 0/5] nfs: Fix mounting NFS3 AUTH_NULL exports Pali Rohár
2024-09-12 13:02 ` Pali Rohár [this message]
2024-09-12 13:02 ` [PATCH 2/5] nfs: Propagate AUTH_NULL/AUTH_UNIX PATHCONF NFS3ERR_ACCESS failures Pali Rohár
2024-09-12 13:02 ` [PATCH 3/5] nfs: Try to use AUTH_NULL for NFS3 mount when no -o sec was given Pali Rohár
2024-09-12 13:02 ` [PATCH 4/5] nfs: Fix -o sec=none output in /proc/mounts Pali Rohár
2024-09-12 13:02 ` [PATCH 5/5] nfs: Remove duplicate debug message 'using auth flavor' Pali Rohár
2024-09-12 21:06 ` [PATCH 0/5] nfs: Fix mounting NFS3 AUTH_NULL exports Anna Schumaker
2024-09-12 21:11   ` Pali Rohár
2024-10-05 15:15 ` Pali Rohár
2024-10-28  9:54   ` Pali Rohár
2024-12-22 16:40 ` Pali Rohár
2025-04-18 18:03   ` Pali Rohár
2025-05-04  8:48     ` Pali Rohár
2025-05-18  9:57       ` Pali Rohár
2025-09-20 13:35 ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240912130220.17032-2-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox