From: Greg Kroah-Hartman Date: Thu, 5 Sep 2024 09:36:36 +0000 (+0200) Subject: some fixing up of the 6.1 selftest mptcp patches X-Git-Tag: v6.1.109~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=147eafd8edd3c43bc8bb40140e11e726dddfc1c9;p=thirdparty%2Fkernel%2Fstable-queue.git some fixing up of the 6.1 selftest mptcp patches --- diff --git a/queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-re.patch b/queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-re.patch deleted file mode 100644 index 8bc647482c7..00000000000 --- a/queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-re.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 746e07b3f2176a625ba494e91d855f2c3a1e9ca1 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sat, 27 Jul 2024 11:04:01 +0200 -Subject: selftests: mptcp: add explicit test case for remove/readd - -From: Paolo Abeni - -[ Upstream commit b5e2fb832f48bc01d937a053e0550a1465a2f05d ] - -Delete and re-create a signal endpoint and ensure that the PM -actually deletes and re-create the subflow. - -Signed-off-by: Paolo Abeni -Reviewed-by: Matthieu Baerts (NGI0) -Signed-off-by: Matthieu Baerts (NGI0) -Signed-off-by: David S. Miller -Stable-dep-of: 1c2326fcae4f ("selftests: mptcp: join: check re-adding init endp with != id") -Signed-off-by: Sasha Levin ---- - .../testing/selftests/net/mptcp/mptcp_join.sh | 29 +++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh -index a73358d753aa7..4f8b0c0faac96 100755 ---- a/tools/testing/selftests/net/mptcp/mptcp_join.sh -+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh -@@ -3281,6 +3281,35 @@ endpoint_tests() - chk_subflow_nr "" "after re-add" 2 - kill_tests_wait - fi -+ -+ # remove and re-add -+ if reset "delete re-add signal" && -+ mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then -+ pm_nl_set_limits $ns1 1 1 -+ pm_nl_set_limits $ns2 1 1 -+ pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal -+ test_linkfail=4 speed=20 \ -+ run_tests $ns1 $ns2 10.0.1.1 & -+ local tests_pid=$! -+ -+ wait_mpj $ns2 -+ pm_nl_check_endpoint "creation" \ -+ $ns1 10.0.2.1 id 1 flags signal -+ chk_subflow_nr "before delete" 2 -+ chk_mptcp_info subflows 1 subflows 1 -+ -+ pm_nl_del_endpoint $ns1 1 10.0.2.1 -+ sleep 0.5 -+ chk_subflow_nr "after delete" 1 -+ chk_mptcp_info subflows 0 subflows 0 -+ -+ pm_nl_add_endpoint $ns1 10.0.2.1 flags signal -+ wait_mpj $ns2 -+ chk_subflow_nr "after re-add" 2 -+ chk_mptcp_info subflows 1 subflows 1 -+ mptcp_lib_kill_wait $tests_pid -+ fi -+ - } - - # [$1: error message] --- -2.43.0 - diff --git a/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-.patch b/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-.patch deleted file mode 100644 index dde3ec52282..00000000000 --- a/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 258989bf2bae0317055be62110dde3fa35f0b466 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 28 Aug 2024 08:14:30 +0200 -Subject: selftests: mptcp: join: check re-adding init endp with != id - -From: Matthieu Baerts (NGI0) - -[ Upstream commit 1c2326fcae4f0c5de8ad0d734ced43a8e5f17dac ] - -The initial subflow has a special local ID: 0. It is specific per -connection. - -When a global endpoint is deleted and re-added later, it can have a -different ID, but the kernel should still use the ID 0 if it corresponds -to the initial address. - -This test validates this behaviour: the endpoint linked to the initial -subflow is removed, and re-added with a different ID. - -Note that removing the initial subflow will not decrement the 'subflows' -counters, which corresponds to the *additional* subflows. On the other -hand, when the same endpoint is re-added, it will increment this -counter, as it will be seen as an additional subflow this time. - -The 'Fixes' tag here below is the same as the one from the previous -commit: this patch here is not fixing anything wrong in the selftests, -but it validates the previous fix for an issue introduced by this commit -ID. - -Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking") -Cc: stable@vger.kernel.org -Reviewed-by: Mat Martineau -Signed-off-by: Matthieu Baerts (NGI0) -Signed-off-by: Paolo Abeni -Signed-off-by: Sasha Levin ---- - tools/testing/selftests/net/mptcp/mptcp_join.sh | 21 ++++++++++++++++----- - 1 file changed, 16 insertions(+), 5 deletions(-) - ---- a/tools/testing/selftests/net/mptcp/mptcp_join.sh -+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh -@@ -3285,11 +3285,12 @@ endpoint_tests() - # remove and re-add - if reset "delete re-add signal" && - mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then -- pm_nl_set_limits $ns1 0 2 -- pm_nl_set_limits $ns2 2 2 -+ pm_nl_set_limits $ns1 0 3 -+ pm_nl_set_limits $ns2 3 3 - pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal - # broadcast IP: no packet for this address will be received on ns1 - pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal -+ pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal - test_linkfail=4 speed=20 \ - run_tests $ns1 $ns2 10.0.1.1 & - local tests_pid=$! -@@ -3311,11 +3312,21 @@ endpoint_tests() - wait_mpj $ns2 - chk_subflow_nr "after re-add" 3 - chk_mptcp_info subflows 2 subflows 2 -+ -+ pm_nl_del_endpoint $ns1 42 10.0.1.1 -+ sleep 0.5 -+ chk_subflow_nr "after delete ID 0" 2 -+ chk_mptcp_info subflows 2 subflows 2 -+ -+ pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal -+ wait_mpj $ns2 -+ chk_subflow_nr "after re-add" 3 -+ chk_mptcp_info subflows 3 subflows 3 - mptcp_lib_kill_wait $tests_pid - -- chk_join_nr 3 3 3 -- chk_add_nr 4 4 -- chk_rm_nr 2 1 invert -+ chk_join_nr 4 4 4 -+ chk_add_nr 5 5 -+ chk_rm_nr 3 2 invert - fi - - } diff --git a/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-id.patch b/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-id.patch index d3b28b9f32e..ca32bc28aaa 100644 --- a/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-id.patch +++ b/queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-id.patch @@ -87,4 +87,4 @@ Signed-off-by: Greg Kroah-Hartman + chk_rm_nr 3 2 invert fi - } + # flush and re-add diff --git a/queue-6.1/selftests-mptcp-join-check-re-re-adding-id-0-endp.patch b/queue-6.1/selftests-mptcp-join-check-re-re-adding-id-0-endp.patch index 4aab16648c8..97b97df1217 100644 --- a/queue-6.1/selftests-mptcp-join-check-re-re-adding-id-0-endp.patch +++ b/queue-6.1/selftests-mptcp-join-check-re-re-adding-id-0-endp.patch @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh -@@ -3312,7 +3312,7 @@ endpoint_tests() +@@ -3341,7 +3341,7 @@ endpoint_tests() pm_nl_set_limits $ns2 0 3 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow @@ -53,7 +53,7 @@ Signed-off-by: Greg Kroah-Hartman wait_mpj $ns2 pm_nl_del_endpoint $ns2 2 10.0.2.2 -@@ -3333,18 +3333,21 @@ endpoint_tests() +@@ -3362,18 +3362,21 @@ endpoint_tests() wait_mpj $ns2 chk_subflow_nr "" "after no reject" 3 @@ -82,5 +82,5 @@ Signed-off-by: Greg Kroah-Hartman + chk_join_nr 6 6 6 + chk_rm_nr 4 4 fi + } - # remove and re-add diff --git a/queue-6.1/selftests-mptcp-join-check-re-using-id-of-closed-subflow.patch b/queue-6.1/selftests-mptcp-join-check-re-using-id-of-closed-subflow.patch index 9d316827e85..115dcf69330 100644 --- a/queue-6.1/selftests-mptcp-join-check-re-using-id-of-closed-subflow.patch +++ b/queue-6.1/selftests-mptcp-join-check-re-using-id-of-closed-subflow.patch @@ -100,5 +100,5 @@ Signed-off-by: Greg Kroah-Hartman + chk_join_nr 3 3 3 + chk_rm_nr 1 1 fi + } - # remove and re-add diff --git a/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add.patch b/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add.patch deleted file mode 100644 index 1a198a5a284..00000000000 --- a/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add.patch +++ /dev/null @@ -1,85 +0,0 @@ -From e506695da52a62d4badd38b4862a98c6c2034e36 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 19 Aug 2024 21:45:20 +0200 -Subject: selftests: mptcp: join: check re-using ID of unused ADD_ADDR - -From: Matthieu Baerts (NGI0) - -[ Upstream commit a13d5aad4dd9a309eecdc33cfd75045bd5f376a3 ] - -This test extends "delete re-add signal" to validate the previous -commit. An extra address is announced by the server, but this address -cannot be used by the client. The result is that no subflow will be -established to this address. - -Later, the server will delete this extra endpoint, and set a new one, -with a valid address, but re-using the same ID. Before the previous -commit, the server would not have been able to announce this new -address. - -While at it, extra checks have been added to validate the expected -numbers of MPJ, ADD_ADDR and RM_ADDR. - -The 'Fixes' tag here below is the same as the one from the previous -commit: this patch here is not fixing anything wrong in the selftests, -but it validates the previous fix for an issue introduced by this commit -ID. - -Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink") -Cc: stable@vger.kernel.org -Reviewed-by: Mat Martineau -Signed-off-by: Matthieu Baerts (NGI0) -Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-2-38035d40de5b@kernel.org -Signed-off-by: Jakub Kicinski -Stable-dep-of: 1c2326fcae4f ("selftests: mptcp: join: check re-adding init endp with != id") -Signed-off-by: Sasha Levin ---- - .../testing/selftests/net/mptcp/mptcp_join.sh | 18 +++++++++++++----- - 1 file changed, 13 insertions(+), 5 deletions(-) - -diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh -index 4f8b0c0faac96..0dbbc9e9ed6f6 100755 ---- a/tools/testing/selftests/net/mptcp/mptcp_join.sh -+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh -@@ -3285,9 +3285,11 @@ endpoint_tests() - # remove and re-add - if reset "delete re-add signal" && - mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then -- pm_nl_set_limits $ns1 1 1 -- pm_nl_set_limits $ns2 1 1 -+ pm_nl_set_limits $ns1 0 2 -+ pm_nl_set_limits $ns2 2 2 - pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal -+ # broadcast IP: no packet for this address will be received on ns1 -+ pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal - test_linkfail=4 speed=20 \ - run_tests $ns1 $ns2 10.0.1.1 & - local tests_pid=$! -@@ -3299,15 +3301,21 @@ endpoint_tests() - chk_mptcp_info subflows 1 subflows 1 - - pm_nl_del_endpoint $ns1 1 10.0.2.1 -+ pm_nl_del_endpoint $ns1 2 224.0.0.1 - sleep 0.5 - chk_subflow_nr "after delete" 1 - chk_mptcp_info subflows 0 subflows 0 - -- pm_nl_add_endpoint $ns1 10.0.2.1 flags signal -+ pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal -+ pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal - wait_mpj $ns2 -- chk_subflow_nr "after re-add" 2 -- chk_mptcp_info subflows 1 subflows 1 -+ chk_subflow_nr "after re-add" 3 -+ chk_mptcp_info subflows 2 subflows 2 - mptcp_lib_kill_wait $tests_pid -+ -+ chk_join_nr 3 3 3 -+ chk_add_nr 4 4 -+ chk_rm_nr 2 1 invert - fi - - } --- -2.43.0 - diff --git a/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add_addr.patch b/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add_addr.patch index 6d0c9fdfbb4..b8295b87b5d 100644 --- a/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add_addr.patch +++ b/queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add_addr.patch @@ -84,4 +84,4 @@ Signed-off-by: Greg Kroah-Hartman + chk_rm_nr 2 1 invert fi - } + # flush and re-add diff --git a/queue-6.1/selftests-mptcp-join-check-removing-id-0-endpoint.patch b/queue-6.1/selftests-mptcp-join-check-removing-id-0-endpoint.patch index b0e10e36406..82349f6cb07 100644 --- a/queue-6.1/selftests-mptcp-join-check-removing-id-0-endpoint.patch +++ b/queue-6.1/selftests-mptcp-join-check-removing-id-0-endpoint.patch @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh -@@ -3308,19 +3308,20 @@ endpoint_tests() +@@ -3337,19 +3337,20 @@ endpoint_tests() if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then @@ -69,7 +69,7 @@ Signed-off-by: Greg Kroah-Hartman pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow wait_attempt_fail $ns2 -@@ -3332,10 +3333,18 @@ endpoint_tests() +@@ -3361,10 +3362,18 @@ endpoint_tests() wait_mpj $ns2 chk_subflow_nr "" "after no reject" 3 @@ -88,5 +88,5 @@ Signed-off-by: Greg Kroah-Hartman + chk_join_nr 4 4 4 + chk_rm_nr 2 2 fi + } - # remove and re-add diff --git a/queue-6.1/selftests-mptcp-join-test-for-flush-re-add-endpoints.patch b/queue-6.1/selftests-mptcp-join-test-for-flush-re-add-endpoints.patch index 579e3f59331..2273d4959e9 100644 --- a/queue-6.1/selftests-mptcp-join-test-for-flush-re-add-endpoints.patch +++ b/queue-6.1/selftests-mptcp-join-test-for-flush-re-add-endpoints.patch @@ -42,8 +42,8 @@ Signed-off-by: Greg Kroah-Hartman --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh -@@ -3368,6 +3368,35 @@ endpoint_tests() - chk_rm_nr 3 2 invert +@@ -3262,6 +3262,35 @@ userspace_tests() + kill_tests_wait fi + # flush and re-add @@ -77,4 +77,4 @@ Signed-off-by: Greg Kroah-Hartman + fi } - # [$1: error message] + endpoint_tests() diff --git a/queue-6.1/series b/queue-6.1/series index 2c7d3133b72..3091dc953a0 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -8,9 +8,6 @@ net-usb-qmi_wwan-add-meig-smart-srm825l.patch asoc-amd-yc-support-mic-on-lenovo-thinkpad-e14-gen-6.patch mptcp-make-pm_remove_addrs_and_subflows-static.patch mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch -selftests-mptcp-add-explicit-test-case-for-remove-re.patch -selftests-mptcp-join-check-re-using-id-of-unused-add.patch -selftests-mptcp-join-check-re-adding-init-endp-with-.patch pci-msi-fix-uaf-in-msi_capability_init.patch f2fs-fix-to-truncate-preallocated-blocks-in-f2fs_file_open.patch mptcp-pm-fullmesh-select-the-right-id-later.patch