From: Eran Liberty <liberty@extricom.com>
To: David Miller <davem@davemloft.net>
Cc: LKML <linux-kernel@vger.kernel.org>, galak@kernel.crashing.org
Subject: [PATCH] gainfar.c : skb_over_panic (kernel-2.6.32.15)
Date: Thu, 24 Jun 2010 12:53:23 +0300 [thread overview]
Message-ID: <4C232B13.5000706@extricom.com> (raw)
[-- 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 {
next reply other threads:[~2010-06-24 9:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 9:53 Eran Liberty [this message]
2010-06-24 21:52 ` [PATCH] gainfar.c : skb_over_panic (kernel-2.6.32.15) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C232B13.5000706@extricom.com \
--to=liberty@extricom.com \
--cc=davem@davemloft.net \
--cc=galak@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.