From: Brendan Cully Subject: [PATCH] NFSv4 fix (backport) Date: Wed, 8 Oct 2008 11:14:45 -0700 Message-ID: <20081008181445.GC32087@kremvax.cs.ubc.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="J/dobhs11T7y2rNN" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Without the attached patch (a backport from the linux-2.6 tree), I get a null pointer dereference modprobing auth_gss.c. It'd be nice if this were applied to the 2.6.18 tree. --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="backport-bf13f511047b.patch" # HG changeset patch # User J. Bruce Fields # Date 1185305098 25200 # Node ID bf13f511047be6816b39ce3f88ba2b2d50d4730b # Parent bab5c71cc2e6d78cd5dca4c990cb00db85497810 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 Signed-off-by: "J. Bruce Fields" Cc: Neil Brown Cc: Trond Myklebust Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds committer: Linus Torvalds diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -769,11 +769,12 @@ new->h.flavour = &svcauthops_gss; new->pseudoflavor = pseudoflavor; + stat = 0; test = auth_domain_lookup(name, &new->h); - if (test != &new->h) { /* XXX Duplicate registration? */ - auth_domain_put(&new->h); - /* dangling ref-count... */ - goto out; + if (test != &new->h) { /* Duplicate registration */ + auth_domain_put(test); + kfree(new->h.name); + goto out_free_dom; } return 0; --J/dobhs11T7y2rNN Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --J/dobhs11T7y2rNN--