Patch "ravb: Fix potential use-after-free in ravb_rx_gbeth()" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ravb: Fix potential use-after-free in ravb_rx_gbeth()

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ravb-fix-potential-use-after-free-in-ravb_rx_gbeth.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 53e9753fc123f1bb8efc1ae54d15537fd1539ee0
Author: YueHaibing <yuehaibing@xxxxxxxxxx>
Date:   Sat Dec 3 17:29:41 2022 +0800

    ravb: Fix potential use-after-free in ravb_rx_gbeth()
    
    [ Upstream commit 5a5a3e564de6a8db987410c5c2f4748d50ea82b8 ]
    
    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@xxxxxxxxxx>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20221203092941.10880-1-yuehaibing@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 44f9b31f8b99..77d4f3eab971 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -835,7 +835,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;
 			}
 		}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux