Skip to content

Commit

Permalink
drivers: net: xgene: fix possible use after free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 30, 2015
1 parent 880621c commit 9ffad80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/apm/xgene/xgene_enet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9ffad80

Please sign in to comment.