]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 14:17:39 +0000 (15:17 +0100)
commit46412b2fb1f9cc895d6d4036bf24f640b5d86dab
treeb1cbb0236d278ef3a71a206e30abd503f2a1985f
parentfe13b6a6ddb1b71f67cc560bbe377493bd517d29
usb: aqc111: check packet for fixup for true limit

[ Upstream commit ccab434e674ca95d483788b1895a70c21b7f016a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/aqc111.c