From patchwork Fri Jul 21 08:56:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 27089 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 8358C3257; Fri, 21 Jul 2017 03:07:14 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 88F5E2C50; Fri, 21 Jul 2017 03:07:12 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2017 18:07:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,386,1496127600"; d="scan'208";a="289543782" Received: from dpdk_zq28.sh.intel.com ([10.67.110.203]) by fmsmga004.fm.intel.com with ESMTP; 20 Jul 2017 18:07:09 -0700 From: Qi Zhang To: wenzhuo.lu@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Fri, 21 Jul 2017 16:56:37 +0800 Message-Id: <20170721085637.18701-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [PATCH] net/ixgbe: fix mirror rule index overflow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Mirror rule id should not exceed the boundary defined by IXGBE_MAX_MIRROR_RULES. Fixes: fe3a45fd4104 ("ixgbe: add VMDq support") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 194058f..e829266 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5461,6 +5461,9 @@ ixgbe_mirror_rule_reset(struct rte_eth_dev *dev, uint8_t rule_id) if (ixgbe_vt_check(hw) < 0) return -ENOTSUP; + if (rule_id >= IXGBE_MAX_MIRROR_RULES) + return -EINVAL; + memset(&mr_info->mr_conf[rule_id], 0, sizeof(struct rte_eth_mirror_conf));