From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: mptcp@lists.linux.dev, Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jianguo Wu <wujianguo@chinatelecom.cn>,
Shuah Khan <shuah@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
zhenwei pi <pizhenwei@bytedance.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
Christoph Paasch <cpaasch@openai.com>,
stable@vger.kernel.org
Subject: [PATCH net 1/8] mptcp: drop skb if MPTCP skb extension allocation fails
Date: Fri, 15 Aug 2025 19:28:19 +0200 [thread overview]
Message-ID: <20250815-net-mptcp-misc-fixes-6-17-rc2-v1-1-521fe9957892@kernel.org> (raw)
In-Reply-To: <20250815-net-mptcp-misc-fixes-6-17-rc2-v1-0-521fe9957892@kernel.org>
From: Christoph Paasch <cpaasch@openai.com>
When skb_ext_add(skb, SKB_EXT_MPTCP) fails in mptcp_incoming_options(),
we used to return true, letting the segment proceed through the TCP
receive path without a DSS mapping. Such segments can leave inconsistent
mapping state and trigger a mid-stream fallback to TCP, which in testing
collapsed (by artificially forcing failures in skb_ext_add) throughput
to zero.
Return false instead so the TCP input path drops the skb (see
tcp_data_queue() and step-7 processing). This is the safer choice
under memory pressure: it preserves MPTCP correctness and provides
backpressure to the sender.
Control packets remain unaffected: ACK updates and DATA_FIN handling
happen before attempting the extension allocation, and tcp_reset()
continues to ignore the return value.
With this change, MPTCP continues to work at high throughput if we
artificially inject failures into skb_ext_add.
Fixes: 6787b7e350d3 ("mptcp: avoid processing packet if a subflow reset")
Cc: stable@vger.kernel.org
Signed-off-by: Christoph Paasch <cpaasch@openai.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/options.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 70c0ab0ecf905d282e5dc6c1b21ffc6476c8d71b..2a8ea28442b271675411d190604073f779bee7fa 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1118,7 +1118,9 @@ static bool add_addr_hmac_valid(struct mptcp_sock *msk,
return hmac == mp_opt->ahmac;
}
-/* Return false if a subflow has been reset, else return true */
+/* Return false in case of error (or subflow has been reset),
+ * else return true.
+ */
bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
{
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
@@ -1222,7 +1224,7 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
mpext = skb_ext_add(skb, SKB_EXT_MPTCP);
if (!mpext)
- return true;
+ return false;
memset(mpext, 0, sizeof(*mpext));
--
2.50.0
next prev parent reply other threads:[~2025-08-15 17:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 17:28 [PATCH net 0/8] mptcp: misc fixes for v6.17-rc Matthieu Baerts (NGI0)
2025-08-15 17:28 ` Matthieu Baerts (NGI0) [this message]
2025-08-15 17:28 ` [PATCH net 2/8] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 3/8] selftests: mptcp: pm: check flush doesn't reset limits Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 4/8] mptcp: remove duplicate sk_reset_timer call Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 5/8] mptcp: disable add_addr retransmission when timeout is 0 Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 6/8] selftests: mptcp: disable add_addr retrans in endpoint_tests Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 7/8] selftests: mptcp: connect: fix C23 extension warning Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 8/8] selftests: mptcp: sockopt: " Matthieu Baerts (NGI0)
2025-08-16 18:27 ` [PATCH net 0/8] mptcp: misc fixes for v6.17-rc Jakub Kicinski
2025-08-17 13:50 ` Matthieu Baerts
2025-08-19 0:50 ` 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=20250815-net-mptcp-misc-fixes-6-17-rc2-v1-1-521fe9957892@kernel.org \
--to=matttbe@kernel.org \
--cc=corbet@lwn.net \
--cc=cpaasch@openai.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pizhenwei@bytedance.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wujianguo@chinatelecom.cn \
/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 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).