Patch "net: kcm: fix memory leak in kcm_sendmsg" has been added to the 4.19-stable tree
Quoted 51 lines · On Tue, 08 Jun 2021 14:31:13 +0200 <[email protected]> wrote:
This is a note to let you know that I've just added the patch titled
net: kcm: fix memory leak in
kcm_sendmsgto the 4.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
net-kcm-fix-memory-leak-in-kcm_sendmsg.patch
and it can be found in the queue-4.19 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From
c47cc304990a2813995b1a92bbc11d0bb9a19ea9Mon Sep 17 00:00:00 2001
From: Pavel Skripkin <[email protected]>
Date: Wed, 2 Jun 2021 22:26:40 +0300
Subject: net: kcm: fix memory leak inkcm_sendmsgFrom: Pavel Skripkin <[email protected]>
commit
c47cc304990a2813995b1a92bbc11d0bb9a19ea9upstream.Syzbot reported memory leak in kcm_sendmsg()[1]. The problem was in non-freed
frag_listin case of error.In the while loop:
if (head == skb) skb_shinfo(head)->frag_list = tskb; else skb->next = tskb;
frag_listfilled with skbs, but nothing was freeing them.backtrace:
[<0000000094c02615>] __alloc_skb+0x5e/0x250 net/core/skbuff.c:198 [<00000000e5386cbd>] alloc_skb include/linux/skbuff.h:1083 [inline] [<00000000e5386cbd>] kcm_sendmsg+0x3b6/0xa50 net/kcm/kcmsock.c:967[1] [<
00000000f1613a8a>]sock_sendmsg_nosecnet/socket.c:652[inline] [<00000000f1613a8a>]sock_sendmsg+0x4c/0x60net/socket.c:672Reported-and-tested-by:
[email protected] Fixes:ab7ac4eb9832("kcm: Kernel Connection Multiplexor module") Cc:
[email protected] Signed-off-by: Pavel Skripkin <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> ---
Quoted 2 lines
net/kcm/kcmsock.c | 5 +++++ 1 file changed, 5 insertions(+)
Hi, Greg!
I CCed stable. This patch is broken and I've already sent a revert for this.
https://git.kernel.org/netdev/net/c/a47c397bb29f
Please, don't add this to stable trees. Im sorry
With regards,
Pavel Skripkin