Skip to content

Commit

Permalink
svcrpc: handle some gssproxy encoding errors
Browse files Browse the repository at this point in the history
Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Oct 10, 2013
1 parent 3be3455 commit b26ec9b
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions net/sunrpc/auth_gss/gss_rpc_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ static int gssx_enc_cred(struct xdr_stream *xdr,

/* cred->elements */
err = dummy_enc_credel_array(xdr, &cred->elements);
if (err)
return err;

/* cred->cred_handle_reference */
err = gssx_enc_buffer(xdr, &cred->cred_handle_reference);
Expand Down Expand Up @@ -740,36 +742,33 @@ void gssx_enc_accept_sec_context(struct rpc_rqst *req,
goto done;

/* arg->context_handle */
if (arg->context_handle) {
if (arg->context_handle)
err = gssx_enc_ctx(xdr, arg->context_handle);
if (err)
goto done;
} else {
else
err = gssx_enc_bool(xdr, 0);
}
if (err)
goto done;

/* arg->cred_handle */
if (arg->cred_handle) {
if (arg->cred_handle)
err = gssx_enc_cred(xdr, arg->cred_handle);
if (err)
goto done;
} else {
else
err = gssx_enc_bool(xdr, 0);
}
if (err)
goto done;

/* arg->input_token */
err = gssx_enc_in_token(xdr, &arg->input_token);
if (err)
goto done;

/* arg->input_cb */
if (arg->input_cb) {
if (arg->input_cb)
err = gssx_enc_cb(xdr, arg->input_cb);
if (err)
goto done;
} else {
else
err = gssx_enc_bool(xdr, 0);
}
if (err)
goto done;

err = gssx_enc_bool(xdr, arg->ret_deleg_cred);
if (err)
Expand Down

0 comments on commit b26ec9b

Please sign in to comment.