linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] revert "net: kcm: fix memory leak in kcm_sendmsg"
@ 2021-06-07 17:20 Pavel Skripkin
  2021-06-07 18:46 ` [PATCH v2] " Pavel Skripkin
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Skripkin @ 2021-06-07 17:20 UTC (permalink / raw)
  To: davem, kuba, matthieu.baerts
  Cc: netdev, linux-kernel, Pavel Skripkin, syzbot+65badd5e74ec62cb67dc

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.

Reported-by: syzbot+65badd5e74ec62cb67dc@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 net/kcm/kcmsock.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 1c572c8daced..6201965bd822 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -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);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] revert "net: kcm: fix memory leak in kcm_sendmsg"
  2021-06-07 17:20 [PATCH] revert "net: kcm: fix memory leak in kcm_sendmsg" Pavel Skripkin
@ 2021-06-07 18:46 ` Pavel Skripkin
  2021-06-07 20:40   ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Skripkin @ 2021-06-07 18:46 UTC (permalink / raw)
  To: davem, kuba, matthieu.baerts
  Cc: netdev, linux-kernel, Pavel Skripkin, syzbot+65badd5e74ec62cb67dc

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: syzbot+65badd5e74ec62cb67dc@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---

Changes in v2:
	Added Fixes tag
	Improved commit message

---
 net/kcm/kcmsock.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 1c572c8daced..6201965bd822 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -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);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] revert "net: kcm: fix memory leak in kcm_sendmsg"
  2021-06-07 18:46 ` [PATCH v2] " Pavel Skripkin
@ 2021-06-07 20:40   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-07 20:40 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: davem, kuba, matthieu.baerts, netdev, linux-kernel,
	syzbot+65badd5e74ec62cb67dc

Hello:

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

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-07 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 17:20 [PATCH] revert "net: kcm: fix memory leak in kcm_sendmsg" Pavel Skripkin
2021-06-07 18:46 ` [PATCH v2] " Pavel Skripkin
2021-06-07 20:40   ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).