net: tcp: fix crashes trying to free half-baked MTU probes
Subsystems (3)
Jakub Kicinski
maintainerPATCH 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.
---
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
@@ -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
Quoted 8 lines · Jakub Kicinski
tcp_stream_alloc_skb()initializes the skb to usetcp_tsorted_anchorwhich 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")Signed-off-by Jakub Kicinski <[email protected]>---
SGTM, thanks !
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 usetcp_tsorted_anchorwhich 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")Signed-off-by Jakub Kicinski <[email protected]>[...]
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