net: usb: smsc75xx: Limit packet length to skb->len
authorSzymon Heidrich <szymon.heidrich@gmail.com>
Mon, 13 Mar 2023 22:00:45 +0000 (23:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:47 +0000 (13:33 +0100)
commitc7bdc137ca163b90917c1eeba4f1937684bd4f8b
tree81e33f2887729767e540d4dd6d77c031d41405e1
parent3517584cf1b35bd02f4a90267ddf9dcf17bd9c87
net: usb: smsc75xx: Limit packet length to skb->len

[ Upstream commit d8b228318935044dafe3a5bc07ee71a1f1424b8d ]

Packet length retrieved from skb data may be larger than
the actual socket buffer length (up to 9026 bytes). In such
case the cloned skb passed up the network stack will leak
kernel memory contents.

Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/smsc75xx.c