DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: dev@dpdk.org
Cc: jackmin@mellanox.com
Subject: [dpdk-dev] [PATCH] ethdev: fix missed item expansion for RSS flow
Date: Tue, 26 Nov 2019 09:04:10 +0000	[thread overview]
Message-ID: <1574759050-21879-1-git-send-email-matan@mellanox.com> (raw)

When the last item in flow pattern includes "next protocol" field which
is relevant for RSS flow expansion, a new item is added to the pattern
according to the "next protocol" field. This field is called missed
field.

The missed field wrongly was not initialized what caused to some of the
flow item fields to contain garbage values.

As a result, the PMDs internal flow engine may crash.

For example, the spec value may include garbage pointer and to cause
crash.

Initialize the missed field with zeroes.

Fixes: fc2dd8dd492f ("ethdev: fix expand RSS flows")
Cc: jackmin@mellanox.com

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 lib/librte_ethdev/rte_flow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index d7f29e5..87a3e8c 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -1071,6 +1071,7 @@ enum rte_flow_conv_item_spec_type {
 	int elt = 0;
 	const struct rte_flow_item *last_item = NULL;
 
+	memset(&missed_item, 0, sizeof(missed_item));
 	lsize = offsetof(struct rte_flow_expand_rss, entry) +
 		elt_n * sizeof(buf->entry[0]);
 	if (lsize <= size) {
-- 
1.8.3.1


             reply	other threads:[~2019-11-26  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  9:04 Matan Azrad [this message]
2019-11-26 13:22 ` Ferruh Yigit

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=1574759050-21879-1-git-send-email-matan@mellanox.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=jackmin@mellanox.com \
    /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).