DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix RSS flow configuration crash
@ 2018-08-01 10:43 Moti Haimovsky
  2018-08-01 11:01 ` Adrien Mazarguil
  2018-08-01 13:40 ` [dpdk-dev] [PATCH v1] " Moti Haimovsky
  0 siblings, 2 replies; 8+ messages in thread
From: Moti Haimovsky @ 2018-08-01 10:43 UTC (permalink / raw)
  To: shahafs; +Cc: dev, Moti Haimovsky, nelio.laranjeiro

This commit fixes a segmentation fault observed when configuring
mlx5 with RSS flow rule containing invalid queues indices such as
negative numbers or numbers bigger than the number Rx queues the PMD
is configured with.

Fixes: 592f05b29a25 ("net/mlx5: add RSS flow action")
Cc: nelio.laranjeiro@6wind.com

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 6c3021a..0b55366 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2077,6 +2077,12 @@ struct mlx5_flow_tunnel_info {
 					  "some RSS protocols are not"
 					  " supported");
 	for (i = 0; i != rss->queue_num; ++i) {
+		if (rss->queue[i] >= priv->rxqs_n)
+			return rte_flow_error_set
+				(error, EINVAL,
+				 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+				 &rss->queue[i],
+				 "queue index out of range");
 		if (!(*priv->rxqs)[rss->queue[i]])
 			return rte_flow_error_set
 				(error, EINVAL,
-- 
1.8.3.1

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

end of thread, other threads:[~2018-08-02 11:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 10:43 [dpdk-dev] [PATCH] net/mlx5: fix RSS flow configuration crash Moti Haimovsky
2018-08-01 11:01 ` Adrien Mazarguil
2018-08-01 13:40 ` [dpdk-dev] [PATCH v1] " Moti Haimovsky
2018-08-01 14:13   ` Adrien Mazarguil
2018-08-02  8:41   ` [dpdk-dev] [PATCH v2] " Moti Haimovsky
2018-08-02 11:17     ` Shahaf Shuler
2018-08-02 11:18     ` Adrien Mazarguil
2018-08-02 11:20       ` Shahaf Shuler

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