Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: l2tp_eth: fix l2tp_eth_dev_xmit race
@ 2012-06-25 10:45 Eric Dumazet
  2012-06-25 23:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2012-06-25 10:45 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, James Chapman

From: Eric Dumazet <edumazet@google.com>

Its illegal to dereference skb after giving it to l2tp_xmit_skb()
as it might be already freed/reused.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Chapman <jchapman@katalix.com>
---
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 185f12f..c3738f4 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -88,12 +88,12 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct l2tp_eth *priv = netdev_priv(dev);
 	struct l2tp_session *session = priv->session;
 
-	l2tp_xmit_skb(session, skb, session->hdr_len);
-
 	dev->stats.tx_bytes += skb->len;
 	dev->stats.tx_packets++;
 
-	return 0;
+	l2tp_xmit_skb(session, skb, session->hdr_len);
+
+	return NETDEV_TX_OK;
 }
 
 static struct net_device_ops l2tp_eth_netdev_ops = {

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

* Re: [PATCH] net: l2tp_eth: fix l2tp_eth_dev_xmit race
  2012-06-25 10:45 [PATCH] net: l2tp_eth: fix l2tp_eth_dev_xmit race Eric Dumazet
@ 2012-06-25 23:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-06-25 23:31 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, jchapman

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 25 Jun 2012 12:45:14 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> Its illegal to dereference skb after giving it to l2tp_xmit_skb()
> as it might be already freed/reused.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: James Chapman <jchapman@katalix.com>

Applied, thanks Eric.

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

end of thread, other threads:[~2012-06-25 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 10:45 [PATCH] net: l2tp_eth: fix l2tp_eth_dev_xmit race Eric Dumazet
2012-06-25 23:31 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox