提交 6c15d74d 编写于 作者: A Aurelien Jacobs 提交者: David S. Miller

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.
Signed-off-by: NAurelien Jacobs <aurel@gnuage.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6d62a66e
......@@ -376,7 +376,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册