]> git.itanic.dy.fi Git - linux-stable/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:41:19 +0000 (15:41 +0100)
commit84f2e5b3e70f08fce3cb1ff73414631c5e490204
tree15fcd0439d66bccc9fa231b374b0433ced9a1e5c
parent619a34066614d841f654ac5f4ac17749909dc473
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