Patch "net/x25: Fix skb leak in x25_lapb_receive_frame()" 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/x25: Fix skb leak in x25_lapb_receive_frame()

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-x25-fix-skb-leak-in-x25_lapb_receive_frame.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 502a8be661275bd1ff8e8d2a4dc52540f554f043
Author: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Date:   Mon Nov 14 11:05:19 2022 +0000

    net/x25: Fix skb leak in x25_lapb_receive_frame()
    
    [ Upstream commit 2929cceb2fcf0ded7182562e4888afafece82cce ]
    
    x25_lapb_receive_frame() using skb_copy() to get a private copy of
    skb, the new skb should be freed in the undersized/fragmented skb
    error handling path. Otherwise there is a memory leak.
    
    Fixes: cb101ed2c3c7 ("x25: Handle undersized/fragmented skbs")
    Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
    Acked-by: Martin Schiller <ms@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@xxxxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index 30f71620d4e3..24f2676e3b66 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -122,7 +122,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
 
 	if (!pskb_may_pull(skb, 1)) {
 		x25_neigh_put(nb);
-		return 0;
+		goto drop;
 	}
 
 	switch (skb->data[0]) {



[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