Skip to content

Commit 873aa34

Browse files
committed
net: usb: smsc75xx: Limit packet length to skb->len
jira VULN-67483 cve CVE-2023-53125 commit-author Szymon Heidrich <[email protected]> commit d8b2283 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: d0cad87 ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver") Signed-off-by: Szymon Heidrich <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit d8b2283) Signed-off-by: Brett Mastbergen <[email protected]>
1 parent 9ee129a commit 873aa34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/usb/smsc75xx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,8 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22212221
dev->net->stats.rx_frame_errors++;
22222222
} else {
22232223
/* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
2224-
if (unlikely(size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12))) {
2224+
if (unlikely(size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12) ||
2225+
size > skb->len)) {
22252226
netif_dbg(dev, rx_err, dev->net,
22262227
"size err rx_cmd_a=0x%08x\n",
22272228
rx_cmd_a);

0 commit comments

Comments
 (0)