aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/auth.h7
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c20
2 files changed, 12 insertions, 15 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 04ebc24db348..b68c11a2d6dd 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -66,7 +66,12 @@ struct rpc_cred_cache {
66 66
67struct rpc_auth { 67struct rpc_auth {
68 unsigned int au_cslack; /* call cred size estimate */ 68 unsigned int au_cslack; /* call cred size estimate */
69 unsigned int au_rslack; /* reply verf size guess */ 69 /* guess at number of u32's auth adds before
70 * reply data; normally the verifier size: */
71 unsigned int au_rslack;
72 /* for gss, used to calculate au_rslack: */
73 unsigned int au_verfsize;
74
70 unsigned int au_flags; /* various flags */ 75 unsigned int au_flags; /* various flags */
71 struct rpc_authops * au_ops; /* operations */ 76 struct rpc_authops * au_ops; /* operations */
72 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 77 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index d2b08f16c257..dc95b797ca65 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -886,8 +886,6 @@ static u32 *
886gss_validate(struct rpc_task *task, u32 *p) 886gss_validate(struct rpc_task *task, u32 *p)
887{ 887{
888 struct rpc_cred *cred = task->tk_msg.rpc_cred; 888 struct rpc_cred *cred = task->tk_msg.rpc_cred;
889 struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
890 gc_base);
891 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); 889 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
892 u32 seq, qop_state; 890 u32 seq, qop_state;
893 struct kvec iov; 891 struct kvec iov;
@@ -915,18 +913,9 @@ gss_validate(struct rpc_task *task, u32 *p)
915 cred->cr_flags &= ~RPCAUTH_CRED_UPTODATE; 913 cred->cr_flags &= ~RPCAUTH_CRED_UPTODATE;
916 if (maj_stat) 914 if (maj_stat)
917 goto out_bad; 915 goto out_bad;
918 switch (gss_cred->gc_service) { 916 /* We leave it to unwrap to calculate au_rslack. For now we just
919 case RPC_GSS_SVC_NONE: 917 * calculate the length of the verifier: */
920 /* verifier data, flavor, length: */ 918 task->tk_auth->au_verfsize = XDR_QUADLEN(len) + 2;
921 task->tk_auth->au_rslack = XDR_QUADLEN(len) + 2;
922 break;
923 case RPC_GSS_SVC_INTEGRITY:
924 /* verifier data, flavor, length, length, sequence number: */
925 task->tk_auth->au_rslack = XDR_QUADLEN(len) + 4;
926 break;
927 case RPC_GSS_SVC_PRIVACY:
928 goto out_bad;
929 }
930 gss_put_ctx(ctx); 919 gss_put_ctx(ctx);
931 dprintk("RPC: %4u GSS gss_validate: gss_verify_mic succeeded.\n", 920 dprintk("RPC: %4u GSS gss_validate: gss_verify_mic succeeded.\n",
932 task->tk_pid); 921 task->tk_pid);
@@ -1067,6 +1056,7 @@ gss_unwrap_resp(struct rpc_task *task,
1067 struct gss_cred *gss_cred = container_of(cred, struct gss_cred, 1056 struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
1068 gc_base); 1057 gc_base);
1069 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); 1058 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
1059 u32 *savedp = p;
1070 int status = -EIO; 1060 int status = -EIO;
1071 1061
1072 if (ctx->gc_proc != RPC_GSS_PROC_DATA) 1062 if (ctx->gc_proc != RPC_GSS_PROC_DATA)
@@ -1082,6 +1072,8 @@ gss_unwrap_resp(struct rpc_task *task,
1082 case RPC_GSS_SVC_PRIVACY: 1072 case RPC_GSS_SVC_PRIVACY:
1083 break; 1073 break;
1084 } 1074 }
1075 /* take into account extra slack for integrity and privacy cases: */
1076 task->tk_auth->au_rslack = task->tk_auth->au_verfsize + (p - savedp);
1085out_decode: 1077out_decode:
1086 status = decode(rqstp, p, obj); 1078 status = decode(rqstp, p, obj);
1087out: 1079out: