Skip to contentSkip to conversation

bug in cs89x0

PATCH-2.2.19 Kapr Johnik 2 participants 2 messages Sep 25, 2001 Network drivers

lore
Share & tools
lore
#0 lore raw

Hi to all.

I think I've found bug in the cs89x0 network driver in 2.2.19, which we are using in an embedded network router. The driver does not use skb_put(), instead it writes directly to skb->len and leaves skb->tail incorrect. Patch follows.

drivers/net/cs89x0.c +0 -0
diff -u -r linux-2.2.19/drivers/net/cs89x0.c linux/drivers/net/cs89x0.c
@@ -904,7 +904,7 @@
		lp->stats.rx_dropped++;
		return;
	}
-	skb->len = length;
+	skb_put(skb, length);
	skb->dev = dev;

        insw(ioaddr + RX_FRAME_PORT, skb->data, length >> 1);
#1 lore raw
Quoted 6 lines · Kapr Johnik

Hi to all.

I think I've found bug in the cs89x0 network driver in 2.2.19, which we are using in an embedded network router. The driver does not use skb_put(), instead it writes directly to skb->len and leaves skb->tail incorrect. Patch follows.

The same error exists in the v2.4-kernel, drivers/net/mac89x0.c

/David Weinehall

drivers/net/mac89x0.c renamed from drivers/net/mac89x0.c.old +1 -1
@@ -524,7 +524,7 @@
 		lp->stats.rx_dropped++;
 		return;
 	}
-	skb->len = length;
+	skb_put(skb, length);
 	skb->dev = dev;
 
 	memcpy_fromio(skb->data, dev->mem_start + PP_RxFrame, length);