DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/mlx4: fix RSS actions with no parameters
@ 2018-02-21 13:38 Ophir Munk
  2018-02-23 16:52 ` Adrien Mazarguil
  0 siblings, 1 reply; 4+ messages in thread
From: Ophir Munk @ 2018-02-21 13:38 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: dev, Thomas Monjalon, Olga Shern, Ophir Munk, stable

When creating an RSS flow with missing actions parameters, for example:
flow create 0 ingress pattern <list of patterns>  / end actions rss / end

testpmd aborts with segmentation fault.
In the corrupted code mlx4_flow_prepare() accesses RSS action->conf pointer
without verifying its validity.
In case of missing RSS actions parameters this pointer is NULL and must not
 be accessed.
The fix is to return an error in such cases "missing rss actions".

Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/net/mlx4/mlx4_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 2d55bfe..7a127a8 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -735,6 +735,10 @@ mlx4_flow_prepare(struct priv *priv,
 			if (flow->rss)
 				break;
 			rss = action->conf;
+			if (!rss) {
+				msg = "missing rss actions";
+				goto exit_action_not_supported;
+			}
 			/* Default RSS configuration if none is provided. */
 			rss_conf =
 				rss->rss_conf ?
-- 
2.7.4

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

end of thread, other threads:[~2018-02-26  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-21 13:38 [dpdk-dev] [PATCH v1] net/mlx4: fix RSS actions with no parameters Ophir Munk
2018-02-23 16:52 ` Adrien Mazarguil
2018-02-24 23:18   ` Ophir Munk
2018-02-26  9:31     ` Adrien Mazarguil

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).