Skip to content

Commit

Permalink
Revert "SUNRPC: clean up integer overflow check"
Browse files Browse the repository at this point in the history
This reverts commit e87cf8a.

This commit was added to silence a tautological comparison warning, but
removing the 'len' value check before calling xdr_inline_decode() is
really not what we want.

Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
amschuma-ntap committed Sep 15, 2023
1 parent 4506f23 commit c656a4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/linux/sunrpc/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,

if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
return -EBADMSG;
p = xdr_inline_decode(xdr, size_mul(len, sizeof(*p)));
if (len > SIZE_MAX / sizeof(*p))
return -EBADMSG;
p = xdr_inline_decode(xdr, len * sizeof(*p));
if (unlikely(!p))
return -EBADMSG;
if (array == NULL)
Expand Down

0 comments on commit c656a4d

Please sign in to comment.