net/ice: fix crash in switch filter
authorJunyu Jiang <junyux.jiang@intel.com>
Wed, 6 May 2020 03:05:25 +0000 (03:05 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
The number of queues in queue group should be checked before
using it. This patch fixed the issue.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/ice_switch_filter.c

index 72bb223..1bea7e8 100644 (file)
@@ -1297,6 +1297,8 @@ ice_switch_parse_action(struct ice_pf *pf,
                switch (action_type) {
                case RTE_FLOW_ACTION_TYPE_RSS:
                        act_qgrop = action->conf;
+                       if (act_qgrop->queue_num <= 1)
+                               goto error;
                        rule_info->sw_act.fltr_act =
                                ICE_FWD_TO_QGRP;
                        rule_info->sw_act.fwd_id.q_id =