Skip to content

Commit 33c94d7

Browse files
chenhanxiaoTrond Myklebust
authored andcommitted
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: Chen Hanxiao <[email protected]> Fixes: 0c77668 ("SUNRPC: Introduce trace points in rpc_auth_gss.ko") Reviewed-by: Benjamin Coddington <[email protected]> Reviewed-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 28568c9 commit 33c94d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/sunrpc/auth_gss/auth_gss.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,8 +1875,10 @@ gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx,
18751875
offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base;
18761876
maj_stat = gss_wrap(ctx->gc_gss_ctx, offset, snd_buf, inpages);
18771877
/* slack space should prevent this ever happening: */
1878-
if (unlikely(snd_buf->len > snd_buf->buflen))
1878+
if (unlikely(snd_buf->len > snd_buf->buflen)) {
1879+
status = -EIO;
18791880
goto wrap_failed;
1881+
}
18801882
/* We're assuming that when GSS_S_CONTEXT_EXPIRED, the encryption was
18811883
* done anyway, so it's safe to put the request on the wire: */
18821884
if (maj_stat == GSS_S_CONTEXT_EXPIRED)

0 commit comments

Comments
 (0)