From: Lennert Buytenhek Date: Tue, 11 Nov 2008 05:45:05 +0000 (-0800) Subject: net: fix setting of skb->tail in skb_recycle_check() X-Git-Tag: v2.6.28-rc5~90^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5cd33db2120b5ce972568711156f91da83bff2d7;p=linux-2.6-omap-h63xx.git 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 . Signed-off-by: Lennert Buytenhek Signed-off-by: David S. Miller --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ebb6b94f8af..d49ef8301b5 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -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; }