diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-10-08 16:09:04 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-10-10 11:04:47 -0400 |
commit | b26ec9b11b309acd9f6bb15fcc9bb396091384e8 (patch) | |
tree | 03f23b59f4881c4b1bffacf8b49337fa99df92c8 /net | |
parent | 3be34555fa294483202483c4b171a8d335447187 (diff) |
svcrpc: handle some gssproxy encoding errors
Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_gss/gss_rpc_xdr.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c index f0f78c5f1c7d..1ec19f6f0c2b 100644 --- a/net/sunrpc/auth_gss/gss_rpc_xdr.c +++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c | |||
@@ -559,6 +559,8 @@ static int gssx_enc_cred(struct xdr_stream *xdr, | |||
559 | 559 | ||
560 | /* cred->elements */ | 560 | /* cred->elements */ |
561 | err = dummy_enc_credel_array(xdr, &cred->elements); | 561 | err = dummy_enc_credel_array(xdr, &cred->elements); |
562 | if (err) | ||
563 | return err; | ||
562 | 564 | ||
563 | /* cred->cred_handle_reference */ | 565 | /* cred->cred_handle_reference */ |
564 | err = gssx_enc_buffer(xdr, &cred->cred_handle_reference); | 566 | err = gssx_enc_buffer(xdr, &cred->cred_handle_reference); |
@@ -740,22 +742,20 @@ void gssx_enc_accept_sec_context(struct rpc_rqst *req, | |||
740 | goto done; | 742 | goto done; |
741 | 743 | ||
742 | /* arg->context_handle */ | 744 | /* arg->context_handle */ |
743 | if (arg->context_handle) { | 745 | if (arg->context_handle) |
744 | err = gssx_enc_ctx(xdr, arg->context_handle); | 746 | err = gssx_enc_ctx(xdr, arg->context_handle); |
745 | if (err) | 747 | else |
746 | goto done; | ||
747 | } else { | ||
748 | err = gssx_enc_bool(xdr, 0); | 748 | err = gssx_enc_bool(xdr, 0); |
749 | } | 749 | if (err) |
750 | goto done; | ||
750 | 751 | ||
751 | /* arg->cred_handle */ | 752 | /* arg->cred_handle */ |
752 | if (arg->cred_handle) { | 753 | if (arg->cred_handle) |
753 | err = gssx_enc_cred(xdr, arg->cred_handle); | 754 | err = gssx_enc_cred(xdr, arg->cred_handle); |
754 | if (err) | 755 | else |
755 | goto done; | ||
756 | } else { | ||
757 | err = gssx_enc_bool(xdr, 0); | 756 | err = gssx_enc_bool(xdr, 0); |
758 | } | 757 | if (err) |
758 | goto done; | ||
759 | 759 | ||
760 | /* arg->input_token */ | 760 | /* arg->input_token */ |
761 | err = gssx_enc_in_token(xdr, &arg->input_token); | 761 | err = gssx_enc_in_token(xdr, &arg->input_token); |
@@ -763,13 +763,12 @@ void gssx_enc_accept_sec_context(struct rpc_rqst *req, | |||
763 | goto done; | 763 | goto done; |
764 | 764 | ||
765 | /* arg->input_cb */ | 765 | /* arg->input_cb */ |
766 | if (arg->input_cb) { | 766 | if (arg->input_cb) |
767 | err = gssx_enc_cb(xdr, arg->input_cb); | 767 | err = gssx_enc_cb(xdr, arg->input_cb); |
768 | if (err) | 768 | else |
769 | goto done; | ||
770 | } else { | ||
771 | err = gssx_enc_bool(xdr, 0); | 769 | err = gssx_enc_bool(xdr, 0); |
772 | } | 770 | if (err) |
771 | goto done; | ||
773 | 772 | ||
774 | err = gssx_enc_bool(xdr, arg->ret_deleg_cred); | 773 | err = gssx_enc_bool(xdr, arg->ret_deleg_cred); |
775 | if (err) | 774 | if (err) |