mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
NFSD: prevent integer overflow on 32 bit systems
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>
This commit is contained in:
parent
184416d4b9
commit
23a9dbbe0f
1 changed files with 2 additions and 0 deletions
|
@ -731,6 +731,8 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
|
|||
|
||||
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
|
||||
return -EBADMSG;
|
||||
if (len > SIZE_MAX / sizeof(*p))
|
||||
return -EBADMSG;
|
||||
p = xdr_inline_decode(xdr, len * sizeof(*p));
|
||||
if (unlikely(!p))
|
||||
return -EBADMSG;
|
||||
|
|
Loading…
Reference in a new issue