aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-21 18:59:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-21 18:59:41 -0400
commitc43a3855f41a25330326570d8e8d54e9927b3f56 (patch)
tree8bb5d09bbc0222112aa968a10108565231a117b6 /net
parent2457aaf73a97a97c8596ed3903bd09601976f3bc (diff)
parenta0f6ed8ebe4f6d494ef70f67d4c0c153cbf59577 (diff)
Merge tag 'nfs-for-3.12-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfix from Trond Myklebust: "Fix a regression due to incorrect sharing of gss auth caches" * tag 'nfs-for-3.12-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: RPCSEC_GSS: fix crash on destroying gss auth
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index fcac5d141717..084656671d6e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -1075,6 +1075,15 @@ gss_destroy(struct rpc_auth *auth)
1075 kref_put(&gss_auth->kref, gss_free_callback); 1075 kref_put(&gss_auth->kref, gss_free_callback);
1076} 1076}
1077 1077
1078/*
1079 * Auths may be shared between rpc clients that were cloned from a
1080 * common client with the same xprt, if they also share the flavor and
1081 * target_name.
1082 *
1083 * The auth is looked up from the oldest parent sharing the same
1084 * cl_xprt, and the auth itself references only that common parent
1085 * (which is guaranteed to last as long as any of its descendants).
1086 */
1078static struct gss_auth * 1087static struct gss_auth *
1079gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args, 1088gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
1080 struct rpc_clnt *clnt, 1089 struct rpc_clnt *clnt,
@@ -1088,6 +1097,8 @@ gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
1088 gss_auth, 1097 gss_auth,
1089 hash, 1098 hash,
1090 hashval) { 1099 hashval) {
1100 if (gss_auth->client != clnt)
1101 continue;
1091 if (gss_auth->rpc_auth.au_flavor != args->pseudoflavor) 1102 if (gss_auth->rpc_auth.au_flavor != args->pseudoflavor)
1092 continue; 1103 continue;
1093 if (gss_auth->target_name != args->target_name) { 1104 if (gss_auth->target_name != args->target_name) {