Commit 33c94d7e authored by Chen Hanxiao's avatar Chen Hanxiao Committed by Trond Myklebust

SUNRPC: return proper error from gss_wrap_req_priv

don't return 0 if snd_buf->len really greater than snd_buf->buflen
Signed-off-by: default avatarChen Hanxiao <chenhx.fnst@fujitsu.com>
Fixes: 0c77668d ("SUNRPC: Introduce trace points in rpc_auth_gss.ko")
Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 28568c90
......@@ -1875,8 +1875,10 @@ gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx,
offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base;
maj_stat = gss_wrap(ctx->gc_gss_ctx, offset, snd_buf, inpages);
/* slack space should prevent this ever happening: */
if (unlikely(snd_buf->len > snd_buf->buflen))
if (unlikely(snd_buf->len > snd_buf->buflen)) {
status = -EIO;
goto wrap_failed;
}
/* We're assuming that when GSS_S_CONTEXT_EXPIRED, the encryption was
* done anyway, so it's safe to put the request on the wire: */
if (maj_stat == GSS_S_CONTEXT_EXPIRED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment