ethdev: fix missed item expansion for RSS flow
Checks
Commit Message
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(+)
Comments
On 11/26/2019 9:04 AM, Matan Azrad wrote:
> 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>
Applied to dpdk-next-net/master, thanks.
@@ -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) {