DPDK patches and discussions
 help / color / mirror / Atom feed
From: Elena Carasec <xcaras00@stud.fit.vutbr.cz>
To: dev@dpdk.org
Cc: Elena Carasec <xcaras00@stud.fit.vutbr.cz>,
	stable@dpdk.org, Beilei Xing <beilei.xing@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Luca Boccassi <bluca@debian.org>,
	Jan Viktorin <viktorin@cesnet.cz>
Subject: [dpdk-dev] [PATCH] i40e: fix segfault when using custom RSS key
Date: Wed, 26 Aug 2020 11:28:01 +0000	[thread overview]
Message-ID: <1598441281-11209-1-git-send-email-xcaras00@stud.fit.vutbr.cz> (raw)

&out->conf and in can point to the same memory area. Reinitialization of
out->conf leads to setting in->key to NULL, but leaves key_len 40. This
leads to segfault on destruction of the RSS flow action. The segfault
happens inside i40e_action_rss_same(), when comparing comp->key and
with->key, because both comp->key_len and with->key_len are 40 (should
be 0).

Reproduction steps (testpmd):

port stop 0
flow create 0 ingress pattern end actions rss func default level 0\
  key 6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a6d5a\
  key_len 40 queues 0 end / end
port start 0
set link-up port 0
start
stop
set link-down port 0
port stop 0
flow destroy 0 rule 0
(Segmentation fault)

Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")

Signed-off-by: Elena Carasec <xcaras00@stud.fit.vutbr.cz>
Signed-off-by: Jan Viktorin <viktorin@cesnet.cz>
---
 drivers/net/i40e/i40e_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 11c02b1..a5fe130 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -13211,6 +13211,8 @@ struct i40e_customized_pctype*
 		return -EINVAL;
 	if (!in->key && in->key_len)
 		return -EINVAL;
+	if (&out->conf == in)
+		return 0;
 	out->conf = (struct rte_flow_action_rss){
 		.func = in->func,
 		.level = in->level,
-- 
1.8.3.1


             reply	other threads:[~2020-08-26 11:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 11:28 Elena Carasec [this message]
2020-08-28  6:38 ` Xing, Beilei
2020-08-28 12:52   ` Carasec Elena
2020-08-28 13:05     ` [dpdk-dev] [dpdk-stable] " Kevin Traynor
2020-08-28 14:51       ` Carasec Elena

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=1598441281-11209-1-git-send-email-xcaras00@stud.fit.vutbr.cz \
    --to=xcaras00@stud.fit.vutbr.cz \
    --cc=adrien.mazarguil@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=beilei.xing@intel.com \
    --cc=bluca@debian.org \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=viktorin@cesnet.cz \
    /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).