From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
Jakub Kicinski <kuba@kernel.org>,
dsahern@kernel.org, clm@fb.com, osandov@osandov.com
Subject: [PATCH net] net: tcp: fix crashes trying to free half-baked MTU probes
Date: Tue, 10 Oct 2023 10:36:51 -0700 [thread overview]
Message-ID: <20231010173651.3990234-1-kuba@kernel.org> (raw)
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")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
Thanks to Chris Mason for debug help and Omar Sandoval for
amazing drgn skills and analysis which make all bugs look
obvious :)
---
CC: dsahern@kernel.org
CC: clm@fb.com
CC: osandov@osandov.com
---
net/ipv4/tcp_output.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index f207712eece1..d5961a82a9e8 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -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;
}
--
2.41.0
next reply other threads:[~2023-10-10 17:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 17:36 Jakub Kicinski [this message]
2023-10-10 17:44 ` [PATCH net] net: tcp: fix crashes trying to free half-baked MTU probes Eric Dumazet
2023-10-12 0:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231010173651.3990234-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=clm@fb.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=osandov@osandov.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.