Skip to content

Commit c656a4d

Browse files
committed
Revert "SUNRPC: clean up integer overflow check"
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]>
1 parent 4506f23 commit c656a4d

File tree

1 file changed

+3
-1
lines changed
  • include/linux/sunrpc

1 file changed

+3
-1
lines changed

include/linux/sunrpc/xdr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,9 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
779779

780780
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
781781
return -EBADMSG;
782-
p = xdr_inline_decode(xdr, size_mul(len, sizeof(*p)));
782+
if (len > SIZE_MAX / sizeof(*p))
783+
return -EBADMSG;
784+
p = xdr_inline_decode(xdr, len * sizeof(*p));
783785
if (unlikely(!p))
784786
return -EBADMSG;
785787
if (array == NULL)

0 commit comments

Comments
 (0)