From: Matan Azrad Date: Tue, 26 Nov 2019 09:04:10 +0000 (+0000) Subject: ethdev: fix item expansion for RSS flow X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=64edb05e29c82260a0bd1000a20023d20c123e41 ethdev: fix item expansion for RSS flow 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: stable@dpdk.org Signed-off-by: Matan Azrad Acked-by: Ori Kam --- diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index d7f29e5322..87a3e8c4c6 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -1071,6 +1071,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) {