Commit b26ec9b11b309acd9f6bb15fcc9bb396091384e8
1 parent
3be34555fa
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
svcrpc: handle some gssproxy encoding errors
Reported-by: Andi Kleen <andi@firstfloor.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Showing 1 changed file with 14 additions and 15 deletions Side-by-side Diff
net/sunrpc/auth_gss/gss_rpc_xdr.c
... | ... | @@ -559,6 +559,8 @@ |
559 | 559 | |
560 | 560 | /* cred->elements */ |
561 | 561 | err = dummy_enc_credel_array(xdr, &cred->elements); |
562 | + if (err) | |
563 | + return err; | |
562 | 564 | |
563 | 565 | /* cred->cred_handle_reference */ |
564 | 566 | err = gssx_enc_buffer(xdr, &cred->cred_handle_reference); |
565 | 567 | |
566 | 568 | |
567 | 569 | |
568 | 570 | |
569 | 571 | |
... | ... | @@ -740,22 +742,20 @@ |
740 | 742 | goto done; |
741 | 743 | |
742 | 744 | /* arg->context_handle */ |
743 | - if (arg->context_handle) { | |
745 | + if (arg->context_handle) | |
744 | 746 | err = gssx_enc_ctx(xdr, arg->context_handle); |
745 | - if (err) | |
746 | - goto done; | |
747 | - } else { | |
747 | + else | |
748 | 748 | err = gssx_enc_bool(xdr, 0); |
749 | - } | |
749 | + if (err) | |
750 | + goto done; | |
750 | 751 | |
751 | 752 | /* arg->cred_handle */ |
752 | - if (arg->cred_handle) { | |
753 | + if (arg->cred_handle) | |
753 | 754 | err = gssx_enc_cred(xdr, arg->cred_handle); |
754 | - if (err) | |
755 | - goto done; | |
756 | - } else { | |
755 | + else | |
757 | 756 | err = gssx_enc_bool(xdr, 0); |
758 | - } | |
757 | + if (err) | |
758 | + goto done; | |
759 | 759 | |
760 | 760 | /* arg->input_token */ |
761 | 761 | err = gssx_enc_in_token(xdr, &arg->input_token); |
762 | 762 | |
763 | 763 | |
... | ... | @@ -763,13 +763,12 @@ |
763 | 763 | goto done; |
764 | 764 | |
765 | 765 | /* arg->input_cb */ |
766 | - if (arg->input_cb) { | |
766 | + if (arg->input_cb) | |
767 | 767 | err = gssx_enc_cb(xdr, arg->input_cb); |
768 | - if (err) | |
769 | - goto done; | |
770 | - } else { | |
768 | + else | |
771 | 769 | err = gssx_enc_bool(xdr, 0); |
772 | - } | |
770 | + if (err) | |
771 | + goto done; | |
773 | 772 | |
774 | 773 | err = gssx_enc_bool(xdr, arg->ret_deleg_cred); |
775 | 774 | if (err) |