Skip to content

Commit 1cc7971

Browse files
committed
net: usb: smsc75xx: Limit packet length to skb->len
jira VULN-67487 jira VULN-67486 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: Jonathan Maple <[email protected]>
1 parent acb5388 commit 1cc7971

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
@@ -2225,7 +2225,8 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
22252225
dev->net->stats.rx_frame_errors++;
22262226
} else {
22272227
/* MAX_SINGLE_PACKET_SIZE + 4(CRC) + 2(COE) + 4(Vlan) */
2228-
if (unlikely(size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12))) {
2228+
if (unlikely(size > (MAX_SINGLE_PACKET_SIZE + ETH_HLEN + 12) ||
2229+
size > skb->len)) {
22292230
netif_dbg(dev, rx_err, dev->net,
22302231
"size err rx_cmd_a=0x%08x\n",
22312232
rx_cmd_a);

0 commit comments

Comments
 (0)