SUNRPC: Fix integer overflow in decode_rc_list()
[ Upstream commit6dbf1f341b] The math in "rc_list->rcl_nrefcalls * 2 * sizeof(uint32_t)" could have an integer overflow. Add bounds checking on rc_list->rcl_nrefcalls to fix that. Fixes:4aece6a19c("nfs41: cb_sequence xdr implementation") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8a20237308
commit
91b9a4c5cf
@@ -372,6 +372,8 @@ static __be32 decode_rc_list(struct xdr_stream *xdr,
|
||||
|
||||
rc_list->rcl_nrefcalls = ntohl(*p++);
|
||||
if (rc_list->rcl_nrefcalls) {
|
||||
if (unlikely(rc_list->rcl_nrefcalls > xdr->buf->len))
|
||||
goto out;
|
||||
p = xdr_inline_decode(xdr,
|
||||
rc_list->rcl_nrefcalls * 2 * sizeof(uint32_t));
|
||||
if (unlikely(p == NULL))
|
||||
|
||||
Reference in New Issue
Block a user