Skip to content

Commit

Permalink
ethdev: fix item expansion for RSS flow
Browse files Browse the repository at this point in the history
[ upstream commit 64edb05 ]

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: fc2dd8d ("ethdev: fix expand RSS flows")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
  • Loading branch information
Matan Azrad authored and kevintraynor committed Dec 11, 2019
1 parent 5136c9f commit a9228f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/librte_ethdev/rte_flow.c
Expand Up @@ -983,6 +983,7 @@ rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size,
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) {
Expand Down

0 comments on commit a9228f7

Please sign in to comment.