Patch "net: hisilicon: Fix potential use-after-free in hix5hd2_rx()" has been added to the 4.14-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 hix5hd2_rx()

to the 4.14-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-hix5hd.patch
and it can be found in the queue-4.14 subdirectory.

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



commit 8ba3075e196f12a96a984346edbc9e1bdee07442
Author: Liu Jian <liujian56@xxxxxxxxxx>
Date:   Sat Dec 3 17:42:40 2022 +0800

    net: hisilicon: Fix potential use-after-free in hix5hd2_rx()
    
    [ Upstream commit 433c07a13f59856e4585e89e86b7d4cc59348fab ]
    
    The skb is delivered to napi_gro_receive() which may free it, after
    calling this, dereferencing skb may trigger use-after-free.
    
    Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver")
    Signed-off-by: Liu Jian <liujian56@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221203094240.1240211-2-liujian56@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index 6adf6831d120..55e344ee1572 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -554,7 +554,7 @@ static int hix5hd2_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 = dma_ring_incr(pos, RX_DESC_NUM);
 	}



[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