Patch "net: lantiq_xrx200: restore buffer if memory allocation failed" has been added to the 5.19-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: lantiq_xrx200: restore buffer if memory allocation failed

to the 5.19-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-lantiq_xrx200-restore-buffer-if-memory-allocatio.patch
and it can be found in the queue-5.19 subdirectory.

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



commit 79be235465aec53531d6d5a8d5fdcab9dea82112
Author: Aleksander Jan Bajkowski <olek2@xxxxx>
Date:   Wed Aug 24 23:54:08 2022 +0200

    net: lantiq_xrx200: restore buffer if memory allocation failed
    
    [ Upstream commit c9c3b1775f80fa21f5bff874027d2ccb10f5d90c ]
    
    In a situation where memory allocation fails, an invalid buffer address
    is stored. When this descriptor is used again, the system panics in the
    build_skb() function when accessing memory.
    
    Fixes: 7ea6cd16f159 ("lantiq: net: fix duplicated skb in rx descriptor ring")
    Signed-off-by: Aleksander Jan Bajkowski <olek2@xxxxx>
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index 25adce7f0c7c0..57f27cc7724e7 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -193,6 +193,7 @@ static int xrx200_alloc_buf(struct xrx200_chan *ch, void *(*alloc)(unsigned int
 
 	ch->rx_buff[ch->dma.desc] = alloc(priv->rx_skb_size);
 	if (!ch->rx_buff[ch->dma.desc]) {
+		ch->rx_buff[ch->dma.desc] = buf;
 		ret = -ENOMEM;
 		goto skip;
 	}



[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