DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: getelson@nvidia.com,   <mkashani@nvidia.com>,
	rasland@nvidia.com, stable@dpdk.org, "Ori Kam" <orika@nvidia.com>,
	"Aman Singh" <aman.deep.singh@intel.com>,
	"Michael Baum" <michaelba@nvidia.com>,
	"Dariusz Sosnowski" <dsosnowski@nvidia.com>
Subject: [PATCH] app/testpmd: fix random flow item token
Date: Mon, 19 May 2025 09:30:45 +0300	[thread overview]
Message-ID: <20250519063045.394353-1-getelson@nvidia.com> (raw)

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


                 reply	other threads:[~2025-05-19  6:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250519063045.394353-1-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=michaelba@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).