All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net] mptcp: reset MP_JOIN subflows on missing or invalid DSS options
@ 2026-10-12 11:26 T S Rameshkumar
  2026-10-12 11:41 ` sashiko-bot
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: T S Rameshkumar @ 2026-10-12 11:26 UTC (permalink / raw)
  To: mptcp; +Cc: matttbe, T S Rameshkumar

Per RFC 8684 Section 3.7, fallback to regular TCP is only permitted
on the initial subflow. Additional subflows established via MP_JOIN
MUST NOT fall back to regular TCP, and if an additional subflow
encounters missing DSS mappings, corrupted mappings, or unmapped data,
it MUST be closed with a reset.

Currently, in subflow_check_data_avail(), when an MP_JOIN subflow
receives data without DSS mapping or with invalid mappings, it branches
to the fallback label. If fallback was already performed or allowed on
the connection, the subflow bypasses reset and incorrectly accepts
plain TCP data, synthesizing a fake fallback mapping.

Fix this by explicitly checking if the subflow is a joined subflow
(subflow->mp_join || ssk != READ_ONCE(msk->first)) under the fallback
label. If so, immediately set the appropriate reset reason
(MPTCP_RST_EMIDDLEBOX on MAPPING_NODSS, MPTCP_RST_EMPTCP otherwise),
increment MPTCP_MIB_DSSRESET, and jump to reset.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/544
Signed-off-by: T S Rameshkumar <rameshkumar.t@phytecembedded.in>
---
 net/mptcp/subflow.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 78e886b20..5faab6ffd 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1446,7 +1446,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
 	return false;
 
 fallback:
-	if (!__mptcp_check_fallback(msk)) {
+	if (subflow->mp_join || ssk != READ_ONCE(msk->first)) {
 		/* RFC 8684 section 3.7. */
 		if (status == MAPPING_BAD_CSUM &&
 		    (subflow->mp_join || subflow->valid_csum_seen)) {
@@ -1461,6 +1461,28 @@ static bool subflow_check_data_avail(struct sock *ssk)
 			return true;
 		}
 
+		subflow->reset_transient = 0;
+		subflow->reset_reason = status == MAPPING_NODSS ?
+					MPTCP_RST_EMIDDLEBOX :
+					MPTCP_RST_EMPTCP;
+		MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSRESET);
+		goto reset;
+	}
+
+	if (!__mptcp_check_fallback(msk)) {
+		/* RFC 8684 section 3.7. */
+		if (status == MAPPING_BAD_CSUM && subflow->valid_csum_seen) {
+			subflow->send_mp_fail = 1;
+
+			if (!mptcp_subflow_fail(msk, ssk)) {
+				subflow->reset_transient = 0;
+				subflow->reset_reason = MPTCP_RST_EMIDDLEBOX;
+				goto reset;
+			}
+			WRITE_ONCE(subflow->data_avail, true);
+			return true;
+		}
+
 		if (!mptcp_try_fallback(ssk, MPTCP_MIB_DSSFALLBACK)) {
 			/* fatal protocol error, close the socket.
 			 * subflow_error_report() will introduce the appropriate barriers
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
[parent not found: <CADRhS2vwE7QCAPgGmt96gCQ7bwHBWJJXG-d0at13ZAO+Z5kHJg@mail.gmail.com>]

end of thread, other threads:[~2026-10-14  0:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 11:26 [PATCH mptcp-net] mptcp: reset MP_JOIN subflows on missing or invalid DSS options T S Rameshkumar
2026-10-12 11:41 ` sashiko-bot
2026-10-12 12:21 ` MPTCP CI
2026-10-12 13:11 ` Matthieu Baerts
2026-10-14  0:35 ` netdev-bot+sashiko
     [not found] <CADRhS2vwE7QCAPgGmt96gCQ7bwHBWJJXG-d0at13ZAO+Z5kHJg@mail.gmail.com>
2026-10-13  9:01 ` Matthieu Baerts

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.