liquidio: Avoid accessing skb after submitting to input queue
Subsystems (3)
PATCH 1/1 liquidio: Avoid accessing skb after submitting to input queue
From: Satanand Burla <[email protected]>
Accessing skb after submitting to input queue can cause access to stale pointers if the skb ends up being transmitted and freed by that time.
Signed-off-by Satanand Burla <[email protected]>
Signed-off-by Derek Chickles <[email protected]>
Signed-off-by Raghu Vatsavayi <[email protected]>
Signed-off-by Felix Manlunas <[email protected]>
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 6 +++--- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +3 -3
@@ -3316,11 +3316,11 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)netif_trans_update (netdev); -if (skb_shinfo (skb)->gso_size) - stats->tx_done +=skb_shinfo (skb)->gso_segs; +if (tx_info->s.gso_segs) + stats->tx_done += tx_info->s.gso_segs;else stats->tx_done++; - stats->tx_tot_bytes += skb->len; + stats->tx_tot_bytes += ndata.datasize;return NETDEV_TX_OK ;
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +3 -3
@@ -2433,11 +2433,11 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)netif_trans_update (netdev); -if (skb_shinfo (skb)->gso_size) - stats->tx_done +=skb_shinfo (skb)->gso_segs; +if (tx_info->s.gso_segs) + stats->tx_done += tx_info->s.gso_segs;else stats->tx_done++; - stats->tx_tot_bytes += skb->len; + stats->tx_tot_bytes += ndata.datasize;return NETDEV_TX_OK ;
From: Felix Manlunas <[email protected]>
Date: Thu, 26 Jan 2017 11:52:35 -0800
Quoted 10 lines
From: Satanand Burla <[email protected]>
Accessing skb after submitting to input queue can cause access to stale pointers if the skb ends up being transmitted and freed by that time.
Signed-off-by Satanand Burla <[email protected]>Signed-off-by Derek Chickles <[email protected]>Signed-off-by Raghu Vatsavayi <[email protected]>Signed-off-by Felix Manlunas <[email protected]>
Applied, thanks.