linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gainfar.c : skb_over_panic (kernel-2.6.32.15)
@ 2010-06-24  9:53 Eran Liberty
  2010-06-24 21:52 ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Eran Liberty @ 2010-06-24  9:53 UTC (permalink / raw)
  To: David Miller; +Cc: LKML, galak

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

Fix possible skb_over_panic event in Freescale's "gianfar" driver. 

The skb_over_panic occurs due to calling skb_put() within 
gfar_clean_rx_ring(). This happens if (and only if) shortly prior to the 
event and a few lined above the skb_put(), an skb was queued back to the 
priv->rx_recycle queue due to RXBD_LAST or RXBD_ERR status.
The skb is queued without properly re-setting its state.

The patch properly reset the skb state.

I have tested this patch on MPC8548 based product and asserted it avoided the skb_over_panic event.

Signed-off-by: Eran Liberty <liberty@extricom.com>

---






[-- Attachment #2: gianfar_skb_over_panic.patch --]
[-- Type: text/x-diff, Size: 610 bytes --]

---
 drivers/net/gianfar.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1854,14 +1854,9 @@
 			if (unlikely(!newskb))
 				newskb = skb;
 			else if (skb) {
-				/*
-				 * We need to reset ->data to what it
-				 * was before gfar_new_skb() re-aligned
-				 * it to an RXBUF_ALIGNMENT boundary
-				 * before we put the skb back on the
-				 * recycle list.
-				 */
 				skb->data = skb->head + NET_SKB_PAD;
+				skb->len = 0;
+				skb_reset_tail_pointer(skb);
 				__skb_queue_head(&priv->rx_recycle, skb);
 			}
 		} else {

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-10-03 14:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-24  9:53 [PATCH] gainfar.c : skb_over_panic (kernel-2.6.32.15) Eran Liberty
2010-06-24 21:52 ` David Miller
2010-06-28  7:57   ` Eran Liberty
2010-06-28 18:33     ` David Miller
2010-06-29 15:42       ` Eran Liberty
2010-06-29 16:20         ` [PATCH] gainfar.c : code cleanup Eran Liberty
2010-09-29  0:35         ` [PATCH] gainfar.c : skb_over_panic (kernel-2.6.32.15) emin ak
2010-10-03  9:32           ` Eran Liberty
2010-10-03 10:54             ` emin ak
2010-10-03 14:48               ` Eran Liberty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).