usb: aqc111: check packet for fixup for true limit
authorOliver Neukum <oneukum@suse.com>
Wed, 15 Nov 2023 10:08:57 +0000 (11:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Nov 2023 23:39:13 +0000 (23:39 +0000)
commitccab434e674ca95d483788b1895a70c21b7f016a
tree492760485f98fbe37955c4816b39f96dc7f35fef
parent7475e51b87969e01a6812eac713a1c8310372e8a
usb: aqc111: check packet for fixup for true limit

If a device sends a packet that is inbetween 0
and sizeof(u64) the value passed to skb_trim()
as length will wrap around ending up as some very
large value.

The driver will then proceed to parse the header
located at that position, which will either oops or
process some random value.

The fix is to check against sizeof(u64) rather than
0, which the driver currently does. The issue exists
since the introduction of the driver.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/aqc111.c