mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
NFSD: prevent integer overflow on 32 bit systems
commit 23a9dbbe0f upstream.
On a 32 bit system, the "len * sizeof(*p)" operation can have an
integer overflow.
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
65e21cc042
commit
7af164fa2f
|
|
@ -603,6 +603,8 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
|
||||||
|
|
||||||
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
|
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
|
||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
|
if (len > SIZE_MAX / sizeof(*p))
|
||||||
|
return -EBADMSG;
|
||||||
p = xdr_inline_decode(xdr, len * sizeof(*p));
|
p = xdr_inline_decode(xdr, len * sizeof(*p));
|
||||||
if (unlikely(!p))
|
if (unlikely(!p))
|
||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user