usb: gadget: rndis: prevent integer overflow in rndis_set_response()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 1 Mar 2022 08:04:24 +0000 (11:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2022 08:16:43 +0000 (09:16 +0100)
commit56b38e3ca4064041d93c1ca18828c8cedad2e16c
treec80c0bb1617f05d0e8583cbd320452e46ccb8fc4
parent222f5e2d7f20a8852a4f79efb353b9f8adadfa1c
usb: gadget: rndis: prevent integer overflow in rndis_set_response()

commit 65f3324f4b6fed78b8761c3b74615ecf0ffa81fa upstream.

If "BufOffset" is very large the "BufOffset + 8" operation can have an
integer overflow.

Cc: stable@kernel.org
Fixes: 38ea1eac7d88 ("usb: gadget: rndis: check size of RNDIS_MSG_SET command")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220301080424.GA17208@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/rndis.c