Commit 5cd33db2 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by David S. Miller

net: fix setting of skb->tail in skb_recycle_check()

Since skb_reset_tail_pointer() reads skb->data, we need to set
skb->data before calling skb_reset_tail_pointer().  This was causing
spurious skb_over_panic()s from skb_put() being called on a recycled
skb that had its skb->tail set to beyond where it should have been.

Bug report from Peter van Valderen <linux@ddcrew.com>.
Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b971e7ac
...@@ -486,8 +486,8 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) ...@@ -486,8 +486,8 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size)
shinfo->frag_list = NULL; shinfo->frag_list = NULL;
memset(skb, 0, offsetof(struct sk_buff, tail)); memset(skb, 0, offsetof(struct sk_buff, tail));
skb_reset_tail_pointer(skb);
skb->data = skb->head + NET_SKB_PAD; skb->data = skb->head + NET_SKB_PAD;
skb_reset_tail_pointer(skb);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment