FAILED: patch "[PATCH] mptcp: pm: skip connecting to already established sf" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-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.15.y
git checkout FETCH_HEAD
git cherry-pick -x bc19ff57637ff563d2bdf2b385b48c41e6509e0d
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024083003-chowder-scurvy-2e9c@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
bc19ff57637f ("mptcp: pm: skip connecting to already established sf") 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs") c682bf536cf4 ("mptcp: add pm_nl_pernet helpers")4cf86ae84c71 ("mptcp: strict local address ID selection") d045b9eb95a9 ("mptcp: introduce implicit endpoints")90d930882139 ("mptcp: constify a bunch of of helpers")33397b83eee6 ("selftests: mptcp: add backup with port testcase") 09f12c3ab7a5 ("mptcp: allow to use port and non-signal in set_flags") 6a0653b96f5d ("selftests: mptcp: add fullmesh setting tests") 8e9eacad7ec7 ("mptcp: fix msk traversal in mptcp_nl_cmd_set_flags()") 327b9a94e2a8 ("selftests: mptcp: more stable join tests-cases") a88c9e496937 ("mptcp: do not block subflows creation on errors") 86e39e04482b ("mptcp: keep track of local endpoint still available for each msk") f7d6a237d742 ("mptcp: fix per socket endpoint accounting") b29fcfb54cd7 ("mptcp: full disconnect implementation")59060a47ca50 ("mptcp: clean up harmless false expressions") 3ce0852c86b9 ("mptcp: enforce HoL-blocking estimation")602837e8479d ("mptcp: allow changing the "backup" bit by endpoint id") 6511882cdd82 ("mptcp: allocate fwd memory separately on the rx and tx path") dd9a887b35b0 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From bc19ff57637ff563d2bdf2b385b48c41e6509e0d Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Wed, 28 Aug 2024 08:14:28 +0200
Subject: [PATCH] mptcp: pm: skip connecting to already established sf
The lookup_subflow_by_daddr() helper checks if there is already a subflow connected to this address. But there could be a subflow that is closing, but taking time due to some reasons: latency, losses, data to process, etc.
If an ADD_ADDR is received while the endpoint is being closed, it is better to try connecting to it, instead of rejecting it: the peer which has sent the ADD_ADDR will not be notified that the ADD_ADDR has been rejected for this reason, and the expected subflow will not be created at the end.
This helper should then only look for subflows that are established, or going to be, but not the ones being closed.
net/mptcp/pm_netlink.c +6 -3
@@ -130,12 +130,15 @@ static bool lookup_subflow_by_daddr(const struct list_head *list, {struct mptcp_subflow_context *subflow;struct mptcp_addr_info cur; -struct sock_common *skc;list_for_each_entry (subflow, list, node) { - skc = (struct sock_common *)mptcp_subflow_tcp_sock (subflow); +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -remote_address (skc, &cur); +if (!((1 <<inet_sk_state_load (ssk)) & + (TCPF_ESTABLISHED |TCPF_SYN_SENT |TCPF_SYN_RECV ))) +continue ; + +remote_address ((struct sock_common *)ssk, &cur);if (mptcp_addresses_equal (&cur, daddr, daddr->port))return true; }
Matthieu Baerts (NGI0)
maintainerPATCH 1/1 mptcp: pm: skip connecting to already established sf
commit bc19ff57637ff563d2bdf2b385b48c41e6509e0d upstream.
The lookup_subflow_by_daddr() helper checks if there is already a subflow connected to this address. But there could be a subflow that is closing, but taking time due to some reasons: latency, losses, data to process, etc.
If an ADD_ADDR is received while the endpoint is being closed, it is better to try connecting to it, instead of rejecting it: the peer which has sent the ADD_ADDR will not be notified that the ADD_ADDR has been rejected for this reason, and the expected subflow will not be created at the end.
This helper should then only look for subflows that are established, or going to be, but not the ones being closed.
[ Conflicts in pm_netlink.c, due to commit 4638de5aefe5 ("mptcp: handle
local addrs announced by userspace PMs"), not in this version, and changing the context. The same fix can still be applied. ]
--- net/mptcp/pm_netlink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/mptcp/pm_netlink.c +6 -3
@@ -145,12 +145,15 @@ static bool lookup_subflow_by_daddr(const struct list_head *list, {struct mptcp_subflow_context *subflow;struct mptcp_addr_info cur; -struct sock_common *skc;list_for_each_entry (subflow, list, node) { - skc = (struct sock_common *)mptcp_subflow_tcp_sock (subflow); +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -remote_address (skc, &cur); +if (!((1 <<inet_sk_state_load (ssk)) & + (TCPF_ESTABLISHED |TCPF_SYN_SENT |TCPF_SYN_RECV ))) +continue ; + +remote_address ((struct sock_common *)ssk, &cur);if (addresses_equal (&cur, daddr, daddr->port))return true; }
Signature · 1 line
2.45.2
Patch "mptcp: pm: skip connecting to already established sf" has been added to the 5.15-stable tree
This is a note to let you know that I've just added the patch titled
mptcp: pm: skip connecting to already established sf
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mptcp-pm-skip-connecting-to-already-established-sf.patch
and it can be found in the queue-5.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Fri Sep 6 10:33:29 2024
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Fri, 6 Sep 2024 10:33:09 +0200
Subject: mptcp: pm: skip connecting to already established sf
To: [email protected], [email protected]
Cc: MPTCP Upstream <[email protected]>, "Matthieu Baerts (NGI0)" <[email protected]>, Mat Martineau <[email protected]>, Paolo Abeni <[email protected]>
Message-ID: <[email protected]>
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit bc19ff57637ff563d2bdf2b385b48c41e6509e0d upstream.
The lookup_subflow_by_daddr() helper checks if there is already a subflow connected to this address. But there could be a subflow that is closing, but taking time due to some reasons: latency, losses, data to process, etc.
If an ADD_ADDR is received while the endpoint is being closed, it is better to try connecting to it, instead of rejecting it: the peer which has sent the ADD_ADDR will not be notified that the ADD_ADDR has been rejected for this reason, and the expected subflow will not be created at the end.
This helper should then only look for subflows that are established, or going to be, but not the ones being closed.
[ Conflicts in pm_netlink.c, due to commit 4638de5aefe5 ("mptcp: handle
local addrs announced by userspace PMs"), not in this version, and changing the context. The same fix can still be applied. ]
--- net/mptcp/pm_netlink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/mptcp/pm_netlink.c +6 -3
@@ -145,12 +145,15 @@ static bool lookup_subflow_by_daddr(cons {struct mptcp_subflow_context *subflow;struct mptcp_addr_info cur; -struct sock_common *skc;list_for_each_entry (subflow, list, node) { - skc = (struct sock_common *)mptcp_subflow_tcp_sock (subflow); +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -remote_address (skc, &cur); +if (!((1 <<inet_sk_state_load (ssk)) & + (TCPF_ESTABLISHED |TCPF_SYN_SENT |TCPF_SYN_RECV ))) +continue ; + +remote_address ((struct sock_common *)ssk, &cur);if (addresses_equal (&cur, daddr, daddr->port))return true; }
Patches currently in stable-queue which might be from [email protected] are
queue-5.15/mptcp-pm-avoid-possible-uaf-when-selecting-endp.patch queue-5.15/mptcp-pm-only-decrement-add_addr_accepted-for-mpj-req.patch queue-5.15/mptcp-pm-fullmesh-select-the-right-id-later.patch queue-5.15/mptcp-pm-skip-connecting-to-already-established-sf.patch queue-5.15/mptcp-pm-re-using-id-of-unused-flushed-subflows.patch queue-5.15/mptcp-pm-add_addr-0-is-not-a-new-address.patch queue-5.15/mptcp-constify-a-bunch-of-of-helpers.patch queue-5.15/mptcp-pm-do-not-remove-already-closed-subflows.patch queue-5.15/mptcp-pr_debug-add-missing-n-at-the-end.patch queue-5.15/mptcp-pm-check-add_addr_accept_max-before-accepting-new-add_addr.patch queue-5.15/mptcp-close-subflow-when-receiving-tcp-fin.patch queue-5.15/mptcp-avoid-duplicated-sub_closed-events.patch queue-5.15/mptcp-pm-send-ack-on-an-active-subflow.patch