Skip to content

Commit 1983470

Browse files
cpaasch-oaigregkh
authored andcommitted
mptcp: drop skb if MPTCP skb extension allocation fails
commit ccab044 upstream. 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: 6787b7e ("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> Link: https://patch.msgid.link/20250815-net-mptcp-misc-fixes-6-17-rc2-v1-1-521fe9957892@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b02eec4 commit 1983470

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/mptcp/options.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,9 @@ static bool add_addr_hmac_valid(struct mptcp_sock *msk,
11171117
return hmac == mp_opt->ahmac;
11181118
}
11191119

1120-
/* Return false if a subflow has been reset, else return true */
1120+
/* Return false in case of error (or subflow has been reset),
1121+
* else return true.
1122+
*/
11211123
bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
11221124
{
11231125
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
@@ -1221,7 +1223,7 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
12211223

12221224
mpext = skb_ext_add(skb, SKB_EXT_MPTCP);
12231225
if (!mpext)
1224-
return true;
1226+
return false;
12251227

12261228
memset(mpext, 0, sizeof(*mpext));
12271229

0 commit comments

Comments
 (0)