Skip to contentSkip to conversation

nfs: don't attempt auth methods that require upcall unless we know that gssd is running

PATCH Superseded Jeff Layton 1 participant 2 messages Jan 24, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: don't attempt auth methods that require upcall unless we know that gssd is running

Currently, if the server lists krb5 as an allowed auth method, but gssd isn't running, you'll get the infamous "AUTH_GSS upcall failed" message, even if you didn't request sec=krb5.

This is because nfs4_find_root_sec() establishes a default list of auth methods to try when the admin didn't supply one, and that list contains AUTH_GSS methods first. Skip those methods if gssd isn't running since they won't succeed anyway.

Cc Weston Andros Adamson <[email protected]>
---
 fs/nfs/nfs4proc.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/nfs/nfs4proc.c +7 -0
index 15052b8..468a581 100644
@@ -2900,6 +2900,13 @@ static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
 	} else {
 		/* no flavors specified by user, try default list */
 		for (i = 0; i < ARRAY_SIZE(flav_array); i++) {
+			/*
+			 * Don't attempt to upcall with the default list
+			 * unless we know that gssd is running.
+			 */
+			if (!gssd_running(server->nfs_client->cl_net))
+				continue;
+
 			status = nfs4_lookup_root_sec(server, fhandle, info,
 						      flav_array[i]);
 			if (status == -NFS4ERR_WRONGSEC || status == -EACCES)
Signature · 1 line
1.8.5.3
#1 lore raw
Quoted 23 lines · On Fri, 24 Jan 2014 07:09:28 -0500 Jeff Layton <[email protected]> wrote:

Currently, if the server lists krb5 as an allowed auth method, but gssd isn't running, you'll get the infamous "AUTH_GSS upcall failed" message, even if you didn't request sec=krb5.

This is because nfs4_find_root_sec() establishes a default list of auth methods to try when the admin didn't supply one, and that list contains AUTH_GSS methods first. Skip those methods if gssd isn't running since they won't succeed anyway.

Cc Weston Andros Adamson <[email protected]>
---
 fs/nfs/nfs4proc.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/nfs/nfs4proc.c +0 -0
index 15052b8..468a581 100644
@@ -2900,6 +2900,13 @@ static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
 	} else {
 		/* no flavors specified by user, try default list */
 		for (i = 0; i < ARRAY_SIZE(flav_array); i++) {

fs/nfs/nfs4proc.c static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, · line 2912

Quoted 10 lines
fs/nfs/nfs4proc.c +7 -0
+			/*
+			 * Don't attempt to upcall with the default list
+			 * unless we know that gssd is running.
+			 */
+			if (!gssd_running(server->nfs_client->cl_net))
+				continue;
+
 			status = nfs4_lookup_root_sec(server, fhandle, info,
 						      flav_array[i]);
 			if (status == -NFS4ERR_WRONGSEC || status == -EACCES)

Eep! Wrong patch. I'll resend. Sorry for the noise...

Signature · 1 line
Jeff Layton <[email protected]>