Skip to content

Commit

Permalink
Merge tag 'nfs-for-3.12-3' of git://git.linux-nfs.org/projects/trondm…
Browse files Browse the repository at this point in the history
…y/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
  • Loading branch information
Linus Torvalds committed Sep 21, 2013
2 parents 2457aaf + a0f6ed8 commit c43a385
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions net/sunrpc/auth_gss/auth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit c43a385

Please sign in to comment.