asix: fix infinite loop in rx_fixup()
Subsystems (3)
PATCH 1/1 asix: fix infinite loop in rx_fixup()
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.
--- drivers/net/usb/asix.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/usb/asix.c +1 -1
@@ -374,11 +374,11 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)return 0 ; }skb_pull (skb, (size +1 ) &0xfffe ); -if (skb->len ==0 ) +if (skb->len <sizeof (header))break ; head = (u8 *) skb->data;memcpy (&header, head,sizeof (header));le32_to_cpus (&header);
Signature · 1 line
1.7.8.2
From: Aurelien Jacobs <[email protected]>
Date: Sat, 7 Jan 2012 19:09:27 +0100
Quoted 9 lines
At this point if
skb->lenhappens to be 2, the subsequantskb_pull(skb, 4)call won't work and theskb->lenwon'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 <[email protected]>
Applied, thanks.