DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix random flow item token
@ 2025-05-19  6:30 Gregory Etelson
  0 siblings, 0 replies; only message in thread
From: Gregory Etelson @ 2025-05-19  6:30 UTC (permalink / raw)
  To: dev
  Cc: getelson,  ,
	rasland, stable, Ori Kam, Aman Singh, Michael Baum,
	Dariusz Sosnowski

ITEM_RANDOM_VALUE token initializes 32 bits mask argument value from
a constant source buffer.

Testpmd initiated the mast value from the 3 bytes buffer -
[0xff, 0xff, 0x00].
When testpmd copied that value to 32 bits mask it accessed a memory
byte outside the source buffer.

The patch fixes the source buffer size.

Fixes: 738ef8f7c706 ("ethdev: add flow item for random matching")

Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.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 998527590f..fc807ad8cf 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -5591,7 +5591,7 @@ static const struct token token_list[] = {
 		.next = NEXT(item_random, NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_MASK(struct rte_flow_item_random,
-					     value, "\xff\xff")),
+					     value, "\x00\x00\xff\xff")),
 	},
 	[ITEM_GRE_KEY] = {
 		.name = "gre_key",
-- 
2.48.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-19  6:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-19  6:30 [PATCH] app/testpmd: fix random flow item token Gregory Etelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).