diff options
author | Pan Bian <bianpan2016@163.com> | 2018-11-28 09:53:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-05 21:41:17 +0300 |
commit | 47897682fe041a5898cfd30a5f24d3173e856d5a (patch) | |
tree | 75e7b38bd06a0dbf992c5b6dffe4ca71699c1594 | |
parent | 67f6fba765ef8cb19089d476e3c367212a2fbdfd (diff) | |
download | linux-47897682fe041a5898cfd30a5f24d3173e856d5a.tar.xz |
rapidio/rionet: do not free skb before reading its length
[ Upstream commit cfc435198f53a6fa1f656d98466b24967ff457d0 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/rionet.c | 2 |
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) * it just report sending a packet to the target * (without actual packet transfer). */ - dev_kfree_skb_any(skb); ndev->stats.tx_packets++; ndev->stats.tx_bytes += skb->len; + dev_kfree_skb_any(skb); } } |