From: Neil Brown <neilb@cse.unsw.edu.au>

That's along the right lines, but cr_group_info hasn't been allocated at
this point.  The patch on top of that one should fix up svcauth_gss.  It
compiles, but I'm not in a position to test it.


---

 25-akpm/net/sunrpc/auth_gss/svcauth_gss.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff -puN net/sunrpc/auth_gss/svcauth_gss.c~knfsd-rpcsec_gss-minimal-support-NGROUPS-fix-2 net/sunrpc/auth_gss/svcauth_gss.c
--- 25/net/sunrpc/auth_gss/svcauth_gss.c~knfsd-rpcsec_gss-minimal-support-NGROUPS-fix-2	Wed Feb 25 16:53:43 2004
+++ 25-akpm/net/sunrpc/auth_gss/svcauth_gss.c	Wed Feb 25 16:53:43 2004
@@ -299,6 +299,8 @@ static void rsc_free(struct rsc *rsci)
 	kfree(rsci->handle.data);
 	if (rsci->mechctx)
 		gss_delete_sec_context(&rsci->mechctx);
+	if (rsci->cred.cr_group_info)
+		put_group_info(rsci->cred.cr_group_info);
 }
 
 static void rsc_put(struct cache_head *item, struct cache_detail *cd)
@@ -341,6 +343,7 @@ rsc_update(struct rsc *new, struct rsc *
 	memset(&new->seqdata, 0, sizeof(new->seqdata));
 	spin_lock_init(&new->seqdata.sd_lock);
 	new->cred = tmp->cred;
+	tmp->cred.cr_group_info = NULL;
 }
 
 static int rsc_parse(struct cache_detail *cd,
@@ -386,7 +389,8 @@ static int rsc_parse(struct cache_detail
 		/* number of additional gid's */
 		if (get_int(&mesg, &N))
 			goto out;
-		if (N > SVC_CRED_NGROUPS)
+		rsci.cred.cr_group_info = groups_alloc(N);
+		if (rsci.cred.cr_group_info == NULL)
 			goto out;
 
 		/* gid's */
@@ -397,9 +401,6 @@ static int rsc_parse(struct cache_detail
 			GROUP_AT(rsci.cred.cr_group_info, i) = gid;
 		}
 
-		if (N < SVC_CRED_NGROUPS)
-			GROUP_AT(rsci.cred.cr_group_info, N) = NOGROUP;
-
 		/* mech name */
 		len = qword_get(&mesg, buf, mlen);
 		if (len < 0)
@@ -832,6 +833,7 @@ svcauth_gss_accept(struct svc_rqst *rqst
 		/* For use when wrapping: */
 		svcdata->body_start = resv->iov_base + 1;
 		rqstp->rq_cred = rsci->cred;
+		get_group_info(rsci->cred.cr_group_info);
 		ret = SVC_OK;
 		goto out;
 	}
@@ -857,6 +859,9 @@ svcauth_gss_release(struct svc_rqst *rqs
 	if (rqstp->rq_client)
 		auth_domain_put(rqstp->rq_client);
 	rqstp->rq_client = NULL;
+	if (rqstp->rq_cred.cr_group_info)
+		put_group_info(rqstp->rq_cred.cr_group_info);
+	rqstp->rq_cred.cr_group_info = NULL;
 
 	return 0;
 }

_