From: Greg Kroah-Hartman Date: Thu, 13 Jun 2024 11:07:52 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v4.19.316~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be827de99d51cdd2e54123f84d2ff428d599257a;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: selftests-net-more-strict-check-in-net_helper.patch --- diff --git a/queue-6.6/selftests-net-more-strict-check-in-net_helper.patch b/queue-6.6/selftests-net-more-strict-check-in-net_helper.patch new file mode 100644 index 00000000000..700353d72ea --- /dev/null +++ b/queue-6.6/selftests-net-more-strict-check-in-net_helper.patch @@ -0,0 +1,57 @@ +From a71d0908e32f3dd41e355d83eeadd44d94811fd6 Mon Sep 17 00:00:00 2001 +From: Paolo Abeni +Date: Mon, 12 Feb 2024 11:19:23 +0100 +Subject: selftests: net: more strict check in net_helper + +From: Paolo Abeni + +commit a71d0908e32f3dd41e355d83eeadd44d94811fd6 upstream. + +The helper waiting for a listener port can match any socket whose +hexadecimal representation of source or destination addresses +matches that of the given port. + +Additionally, any socket state is accepted. + +All the above can let the helper return successfully before the +relevant listener is actually ready, with unexpected results. + +So far I could not find any related failure in the netdev CI, but +the next patch is going to make the critical event more easily +reproducible. + +Address the issue matching the port hex only vs the relevant socket +field and additionally checking the socket state for TCP sockets. + +Fixes: 3bdd9fd29cb0 ("selftests/net: synchronize udpgro tests' tx and rx connection") +Signed-off-by: Paolo Abeni +Link: https://lore.kernel.org/r/192b3dbc443d953be32991d1b0ca432bd4c65008.1707731086.git.pabeni@redhat.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/net/net_helper.sh | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/tools/testing/selftests/net/net_helper.sh ++++ b/tools/testing/selftests/net/net_helper.sh +@@ -8,13 +8,16 @@ wait_local_port_listen() + local listener_ns="${1}" + local port="${2}" + local protocol="${3}" +- local port_hex ++ local pattern + local i + +- port_hex="$(printf "%04X" "${port}")" ++ pattern=":$(printf "%04X" "${port}") " ++ ++ # for tcp protocol additionally check the socket state ++ [ ${protocol} = "tcp" ] && pattern="${pattern}0A" + for i in $(seq 10); do +- if ip netns exec "${listener_ns}" cat /proc/net/"${protocol}"* | \ +- grep -q "${port_hex}"; then ++ if ip netns exec "${listener_ns}" awk '{print $2" "$4}' \ ++ /proc/net/"${protocol}"* | grep -q "${pattern}"; then + break + fi + sleep 0.1 diff --git a/queue-6.6/series b/queue-6.6/series index 11d584a217b..001f3d5d1bf 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -134,3 +134,4 @@ alsa-seq-fix-incorrect-ump-type-for-system-messages.patch powerpc-64-bpf-fix-tail-calls-for-pcrel-addressing.patch powerpc-bpf-enforce-full-ordering-for-atomic-operations-with-bpf_fetch.patch smb-client-fix-deadlock-in-smb2_find_smb_tcon.patch +selftests-net-more-strict-check-in-net_helper.patch