aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/svcauth_gss.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/sunrpc/auth_gss/svcauth_gss.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index cc385b3a59c2..8d0f7d3c71c8 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -67,7 +67,6 @@ static int netobj_equal(struct xdr_netobj *a, struct xdr_netobj *b)
67 67
68#define RSI_HASHBITS 6 68#define RSI_HASHBITS 6
69#define RSI_HASHMAX (1<<RSI_HASHBITS) 69#define RSI_HASHMAX (1<<RSI_HASHBITS)
70#define RSI_HASHMASK (RSI_HASHMAX-1)
71 70
72struct rsi { 71struct rsi {
73 struct cache_head h; 72 struct cache_head h;
@@ -319,7 +318,6 @@ static struct rsi *rsi_update(struct rsi *new, struct rsi *old)
319 318
320#define RSC_HASHBITS 10 319#define RSC_HASHBITS 10
321#define RSC_HASHMAX (1<<RSC_HASHBITS) 320#define RSC_HASHMAX (1<<RSC_HASHBITS)
322#define RSC_HASHMASK (RSC_HASHMAX-1)
323 321
324#define GSS_SEQ_WIN 128 322#define GSS_SEQ_WIN 128
325 323
@@ -964,7 +962,7 @@ svcauth_gss_set_client(struct svc_rqst *rqstp)
964 if (rqstp->rq_gssclient == NULL) 962 if (rqstp->rq_gssclient == NULL)
965 return SVC_DENIED; 963 return SVC_DENIED;
966 stat = svcauth_unix_set_client(rqstp); 964 stat = svcauth_unix_set_client(rqstp);
967 if (stat == SVC_DROP) 965 if (stat == SVC_DROP || stat == SVC_CLOSE)
968 return stat; 966 return stat;
969 return SVC_OK; 967 return SVC_OK;
970} 968}
@@ -1018,7 +1016,7 @@ static int svcauth_gss_handle_init(struct svc_rqst *rqstp,
1018 return SVC_DENIED; 1016 return SVC_DENIED;
1019 memset(&rsikey, 0, sizeof(rsikey)); 1017 memset(&rsikey, 0, sizeof(rsikey));
1020 if (dup_netobj(&rsikey.in_handle, &gc->gc_ctx)) 1018 if (dup_netobj(&rsikey.in_handle, &gc->gc_ctx))
1021 return SVC_DROP; 1019 return SVC_CLOSE;
1022 *authp = rpc_autherr_badverf; 1020 *authp = rpc_autherr_badverf;
1023 if (svc_safe_getnetobj(argv, &tmpobj)) { 1021 if (svc_safe_getnetobj(argv, &tmpobj)) {
1024 kfree(rsikey.in_handle.data); 1022 kfree(rsikey.in_handle.data);
@@ -1026,38 +1024,35 @@ static int svcauth_gss_handle_init(struct svc_rqst *rqstp,
1026 } 1024 }
1027 if (dup_netobj(&rsikey.in_token, &tmpobj)) { 1025 if (dup_netobj(&rsikey.in_token, &tmpobj)) {
1028 kfree(rsikey.in_handle.data); 1026 kfree(rsikey.in_handle.data);
1029 return SVC_DROP; 1027 return SVC_CLOSE;
1030 } 1028 }
1031 1029
1032 /* Perform upcall, or find upcall result: */ 1030 /* Perform upcall, or find upcall result: */
1033 rsip = rsi_lookup(&rsikey); 1031 rsip = rsi_lookup(&rsikey);
1034 rsi_free(&rsikey); 1032 rsi_free(&rsikey);
1035 if (!rsip) 1033 if (!rsip)
1036 return SVC_DROP; 1034 return SVC_CLOSE;
1037 switch (cache_check(&rsi_cache, &rsip->h, &rqstp->rq_chandle)) { 1035 if (cache_check(&rsi_cache, &rsip->h, &rqstp->rq_chandle) < 0)
1038 case -EAGAIN:
1039 case -ETIMEDOUT:
1040 case -ENOENT:
1041 /* No upcall result: */ 1036 /* No upcall result: */
1042 return SVC_DROP; 1037 return SVC_CLOSE;
1043 case 0: 1038
1044 ret = SVC_DROP; 1039 ret = SVC_CLOSE;
1045 /* Got an answer to the upcall; use it: */ 1040 /* Got an answer to the upcall; use it: */
1046 if (gss_write_init_verf(rqstp, rsip)) 1041 if (gss_write_init_verf(rqstp, rsip))
1047 goto out; 1042 goto out;
1048 if (resv->iov_len + 4 > PAGE_SIZE) 1043 if (resv->iov_len + 4 > PAGE_SIZE)
1049 goto out; 1044 goto out;
1050 svc_putnl(resv, RPC_SUCCESS); 1045 svc_putnl(resv, RPC_SUCCESS);
1051 if (svc_safe_putnetobj(resv, &rsip->out_handle)) 1046 if (svc_safe_putnetobj(resv, &rsip->out_handle))
1052 goto out; 1047 goto out;
1053 if (resv->iov_len + 3 * 4 > PAGE_SIZE) 1048 if (resv->iov_len + 3 * 4 > PAGE_SIZE)
1054 goto out; 1049 goto out;
1055 svc_putnl(resv, rsip->major_status); 1050 svc_putnl(resv, rsip->major_status);
1056 svc_putnl(resv, rsip->minor_status); 1051 svc_putnl(resv, rsip->minor_status);
1057 svc_putnl(resv, GSS_SEQ_WIN); 1052 svc_putnl(resv, GSS_SEQ_WIN);
1058 if (svc_safe_putnetobj(resv, &rsip->out_token)) 1053 if (svc_safe_putnetobj(resv, &rsip->out_token))
1059 goto out; 1054 goto out;
1060 } 1055
1061 ret = SVC_COMPLETE; 1056 ret = SVC_COMPLETE;
1062out: 1057out:
1063 cache_put(&rsip->h, &rsi_cache); 1058 cache_put(&rsip->h, &rsi_cache);
@@ -1106,7 +1101,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
1106 1101
1107 /* credential is: 1102 /* credential is:
1108 * version(==1), proc(0,1,2,3), seq, service (1,2,3), handle 1103 * version(==1), proc(0,1,2,3), seq, service (1,2,3), handle
1109 * at least 5 u32s, and is preceeded by length, so that makes 6. 1104 * at least 5 u32s, and is preceded by length, so that makes 6.
1110 */ 1105 */
1111 1106
1112 if (argv->iov_len < 5 * 4) 1107 if (argv->iov_len < 5 * 4)