]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2024 13:35:19 +0000 (15:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2024 13:35:19 +0000 (15:35 +0200)
added patches:
selftests-net-lib-set-i-as-local.patch

queue-6.9/selftests-net-lib-set-i-as-local.patch [new file with mode: 0644]
queue-6.9/series

diff --git a/queue-6.9/selftests-net-lib-set-i-as-local.patch b/queue-6.9/selftests-net-lib-set-i-as-local.patch
new file mode 100644 (file)
index 0000000..3be658f
--- /dev/null
@@ -0,0 +1,43 @@
+From 84a8bc3ec225b28067b168e9410e452c83d706da Mon Sep 17 00:00:00 2001
+From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
+Date: Wed, 5 Jun 2024 11:21:18 +0200
+Subject: selftests: net: lib: set 'i' as local
+
+From: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+
+commit 84a8bc3ec225b28067b168e9410e452c83d706da upstream.
+
+Without this, the 'i' variable declared before could be overridden by
+accident, e.g.
+
+  for i in "${@}"; do
+      __ksft_status_merge "${i}"  ## 'i' has been modified
+      foo "${i}"                  ## using 'i' with an unexpected value
+  done
+
+After a quick look, it looks like 'i' is currently not used after having
+been modified in __ksft_status_merge(), but still, better be safe than
+sorry. I saw this while modifying the same file, not because I suspected
+an issue somewhere.
+
+Fixes: 596c8819cb78 ("selftests: forwarding: Have RET track kselftest framework constants")
+Acked-by: Geliang Tang <geliang@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
+Link: https://lore.kernel.org/r/20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-3-b3afadd368c9@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/net/lib.sh |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tools/testing/selftests/net/lib.sh
++++ b/tools/testing/selftests/net/lib.sh
+@@ -22,6 +22,7 @@ __ksft_status_merge()
+       local -A weights
+       local weight=0
++      local i
+       for i in "$@"; do
+               weights[$i]=$((weight++))
+       done
index 9e2527f2e0dcb00ad83ca67f3541a48b1d8f8391..254016daa66cf9c7d94d8331891848ceefcf3788 100644 (file)
@@ -277,6 +277,7 @@ cifs-fix-missing-set-of-remote_i_size.patch
 tracing-probes-fix-error-check-in-parse_btf_field.patch
 tpm_tis_spi-account-for-spi-header-when-allocating-t.patch
 sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch
+selftests-net-lib-set-i-as-local.patch
 netfilter-nfnetlink_queue-acquire-rcu_read_lock-in-i.patch
 netfilter-ipset-add-list-flush-to-cancel_gc.patch
 netfilter-nft_payload-restore-vlan-q-in-q-match-supp.patch