From: Adrien Mazarguil Date: Thu, 19 Apr 2018 10:07:29 +0000 (+0200) Subject: net/mlx5: fix RSS flow action bounds check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e68744e53ed209c0419925171c5aa510f6643adb;p=dpdk.git net/mlx5: fix RSS flow action bounds check The number of queues provided by the application is not checked against parser's supported maximum. Fixes: 3d821d6fea40 ("net/mlx5: support RSS action flow rule") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil Acked-by: Nelio Laranjeiro Acked-by: Ferruh Yigit --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 7ef68de493..1ca413e325 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -16,6 +16,7 @@ #pragma GCC diagnostic error "-Wpedantic" #endif +#include #include #include #include @@ -713,6 +714,14 @@ mlx5_flow_convert_actions(struct rte_eth_dev *dev, return -rte_errno; } } + if (rss->num > RTE_DIM(parser->queues)) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "too many queues for RSS" + " context"); + return -rte_errno; + } for (n = 0; n < rss->num; ++n) { if (rss->queue[n] >= priv->rxqs_n) { rte_flow_error_set(error, EINVAL,