diff options
author | Eric Dumazet <edumazet@google.com> | 2015-11-25 18:02:10 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-30 04:51:45 +0100 |
commit | 9ffad80a9c65d7c2ab5ad6cb8b4b0559b9ed8b8c (patch) | |
tree | 736a7c787e87cae573f380b0e7741566d3e60644 | |
parent | packet: Allow packets with only a header (but no payload) (diff) | |
download | linux-9ffad80a9c65d7c2ab5ad6cb8b4b0559b9ed8b8c.tar.xz linux-9ffad80a9c65d7c2ab5ad6cb8b4b0559b9ed8b8c.zip |
drivers: net: xgene: fix possible use after free
Once TX has been enabled on a NIC, it is illegal to access skb,
as this skb might have been freed by another cpu, from TX completion
handler.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Cc: Iyappan Subramanian <isubramanian@apm.com>
Acked-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 1adfe7036843..9147a0107c44 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -450,12 +450,12 @@ static netdev_tx_t xgene_enet_start_xmit(struct sk_buff *skb, return NETDEV_TX_OK; } - pdata->ring_ops->wr_cmd(tx_ring, count); skb_tx_timestamp(skb); pdata->stats.tx_packets++; pdata->stats.tx_bytes += skb->len; + pdata->ring_ops->wr_cmd(tx_ring, count); return NETDEV_TX_OK; } |