]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2024 12:45:04 +0000 (14:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2024 12:45:04 +0000 (14:45 +0200)
added patches:
mptcp-pm-deny-endp-with-signal-subflow-port.patch

queue-6.1/mptcp-pm-deny-endp-with-signal-subflow-port.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/mptcp-pm-deny-endp-with-signal-subflow-port.patch b/queue-6.1/mptcp-pm-deny-endp-with-signal-subflow-port.patch
new file mode 100644 (file)
index 0000000..0ff8421
--- /dev/null
@@ -0,0 +1,43 @@
+From 8af1f11865f259c882cce71d32f85ee9004e2660 Mon Sep 17 00:00:00 2001
+From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
+Date: Wed, 31 Jul 2024 13:05:54 +0200
+Subject: mptcp: pm: deny endp with signal + subflow + port
+
+From: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+
+commit 8af1f11865f259c882cce71d32f85ee9004e2660 upstream.
+
+As mentioned in the 'Fixes' commit, the port flag is only supported by
+the 'signal' flag, and not by the 'subflow' one. Then if both the
+'signal' and 'subflow' flags are set, the problem is the same: the
+feature cannot work with the 'subflow' flag.
+
+Technically, if both the 'signal' and 'subflow' flags are set, it will
+be possible to create the listening socket, but not to establish a
+subflow using this source port. So better to explicitly deny it, not to
+create some confusions because the expected behaviour is not possible.
+
+Fixes: 09f12c3ab7a5 ("mptcp: allow to use port and non-signal in set_flags")
+Cc: stable@vger.kernel.org
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Link: https://patch.msgid.link/20240731-upstream-net-20240731-mptcp-endp-subflow-signal-v1-2-c8a9b036493b@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/mptcp/pm_netlink.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/mptcp/pm_netlink.c
++++ b/net/mptcp/pm_netlink.c
+@@ -1360,8 +1360,8 @@ static int mptcp_nl_cmd_add_addr(struct
+       if (ret < 0)
+               return ret;
+-      if (addr.addr.port && !(addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) {
+-              GENL_SET_ERR_MSG(info, "flags must have signal when using port");
++      if (addr.addr.port && !address_use_port(&addr)) {
++              GENL_SET_ERR_MSG(info, "flags must have signal and not subflow when using port");
+               return -EINVAL;
+       }
index d1b4dba443c052adec15bf6fb2bf1516fdbbe20a..198649dc86d3a06c15547d889eb8532ad065c2b9 100644 (file)
@@ -131,3 +131,4 @@ mptcp-export-local_address.patch
 mptcp-pm-fix-backup-support-in-signal-endpoints.patch
 selftests-mptcp-join-validate-backup-in-mpj.patch
 selftests-mptcp-join-check-backup-support-in-signal-endp.patch
+mptcp-pm-deny-endp-with-signal-subflow-port.patch