From patchwork Wed May 12 03:14:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Wang X-Patchwork-Id: 93175 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A794DA0A0E; Wed, 12 May 2021 05:26:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AEFA4003F; Wed, 12 May 2021 05:26:31 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 60ECD4003E for ; Wed, 12 May 2021 05:26:30 +0200 (CEST) IronPort-SDR: Kij5jQKVC3mwUhoe0N6wpM9YpgDgFWYODW/iqZdrRO38LFuYAh3l1iKLcbONPM5tWMTIkUCrrF Y0m7YK18RkjQ== X-IronPort-AV: E=McAfee;i="6200,9189,9981"; a="220574205" X-IronPort-AV: E=Sophos;i="5.82,292,1613462400"; d="scan'208";a="220574205" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 20:26:29 -0700 IronPort-SDR: iH1NR/o0ZgVeccX/4TOzIyCX8FwKbxwyCT/+jaTyB7fY98o+Sf336J3wAMr4R3xHK89pJPsmwt f5aBGAASagUQ== X-IronPort-AV: E=Sophos;i="5.82,292,1613462400"; d="scan'208";a="436992015" Received: from vfio-vm.cd.intel.com ([10.240.178.195]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 20:26:26 -0700 From: Jie Wang To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Wang Jie Date: Wed, 12 May 2021 03:14:07 +0000 Message-Id: <20210512031407.4867-1-jie1x.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ice: fix VSI array out of bounds 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" From: Wang Jie In the loop, when the index of array "vsi->rss_key" is equal to "vsi->rss_key_size", the array will be out of bounds. Fixes: 50370662b727 ("net/ice: support device and queue ops") Signed-off-by: Wang Jie --- drivers/net/ice/ice_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 3e60acc01a..65efb3e966 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3034,7 +3034,7 @@ static int ice_init_rss(struct ice_pf *pf) /* configure RSS key */ if (!rss_conf->rss_key) { /* Calculate the default hash key */ - for (i = 0; i <= vsi->rss_key_size; i++) + for (i = 0; i < vsi->rss_key_size; i++) vsi->rss_key[i] = (uint8_t)rte_rand(); } else { rte_memcpy(vsi->rss_key, rss_conf->rss_key,