diff options
| -rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index e4ada15ed856..d2ccc7e8faab 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
| @@ -586,6 +586,20 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci, | |||
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | static int | 588 | static int |
| 589 | gss_write_null_verf(struct svc_rqst *rqstp) | ||
| 590 | { | ||
| 591 | u32 *p; | ||
| 592 | |||
| 593 | svc_putu32(rqstp->rq_res.head, htonl(RPC_AUTH_NULL)); | ||
| 594 | p = rqstp->rq_res.head->iov_base + rqstp->rq_res.head->iov_len; | ||
| 595 | /* don't really need to check if head->iov_len > PAGE_SIZE ... */ | ||
| 596 | *p++ = 0; | ||
| 597 | if (!xdr_ressize_check(rqstp, p)) | ||
| 598 | return -1; | ||
| 599 | return 0; | ||
| 600 | } | ||
| 601 | |||
| 602 | static int | ||
| 589 | gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq) | 603 | gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq) |
| 590 | { | 604 | { |
| 591 | u32 xdr_seq; | 605 | u32 xdr_seq; |
| @@ -876,12 +890,18 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp) | |||
| 876 | case -ENOENT: | 890 | case -ENOENT: |
| 877 | goto drop; | 891 | goto drop; |
| 878 | case 0: | 892 | case 0: |
| 879 | rsci = gss_svc_searchbyctx(&rsip->out_handle); | 893 | if (rsip->major_status == GSS_S_COMPLETE) { |
| 880 | if (!rsci) { | 894 | rsci = gss_svc_searchbyctx(&rsip->out_handle); |
| 881 | goto drop; | 895 | if (!rsci) { |
| 896 | goto drop; | ||
| 897 | } | ||
| 898 | if (gss_write_verf(rqstp, rsci->mechctx, | ||
| 899 | GSS_SEQ_WIN)) | ||
| 900 | goto drop; | ||
| 901 | } else { | ||
| 902 | if (gss_write_null_verf(rqstp)) | ||
| 903 | goto drop; | ||
| 882 | } | 904 | } |
| 883 | if (gss_write_verf(rqstp, rsci->mechctx, GSS_SEQ_WIN)) | ||
| 884 | goto drop; | ||
| 885 | if (resv->iov_len + 4 > PAGE_SIZE) | 905 | if (resv->iov_len + 4 > PAGE_SIZE) |
| 886 | goto drop; | 906 | goto drop; |
| 887 | svc_putu32(resv, rpc_success); | 907 | svc_putu32(resv, rpc_success); |
