From: Matthieu Baerts <matttbe@kernel.org>
To: MPTCP Linux <mptcp@lists.linux.dev>
Cc: Paolo Abeni <pabeni@redhat.com>,
Chenguang Zhao <chenguang.zhao@linux.dev>,
gang.yan@linux.dev
Subject: Re: [PATCH mptcp-next RFC 2/3] mptcp: reject MP_JOIN earlier
Date: Sun, 16 Aug 2026 18:13:16 +0200 [thread overview]
Message-ID: <68ead427-6c15-49f3-8ed6-64383fdda680@kernel.org> (raw)
In-Reply-To: <687bd2da-28b5-4753-b942-d18cb53d9239@kernel.org>
On 16/08/2026 18:12, Matthieu Baerts wrote:
> Hello,
>
> On 14/08/2026 20:31, Matthieu Baerts (NGI0) wrote:
>> When a SYN + MP_JOIN is received, it is good to check directly if the
>> MP_JOIN is allowed, then checking that later at the establishment of the
>> new subflow.
>>
>> This avoids situations where the 3WHS is done, then the joined subflow
>> is rejected.
>>
>> This changes the behaviour, and the new behaviour is tracked with the
>> MPJoinDisallow MIB counter.
>>
>> TODO: adapt the selftests to be able to run on older kernels: if the new
>> counter is not available, increment syn_ack and syn_rej instead.
>
> (...)
>
>> @@ -217,17 +228,19 @@ static int subflow_check_req(struct request_sock *req,
>> SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_TOKENFALLBACKINIT);
>>
>> } else if (opt_mp_join && listener->request_mptcp) {
>> + u8 reason;
>> +
>> subflow_req->ssn_offset = TCP_SKB_CB(skb)->seq;
>> subflow_req->mp_join = 1;
>> subflow_req->backup = mp_opt.backup;
>> subflow_req->remote_id = mp_opt.join_id;
>> subflow_req->token = mp_opt.token;
>> subflow_req->remote_nonce = mp_opt.nonce;
>> - subflow_req->msk = subflow_token_join_request(req);
>> + subflow_req->msk = subflow_token_join_request(req, &reason);
>>
>> /* Can't fall back to TCP in this case. */
>> if (!subflow_req->msk) {
>> - subflow_add_reset_reason(skb, MPTCP_RST_EMPTCP);
>> + subflow_add_reset_reason(skb, reason);
>> return -EPERM;
>> }
>
> Note: the call to mptcp_can_accept_new_subflow() here below, when
> handling req->syncookies, is no longer needed as it is now done earlier
> for all cases, in subflow_token_join_request().
I meant to add the diff:
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 7552abf4c333..c629bcce6ecc 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -258,15 +258,8 @@ static int subflow_check_req(struct request_sock *req,
subflow_req_create_thmac(subflow_req);
- if (unlikely(req->syncookie)) {
- if (!mptcp_can_accept_new_subflow(subflow_req->msk)) {
- SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINREJECTED);
- subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
- return -EPERM;
- }
-
+ if (unlikely(req->syncookie))
subflow_init_req_cookie_join_save(subflow_req, skb);
- }
pr_debug("token=%u, remote_nonce=%u msk=%p\n", subflow_req->token,
subflow_req->remote_nonce, subflow_req->msk);
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-08-16 16:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 18:31 [PATCH mptcp-next RFC 0/3] mptcp: reset fully_estab after fallback & reject MPJ earlier Matthieu Baerts (NGI0)
2026-08-14 18:31 ` [PATCH mptcp-next RFC 1/3] mptcp: no longer fully_established after a fallback Matthieu Baerts (NGI0)
2026-08-14 18:31 ` [PATCH mptcp-next RFC 2/3] mptcp: reject MP_JOIN earlier Matthieu Baerts (NGI0)
2026-08-14 18:40 ` sashiko-bot
2026-08-16 16:12 ` Matthieu Baerts
2026-08-16 16:13 ` Matthieu Baerts [this message]
2026-08-17 7:27 ` Paolo Abeni
2026-08-17 9:49 ` Matthieu Baerts
2026-08-17 13:03 ` Paolo Abeni
2026-08-14 18:31 ` [PATCH mptcp-next RFC 3/3] mptcp: pm: kernel: skip operating on closing connections Matthieu Baerts (NGI0)
2026-08-14 18:44 ` sashiko-bot
2026-08-17 7:39 ` Paolo Abeni
2026-08-17 11:07 ` Matthieu Baerts
2026-08-17 13:09 ` Paolo Abeni
2026-08-17 15:32 ` Matthieu Baerts
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=68ead427-6c15-49f3-8ed6-64383fdda680@kernel.org \
--to=matttbe@kernel.org \
--cc=chenguang.zhao@linux.dev \
--cc=gang.yan@linux.dev \
--cc=mptcp@lists.linux.dev \
--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.