Skip to contentSkip to conversation

drivers/net: ks8842 Fix crash on received packet when in PIO mode.

PATCH Applied Dennis Aberilla 2 participants 2 messages May 29, 2011 – May 31, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net: ks8842 Fix crash on received packet when in PIO mode.

This patch fixes a driver crash during packet reception due to not enough bytes allocated in the skb. Since the loop reads out 4 bytes at a time, we need to allow for up to 3 bytes of slack space.

---

drivers/net/ks8842.c +1 -1
index f0d8346..9bd0f55 100644
@@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
 
 	/* check the status */
 	if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
-		struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
+		struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 3);
 
 		if (skb) {
 

--

Thanks.

|Dennis
=======================================================================
This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email.
Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission.
=======================================================================

maintainer Applied
#1 lore raw

From: Dennis Aberilla <[email protected]>
Date: Mon, 30 May 2011 09:46:54 +1200

Quoted 5 lines

This patch fixes a driver crash during packet reception due to not enough bytes allocated in the skb. Since the loop reads out 4 bytes at a time, we need to allow for up to 3 bytes of slack space.

Applied, thanks.

Quoted 4 lines

|Dennis
=======================================================================
This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be

Quoted 8 lines

the subject of legal or other privilege, none of which is waived or lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email.
Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission.
=======================================================================

Please turn this off for future patch submissions or I will completely ignore them. It is entirely inappropriate for emails destined for a public mailing list.

Thanks.