From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9BF8EA0547; Wed, 19 May 2021 10:20:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F3A040041; Wed, 19 May 2021 10:20:11 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 4D4B44003F; Wed, 19 May 2021 10:20:08 +0200 (CEST) IronPort-SDR: egyU2kEZLk4WCmp1BHCowBXZiVGXVw+Aj/mUtkQ13vK6JBQJIQ30KYhMb1bJAXEgBEuiOIbLt8 rXqnqTsgV0+A== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="180522852" X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="180522852" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 01:20:08 -0700 IronPort-SDR: h9Pyklc4o/6skvmrHsGW9hiH+jjVl9/liBcVrMGFu2TT79nRcPw0VQZJvaP0XBMQYbiqpR1PKV iSRxuP7u4KSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="411639955" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.118.220]) by orsmga002.jf.intel.com with ESMTP; 19 May 2021 01:20:05 -0700 From: Haiyue Wang To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Haiyue Wang , stable@dpdk.org, Jingjing Wu , Beilei Xing Date: Wed, 19 May 2021 15:59:33 +0800 Message-Id: <20210519075933.11807-1-haiyue.wang@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1] net/iavf: fix RSS key access out of index X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" The array rss_key has size 'vf->vf_res->rss_key_size', the array index should be less than that. Cc: stable@dpdk.org Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Signed-off-by: Haiyue Wang --- drivers/net/iavf/iavf_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index d688c31cfb..cb38fe81e1 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -366,7 +366,7 @@ iavf_init_rss(struct iavf_adapter *adapter) /* configure RSS key */ if (!rss_conf->rss_key) { /* Calculate the default hash key */ - for (i = 0; i <= vf->vf_res->rss_key_size; i++) + for (i = 0; i < vf->vf_res->rss_key_size; i++) vf->rss_key[i] = (uint8_t)rte_rand(); } else rte_memcpy(vf->rss_key, rss_conf->rss_key, -- 2.31.1