Skip to content

Commit

Permalink
net: fix setting of skb->tail in skb_recycle_check()
Browse files Browse the repository at this point in the history
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: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lennert Buytenhek authored and David S. Miller committed Nov 11, 2008
1 parent b971e7a commit 5cd33db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size)
shinfo->frag_list = NULL;

memset(skb, 0, offsetof(struct sk_buff, tail));
skb_reset_tail_pointer(skb);
skb->data = skb->head + NET_SKB_PAD;
skb_reset_tail_pointer(skb);

return 1;
}
Expand Down

0 comments on commit 5cd33db

Please sign in to comment.