Skip to contentSkip to conversation

FAILED: patch "[PATCH] mptcp: subflow: no need to copy thmac during ulp_clone" failed to apply to 5.10-stable tree

PATCH New [email protected] 2 participants 3 messages Sep 16 – Sep 17

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 29f641951be0d91036d77edf677807f1447dbe65
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026091645-harmful-flannels-71f9@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 29f641951be0d91036d77edf677807f1447dbe65 Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Tue, 8 Sep 2026 16:07:07 +0200
Subject: [PATCH] mptcp: subflow: no need to copy thmac during ulp_clone

'thmac' is not used after that point.

Indeed, subflow_ulp_clone() is called when the request on the passive side is over, so when the truncated HMAC is no longer needed.

Note that in case of SYN cookies, thmac will not be initialised. So better to remove it to avoid a warning from debug tools like KMSAN for reading uninitialised data.

net/mptcp/subflow.c +0 -1
index af81ad5e699d..01db7edce18a 100644
@@ -2084,7 +2084,6 @@ static void subflow_ulp_clone(const struct request_sock *req,
 		new_ctx->request_bkup = subflow_req->request_bkup;
 		WRITE_ONCE(new_ctx->remote_id, subflow_req->remote_id);
 		new_ctx->token = subflow_req->token;
-		new_ctx->thmac = subflow_req->thmac;
 
 		/* the subflow req id is valid, fetched via subflow_check_req()
 		 * and subflow_token_join_request()
maintainer
#1 lore raw

PATCH 1/2 mptcp: strict local address ID selection

From: Paolo Abeni <[email protected]>

[ Upstream commit 4cf86ae84c718333928fd2d43168a1e359a28329 ]

The address ID selection for MPJ subflows created in response to incoming ADD_ADDR option is currently unreliable: it happens at MPJ socket creation time, when the local address could be unknown.

Additionally, if the no local endpoint is available for the local address, a new dummy endpoint is created, confusing the user-land.

This change refactor the code to move the address ID selection inside the rebuild_header() helper, when the local address eventually selected by the route lookup is finally known. If the address used is not mapped by any endpoint - and thus can't be advertised/removed pick the id 0 instead of allocate a new endpoint.

[5.15 dependency adaptation]
Retain only the passive MP_JOIN clone preparation needed for 29f641951be0d91036d77edf677807f1447dbe65 ("mptcp: subflow: no need to copy thmac during ulp_clone"). Move the existing local_id assignment below thmac and retain the upstream comment about the validated request ID. Use the existing direct assignment instead of adding subflow_set_local_id(), and match the target's adjacent WRITE_ONCE() remote_id assignment so its unmodified patch applies cleanly.

Omit the active-open address selection refactor, rebuild_header hooks, local_id_valid field and initialization, and path-manager changes. They are unnecessary for the thmac fix and would require new helper functions. The stable branch's existing address selection and initialization are preserved. This preparatory dependency intentionally leaves the thmac copy in place for the target commit to remove.

[ sashal: Reduced backport -- upstream 4cf86ae84c718 touches 4 file(s), this
backport carries 1. Not backported here:
net/mptcp/pm_netlink.c
net/mptcp/protocol.c
net/mptcp/protocol.h
This note is generated from the file lists only; see the resolution record for the reasoning. ]

Stable-dep-of: 29f641951be0 ("mptcp: subflow: no need to copy thmac during ulp_clone")

---
 net/mptcp/subflow.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
net/mptcp/subflow.c +6 -2
index c9cf0fdbfbdca..55bd5ecc9e7a8 100644
@@ -1415,10 +1415,14 @@ static void subflow_ulp_clone(const struct request_sock *req,
 		new_ctx->fully_established = 1;
 		new_ctx->backup = subflow_req->backup;
 		new_ctx->request_bkup = subflow_req->request_bkup;
-		new_ctx->local_id = subflow_req->local_id;
-		new_ctx->remote_id = subflow_req->remote_id;
+		WRITE_ONCE(new_ctx->remote_id, subflow_req->remote_id);
 		new_ctx->token = subflow_req->token;
 		new_ctx->thmac = subflow_req->thmac;
+
+		/* the subflow req id is valid, fetched via subflow_check_req()
+		 * and subflow_token_join_request()
+		 */
+		new_ctx->local_id = subflow_req->local_id;
 	}
 }
 
Signature · 1 line
2.53.0
maintainer
#2 lore raw

PATCH 2/2 mptcp: subflow: no need to copy thmac during ulp_clone

From: "Matthieu Baerts (NGI0)" <[email protected]>

[ Upstream commit 29f641951be0d91036d77edf677807f1447dbe65 ]

'thmac' is not used after that point.

Indeed, subflow_ulp_clone() is called when the request on the passive side is over, so when the truncated HMAC is no longer needed.

Note that in case of SYN cookies, thmac will not be initialised. So better to remove it to avoid a warning from debug tools like KMSAN for reading uninitialised data.

---
 net/mptcp/subflow.c | 1 -
 1 file changed, 1 deletion(-)
net/mptcp/subflow.c +0 -1
index 55bd5ecc9e7a8..e7cd49c4aaee4 100644
@@ -1417,7 +1417,6 @@ static void subflow_ulp_clone(const struct request_sock *req,
 		new_ctx->request_bkup = subflow_req->request_bkup;
 		WRITE_ONCE(new_ctx->remote_id, subflow_req->remote_id);
 		new_ctx->token = subflow_req->token;
-		new_ctx->thmac = subflow_req->thmac;
 
 		/* the subflow req id is valid, fetched via subflow_check_req()
 		 * and subflow_token_join_request()
Signature · 1 line
2.53.0