aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2018-11-28 01:53:19 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-28 13:38:48 -0500
commitcfc435198f53a6fa1f656d98466b24967ff457d0 (patch)
treefcdc35233ab6cbfa602bd55da168c397587f4698
parent4df5ce9bc03e47d05f400e64aa32a82ec4cef419 (diff)
rapidio/rionet: do not free skb before reading its length
skb is freed via dev_kfree_skb_any, however, skb->len is read then. This may result in a use-after-free bug. Fixes: e6161d64263 ("rapidio/rionet: rework driver initialization and removal") Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/rionet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index e9f101c9bae2..bfbb39f93554 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -216,9 +216,9 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
216 * it just report sending a packet to the target 216 * it just report sending a packet to the target
217 * (without actual packet transfer). 217 * (without actual packet transfer).
218 */ 218 */
219 dev_kfree_skb_any(skb);
220 ndev->stats.tx_packets++; 219 ndev->stats.tx_packets++;
221 ndev->stats.tx_bytes += skb->len; 220 ndev->stats.tx_bytes += skb->len;
221 dev_kfree_skb_any(skb);
222 } 222 }
223 } 223 }
224 224