Using alloc_skb causes memory corruption in 2.4.4

From: Tobias Ringstrom (
Date: Mon Apr 30 2001 - 07:33:21 EST

I get severe memory corruption when forwarding packets from eth1 to eth0,
where eth0 is a 3Com 905C-TX (zc, hw checksumming), and eth1 is a Davicom
9102. In every case it is the last two bytes of a 4096-byte block that
have been cleared.

To make a long bug hunting story short, the eth1 driver (dmfe) uses
alloc_skb for skbuf allocation, and if I change it into dev_alloc_skb, the
problem disappears.

Did I find the real problem, or did I just hide it?


diff -ru linux-2.4.4.orig/drivers/net/dmfe.c linux-2.4.4/drivers/net/dmfe.c
--- linux-2.4.4.orig/drivers/net/dmfe.c Sat Apr 28 11:41:49 2001
+++ linux-2.4.4/drivers/net/dmfe.c Mon Apr 30 15:15:02 2001
@@ -1306,7 +1306,7 @@
         rxptr = db->rx_insert_ptr;

         while (db->rx_avail_cnt < RX_DESC_CNT) {
- if ((skb = alloc_skb(RX_ALLOC_SIZE, GFP_ATOMIC)) == NULL)
+ if ((skb = dev_alloc_skb(RX_ALLOC_SIZE)) == NULL)
                 rxptr->rx_skb_ptr = (u32) skb;
                 rxptr->rdes2 = virt_to_bus(skb->tail);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:24 EST