Browse Source

Merge tag 'nfsd-4.8-2' of git://linux-nfs.org/~bfields/linux

Pull nfsd bugfix from Bruce Fields:
 "Fix a memory corruption bug that I introduced in 4.7"

* tag 'nfsd-4.8-2' of git://linux-nfs.org/~bfields/linux:
  svcauth_gss: Revert 64c59a3726f2 ("Remove unnecessary allocation")
Linus Torvalds 9 years ago
parent
commit
87ee1280ff
1 changed files with 3 additions and 2 deletions
  1. 3 2
      net/sunrpc/auth_gss/svcauth_gss.c

+ 3 - 2
net/sunrpc/auth_gss/svcauth_gss.c

@@ -569,9 +569,10 @@ gss_svc_searchbyctx(struct cache_detail *cd, struct xdr_netobj *handle)
 	struct rsc *found;
 	struct rsc *found;
 
 
 	memset(&rsci, 0, sizeof(rsci));
 	memset(&rsci, 0, sizeof(rsci));
-	rsci.handle.data = handle->data;
-	rsci.handle.len = handle->len;
+	if (dup_to_netobj(&rsci.handle, handle->data, handle->len))
+		return NULL;
 	found = rsc_lookup(cd, &rsci);
 	found = rsc_lookup(cd, &rsci);
+	rsc_free(&rsci);
 	if (!found)
 	if (!found)
 		return NULL;
 		return NULL;
 	if (cache_check(cd, &found->h, NULL))
 	if (cache_check(cd, &found->h, NULL))