patch 'app/testpmd: avoid potential outside of array reference' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Sat Dec 7 09:00:53 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/10/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=747ba3671e05f61b7113fb767a1394a6fb34a5e8
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 747ba3671e05f61b7113fb767a1394a6fb34a5e8 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 21 Nov 2024 10:23:30 -0800
Subject: [PATCH] app/testpmd: avoid potential outside of array reference
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit f86085caab0c6c5dc630b9d6ad20d1c728e7703e ]
The order of comparison is wrong, and potentially allows
referencing past the array.
Link: https://pvs-studio.com/en/blog/posts/cpp/1179/
Fixes: 3e3edab530a1 ("ethdev: add flow quota")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
app/test-pmd/cmdline_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4b13d84ad1..661c72c7ef 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -12111,7 +12111,7 @@ comp_names_to_index(struct context *ctx, const struct token *token,
RTE_SET_USED(token);
if (!buf)
return names_size;
- if (names[ent] && ent < names_size)
+ if (ent < names_size && names[ent] != NULL)
return rte_strscpy(buf, names[ent], size);
return -1;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-12-06 23:26:47.208956809 +0800
+++ 0095-app-testpmd-avoid-potential-outside-of-array-referen.patch 2024-12-06 23:26:44.113044826 +0800
@@ -1 +1 @@
-From f86085caab0c6c5dc630b9d6ad20d1c728e7703e Mon Sep 17 00:00:00 2001
+From 747ba3671e05f61b7113fb767a1394a6fb34a5e8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit f86085caab0c6c5dc630b9d6ad20d1c728e7703e ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 1e4f2ebc55..9e4fc2d95d 100644
+index 4b13d84ad1..661c72c7ef 100644
@@ -24 +26 @@
-@@ -12892,7 +12892,7 @@ comp_names_to_index(struct context *ctx, const struct token *token,
+@@ -12111,7 +12111,7 @@ comp_names_to_index(struct context *ctx, const struct token *token,
More information about the stable
mailing list