aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-07-23 21:43:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-24 15:24:58 -0400
commitcb276805803b8e0616159d80a441ab26a931ada4 (patch)
tree9c2e3db058e07ac7e7f9cb6a76a33a8937f17ad7 /net/sunrpc/auth_gss
parentd1709e477f203c0538f94c4d1ac981d08325eebf (diff)
nfsd: fix possible oops on re-insertion of rpcsec_gss modules
The handling of the re-registration case is wrong here; the "test" that was returned from auth_domain_lookup will not be used again, so that reference should be put. And auth_domain_lookup never did anything with "new" in this case, so we should just clean it up ourself. Thanks to Akinobu Mita for bug report, analysis, and testing. Cc: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Cc: Neil Brown <neilb@suse.de> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 490697542fc2..dc2f41e9f577 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -769,11 +769,12 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
769 new->h.flavour = &svcauthops_gss; 769 new->h.flavour = &svcauthops_gss;
770 new->pseudoflavor = pseudoflavor; 770 new->pseudoflavor = pseudoflavor;
771 771
772 stat = 0;
772 test = auth_domain_lookup(name, &new->h); 773 test = auth_domain_lookup(name, &new->h);
773 if (test != &new->h) { /* XXX Duplicate registration? */ 774 if (test != &new->h) { /* Duplicate registration */
774 auth_domain_put(&new->h); 775 auth_domain_put(test);
775 /* dangling ref-count... */ 776 kfree(new->h.name);
776 goto out; 777 goto out_free_dom;
777 } 778 }
778 return 0; 779 return 0;
779 780