[PATCH][2.4] etherleak fix for via-rhine

Roger Luethi (rl@hellgate.ch)
Thu, 30 Jan 2003 10:52:06 +0100


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-13411-1043920453-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Use skb_padto to plug that leak. Patch is already in ac, 2.5. Please apply.

--=_courier-13411-1043920453-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="via-rhine.c-2.4.21-pre4-skb_padto.diff"

--- linux-2.4.21-pre4/drivers/net/via-rhine.c.org Thu Jan 30 10:38:32 2003
+++ linux-2.4.21-pre4/drivers/net/via-rhine.c Thu Jan 30 10:46:57 2003
@@ -1239,6 +1239,12 @@
/* Calculate the next Tx descriptor entry. */
entry = np->cur_tx % TX_RING_SIZE;

+ if (skb->len < ETH_ZLEN) {
+ skb = skb_padto(skb, ETH_ZLEN);
+ if (skb == NULL)
+ return 0;
+ }
+
np->tx_skbuff[entry] = skb;

if ((np->drv_flags & ReqTxAlign) &&

--=_courier-13411-1043920453-0001-2--