[3.11.y.z extended stable] Patch "net: fec: fix potential use after free" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Jan 13 14:43:58 UTC 2014


This is a note to let you know that I have just added a patch titled

    net: fec: fix potential use after free

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 79cad574d475e7972e9e6d70f136a44ccac44a1b Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet at google.com>
Date: Thu, 19 Dec 2013 10:53:02 -0800
Subject: net: fec: fix potential use after free

commit 7a2a84518cfb263d2c4171b3d63671f88316adb2 upstream.

skb_tx_timestamp(skb) should be called _before_ TX completion
has a chance to trigger, otherwise it is too late and we access
freed memory.

Signed-off-by: Eric Dumazet <edumazet at google.com>
Fixes: de5fb0a05348 ("net: fec: put tx to napi poll function to fix dead lock")
Cc: Frank Li <Frank.Li at freescale.com>
Cc: Richard Cochran <richardcochran at gmail.com>
Acked-by: Richard Cochran <richardcochran at gmail.com>
Acked-by: Frank Li <Frank.Li at freescale.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c610a27..2cb8401 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -394,6 +394,8 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	else
 		bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);

+	skb_tx_timestamp(skb);
+
 	fep->cur_tx = bdp;

 	if (fep->cur_tx == fep->dirty_tx)
@@ -402,8 +404,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	/* Trigger transmission start */
 	writel(0, fep->hwp + FEC_X_DES_ACTIVE);

-	skb_tx_timestamp(skb);
-
 	return NETDEV_TX_OK;
 }

--
1.8.3.2





More information about the kernel-team mailing list