summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-21 15:59:41 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-21 15:59:41 -0700
commitc43a3855f41a25330326570d8e8d54e9927b3f56 (patch)
tree8bb5d09bbc0222112aa968a10108565231a117b6 /net
parent2457aaf73a97a97c8596ed3903bd09601976f3bc (diff)
parenta0f6ed8ebe4f6d494ef70f67d4c0c153cbf59577 (diff)
downloadblackbird-op-linux-c43a3855f41a25330326570d8e8d54e9927b3f56.tar.gz
blackbird-op-linux-c43a3855f41a25330326570d8e8d54e9927b3f56.zip
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)
kref_put(&gss_auth->kref, gss_free_callback);
}
+/*
+ * Auths may be shared between rpc clients that were cloned from a
+ * common client with the same xprt, if they also share the flavor and
+ * target_name.
+ *
+ * The auth is looked up from the oldest parent sharing the same
+ * cl_xprt, and the auth itself references only that common parent
+ * (which is guaranteed to last as long as any of its descendants).
+ */
static struct gss_auth *
gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
struct rpc_clnt *clnt,
@@ -1088,6 +1097,8 @@ gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
gss_auth,
hash,
hashval) {
+ if (gss_auth->client != clnt)
+ continue;
if (gss_auth->rpc_auth.au_flavor != args->pseudoflavor)
continue;
if (gss_auth->target_name != args->target_name) {
OpenPOWER on IntegriCloud