diff options
author | 2022-12-03 17:29:41 +0800 | |
---|---|---|
committer | 2022-12-06 12:37:25 +0100 | |
commit | 5a5a3e564de6a8db987410c5c2f4748d50ea82b8 (patch) | |
tree | c88407590067e0177c2d62aa225eaf1460b6af0e /drivers/net/ethernet/renesas | |
parent | net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue (diff) | |
download | linux-5a5a3e564de6a8db987410c5c2f4748d50ea82b8.tar.gz linux-5a5a3e564de6a8db987410c5c2f4748d50ea82b8.tar.bz2 linux-5a5a3e564de6a8db987410c5c2f4748d50ea82b8.zip |
ravb: Fix potential use-after-free in ravb_rx_gbeth()
The skb is delivered to napi_gro_receive() which may free it, after calling this,
dereferencing skb may trigger use-after-free.
Fixes: 1c59eb678cbd ("ravb: Fillup ravb_rx_gbeth() stub")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20221203092941.10880-1-yuehaibing@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/renesas')
-rw-r--r-- | drivers/net/ethernet/renesas/ravb_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 6bc923326268..33f723a9f471 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -841,7 +841,7 @@ static bool ravb_rx_gbeth(struct net_device *ndev, int *quota, int q) napi_gro_receive(&priv->napi[q], priv->rx_1st_skb); stats->rx_packets++; - stats->rx_bytes += priv->rx_1st_skb->len; + stats->rx_bytes += pkt_len; break; } } |