Skip to contentSkip to conversation

net: tcp: fix crashes trying to free half-baked MTU probes

PATCH Applied Jakub Kicinski 3 participants 3 messages Oct 10, 2023 – Oct 12, 2023

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 net: tcp: fix crashes trying to free half-baked MTU probes

tcp_stream_alloc_skb() initializes the skb to use tcp_tsorted_anchor which is a union with the destructor. We need to clean that TCP-iness up before freeing.

Fixes 736013292e3c ("tcp: let tcp_mtu_probe() build headless packets")

---
Thanks to Chris Mason for debug help and Omar Sandoval for amazing drgn skills and analysis which make all bugs look obvious :)
---
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 net/ipv4/tcp_output.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp_output.c +1 -0
index f207712eece1..d5961a82a9e8 100644
@@ -2449,6 +2449,7 @@ static int tcp_mtu_probe(struct sock *sk)
 
 	/* build the payload, and be prepared to abort if this fails. */
 	if (tcp_clone_payload(sk, nskb, probe_size)) {
+		tcp_skb_tsorted_anchor_cleanup(nskb);
 		consume_skb(nskb);
 		return -1;
 	}
Signature · 1 line
2.41.0
#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 10 Oct 2023 10:36:51 -0700 you wrote:

tcp_stream_alloc_skb() initializes the skb to use tcp_tsorted_anchor which is a union with the destructor. We need to clean that TCP-iness up before freeing.

Fixes 736013292e3c ("tcp: let tcp_mtu_probe() build headless packets")

[...]

Here is the summary with links:
- [net] net: tcp: fix crashes trying to free half-baked MTU probes

    https://git.kernel.org/netdev/net/c/71c299c711d1

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html