All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.24] pasemi_mac: Fix reuse of free'd skb
@ 2007-12-04  3:34 Olof Johansson
  2007-12-04 18:04   ` David Woodhouse
  2007-12-04 19:54   ` Jeff Garzik
  0 siblings, 2 replies; 7+ messages in thread
From: Olof Johansson @ 2007-12-04  3:34 UTC (permalink / raw)
  To: jgarzik; +Cc: ranger, netdev, dwmw2, linuxppc-dev

Turns out we're freeing the skb when we detect CRC error, but we're
not clearing out info->skb. We could either clear it and have the stack
reallocate it, or just leave it and the rx ring refill code will reuse
the one that was allocated.

Reusing a freed skb obviously caused some nasty crashes of various kind,
as reported by Brent Baude and David Woodhouse.


Signed-off-by: Olof Johansson <olof@lixom.net>

---

Jeff, I'd like to see this in 2.6.24, it's causing some real problems
out there. It's not needed in the 2.6.25 queue since the other changes
there have already covered these cases.

My test network at home is quiet enough to not cause CRC errors, we
mainly get those during interface bringup before speed is configured.

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 09b4fde..6617e24 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -586,7 +586,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
 			/* CRC error flagged */
 			mac->netdev->stats.rx_errors++;
 			mac->netdev->stats.rx_crc_errors++;
-			dev_kfree_skb_irq(skb);
+			/* No need to free skb, it'll be reused */
 			goto next;
 		}
 

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

end of thread, other threads:[~2007-12-04 19:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-04  3:34 [PATCH 2.6.24] pasemi_mac: Fix reuse of free'd skb Olof Johansson
2007-12-04 18:04 ` David Woodhouse
2007-12-04 18:04   ` David Woodhouse
2007-12-04 18:12   ` David Woodhouse
2007-12-04 18:12     ` David Woodhouse
2007-12-04 19:54 ` Jeff Garzik
2007-12-04 19:54   ` Jeff Garzik

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.