Patch "net: hisilicon: Fix potential use-after-free in hisi_femac_rx()" 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

    net: hisilicon: Fix potential use-after-free in hisi_femac_rx()

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:
     net-hisilicon-fix-potential-use-after-free-in-hisi_f.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 93f9e4a310b0c890670026b0caa9bb94f62ffd6d
Author: Liu Jian <liujian56@xxxxxxxxxx>
Date:   Sat Dec 3 17:42:39 2022 +0800

    net: hisilicon: Fix potential use-after-free in hisi_femac_rx()
    
    [ Upstream commit 4640177049549de1a43e9bc49265f0cdfce08cfd ]
    
    The skb is delivered to napi_gro_receive() which may free it, after
    calling this, dereferencing skb may trigger use-after-free.
    
    Fixes: 542ae60af24f ("net: hisilicon: Add Fast Ethernet MAC driver")
    Signed-off-by: Liu Jian <liujian56@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221203094240.1240211-1-liujian56@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c
index 93846bace028..ce2571c16e43 100644
--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
+++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
@@ -283,7 +283,7 @@ static int hisi_femac_rx(struct net_device *dev, int limit)
 		skb->protocol = eth_type_trans(skb, dev);
 		napi_gro_receive(&priv->napi, skb);
 		dev->stats.rx_packets++;
-		dev->stats.rx_bytes += skb->len;
+		dev->stats.rx_bytes += len;
 next:
 		pos = (pos + 1) % rxq->num;
 		if (rx_pkts_num >= limit)



[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