aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2014-05-12 18:10:58 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-05-30 17:32:17 -0400
commita5cddc885b99458df963a75abbe0b40cbef56c48 (patch)
treeb7f200949823f98207aa2d2fd72c112fa3e6ee8e /net/sunrpc
parentd05d5744ef67879877dbe2e3d0fb9fcc27ee44e5 (diff)
nfsd4: better reservation of head space for krb5
RPC_MAX_AUTH_SIZE is scattered around several places. Better to set it once in the auth code, where this kind of estimate should be made. And while we're at it we can leave it zero when we're not using krb5i or krb5p. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c2
-rw-r--r--net/sunrpc/svcauth.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 0f73f4507746..4ce5eccec1f6 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1503,6 +1503,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
1503 if (unwrap_integ_data(rqstp, &rqstp->rq_arg, 1503 if (unwrap_integ_data(rqstp, &rqstp->rq_arg,
1504 gc->gc_seq, rsci->mechctx)) 1504 gc->gc_seq, rsci->mechctx))
1505 goto garbage_args; 1505 goto garbage_args;
1506 rqstp->rq_auth_slack = RPC_MAX_AUTH_SIZE;
1506 break; 1507 break;
1507 case RPC_GSS_SVC_PRIVACY: 1508 case RPC_GSS_SVC_PRIVACY:
1508 /* placeholders for length and seq. number: */ 1509 /* placeholders for length and seq. number: */
@@ -1511,6 +1512,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
1511 if (unwrap_priv_data(rqstp, &rqstp->rq_arg, 1512 if (unwrap_priv_data(rqstp, &rqstp->rq_arg,
1512 gc->gc_seq, rsci->mechctx)) 1513 gc->gc_seq, rsci->mechctx))
1513 goto garbage_args; 1514 goto garbage_args;
1515 rqstp->rq_auth_slack = RPC_MAX_AUTH_SIZE * 2;
1514 break; 1516 break;
1515 default: 1517 default:
1516 goto auth_err; 1518 goto auth_err;
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index 2af7b0cba43a..79c0f3459b5c 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -54,6 +54,8 @@ svc_authenticate(struct svc_rqst *rqstp, __be32 *authp)
54 } 54 }
55 spin_unlock(&authtab_lock); 55 spin_unlock(&authtab_lock);
56 56
57 rqstp->rq_auth_slack = 0;
58
57 rqstp->rq_authop = aops; 59 rqstp->rq_authop = aops;
58 return aops->accept(rqstp, authp); 60 return aops->accept(rqstp, authp);
59} 61}