DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix missed item expansion for RSS flow
@ 2019-11-26  9:04 Matan Azrad
  2019-11-26 13:22 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Matan Azrad @ 2019-11-26  9:04 UTC (permalink / raw)
  To: dev; +Cc: jackmin

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix missed item expansion for RSS flow
  2019-11-26  9:04 [dpdk-dev] [PATCH] ethdev: fix missed item expansion for RSS flow Matan Azrad
@ 2019-11-26 13:22 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-11-26 13:22 UTC (permalink / raw)
  To: Matan Azrad, dev; +Cc: jackmin

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26  9:04 [dpdk-dev] [PATCH] ethdev: fix missed item expansion for RSS flow Matan Azrad
2019-11-26 13:22 ` Ferruh Yigit

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox