Skip to content

Commit c43a385

Browse files
committed
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
2 parents 2457aaf + a0f6ed8 commit c43a385

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

net/sunrpc/auth_gss/auth_gss.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,15 @@ gss_destroy(struct rpc_auth *auth)
10751075
kref_put(&gss_auth->kref, gss_free_callback);
10761076
}
10771077

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+
*/
10781087
static struct gss_auth *
10791088
gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
10801089
struct rpc_clnt *clnt,
@@ -1088,6 +1097,8 @@ gss_auth_find_or_add_hashed(struct rpc_auth_create_args *args,
10881097
gss_auth,
10891098
hash,
10901099
hashval) {
1100+
if (gss_auth->client != clnt)
1101+
continue;
10911102
if (gss_auth->rpc_auth.au_flavor != args->pseudoflavor)
10921103
continue;
10931104
if (gss_auth->target_name != args->target_name) {

0 commit comments

Comments
 (0)