Skip to contentSkip to conversation

revert "net: kcm: fix memory leak in kcm_sendmsg"

PATCH Superseded Pavel Skripkin 2 participants 3 messages Jun 7, 2021

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 revert "net: kcm: fix memory leak in kcm_sendmsg"

In commit c47cc304990a ("net: kcm: fix memory leak in kcm_sendmsg") I misunderstand the root case of memory leak and came up completely broken fix.

So, simply revert this commit to avoid GPF.

Im so sorry about this one.

---
 net/kcm/kcmsock.c | 5 -----
 1 file changed, 5 deletions(-)
net/kcm/kcmsock.c +0 -5
index 1c572c8daced..6201965bd822 100644
@@ -1066,11 +1066,6 @@ static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
 		goto partial_message;
 	}
 
-	if (skb_has_frag_list(head)) {
-		kfree_skb_list(skb_shinfo(head)->frag_list);
-		skb_shinfo(head)->frag_list = NULL;
-	}
-
 	if (head != kcm->seq_skb)
 		kfree_skb(head);
 
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/1 revert "net: kcm: fix memory leak in kcm_sendmsg"

In commit c47cc304990a ("net: kcm: fix memory leak in kcm_sendmsg") I misunderstood the root case of the memory leak and came up with completely broken fix.

So, simply revert this commit to avoid GPF reported by syzbot.

Im so sorry for this situation.

Fixes c47cc304990a ("net: kcm: fix memory leak in kcm_sendmsg")
Reported-by [email protected]

---

Changes in v2:
Added Fixes tag
Improved commit message

---
 net/kcm/kcmsock.c | 5 -----
 1 file changed, 5 deletions(-)
net/kcm/kcmsock.c +0 -5
index 1c572c8daced..6201965bd822 100644
@@ -1066,11 +1066,6 @@ static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
 		goto partial_message;
 	}
 
-	if (skb_has_frag_list(head)) {
-		kfree_skb_list(skb_shinfo(head)->frag_list);
-		skb_shinfo(head)->frag_list = NULL;
-	}
-
 	if (head != kcm->seq_skb)
 		kfree_skb(head);
 
Signature · 1 line
2.31.1
#2 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 8 lines · On Mon, 7 Jun 2021 21:46:23 +0300 you wrote:

In commit c47cc304990a ("net: kcm: fix memory leak in kcm_sendmsg") I misunderstood the root case of the memory leak and came up with completely broken fix.

So, simply revert this commit to avoid GPF reported by syzbot.

[...]

Here is the summary with links:
- [v2] revert "net: kcm: fix memory leak in kcm_sendmsg"

    https://git.kernel.org/netdev/net/c/a47c397bb29f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html