summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2012-01-07 12:15:16 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-12 11:35:43 -0800
commit2643bcef53a08c09975861ebbed6d687571a2751 (patch)
tree6550044ff87203993d93ce280f4c6ad9fd8a0d02 /drivers
parent49ffa26eca87d3518ed88d3e6feebf1b80837a15 (diff)
downloadlwn-2643bcef53a08c09975861ebbed6d687571a2751.tar.gz
lwn-2643bcef53a08c09975861ebbed6d687571a2751.zip
asix: fix infinite loop in rx_fixup()
commit 6c15d74defd38e7e7f8805392578b7a1d508097e upstream. At this point if skb->len happens to be 2, the subsequant skb_pull(skb, 4) call won't work and the skb->len won't be decreased and won't ever reach 0, resulting in an infinite loop. With an ASIX 88772 under heavy load, without this patch, rx_fixup() reaches an infinite loop in less than a minute. With this patch applied, no infinite loop even after hours of heavy load. Signed-off-by: Aurelien Jacobs <aurel@gnuage.org> Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/asix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index c50632e8658c..710557700095 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -371,7 +371,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
skb_pull(skb, (size + 1) & 0xfffe);
- if (skb->len == 0)
+ if (skb->len < sizeof(header))
break;
head = (u8 *) skb->data;