From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E2CFA00C5; Thu, 7 May 2020 05:18:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C2131D9AA; Thu, 7 May 2020 05:18:52 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 40A371D9A7 for ; Thu, 7 May 2020 05:18:50 +0200 (CEST) IronPort-SDR: i8dR+PD6VvqIM+a2ohYRKetrxRYL8b4hYuWg5qpJ+9+mHumGo1ScKssWKIk3txodudvEoEb2DY jTzzu819hCbQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 20:18:49 -0700 IronPort-SDR: BredzPp74XysCL8SDTR4GUMuUBaGl20yr1UA2Qfb/+dYSEn8b2GyU7srRwtPwEhqrkjOOyUBS8 X3gS/WLK+I4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,361,1583222400"; d="scan'208";a="278459397" Received: from intel.sh.intel.com ([10.239.255.18]) by orsmga002.jf.intel.com with ESMTP; 06 May 2020 20:18:46 -0700 From: Chenxu Di To: dev@dpdk.org Cc: beilei.xing@intel.com, Chenxu Di Date: Thu, 7 May 2020 03:09:28 +0000 Message-Id: <20200507030928.42082-1-chenxux.di@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/i40e: fix out of bounds read issue 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" This patch fixes (out-of-bounds read) coverity issue. Coverity issue: 357699 Coverity issue: 357694 Fixes: feaae285b342 ("net/i40e: support hash configuration in RSS flow") Signed-off-by: Chenxu Di --- drivers/net/i40e/i40e_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 749d85f54..6c295ac5a 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -13180,7 +13180,7 @@ i40e_rss_config_hash_function(struct i40e_pf *pf, } for (j = I40E_FILTER_PCTYPE_INVALID + 1; - j < I40E_FILTER_PCTYPE_MAX; j++) { + j < I40E_FILTER_PCTYPE_MAX && i < UINT64_BIT; j++) { if (pf->adapter->pctypes_tbl[i] & (1ULL << j)) i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM(j), @@ -13312,7 +13312,7 @@ i40e_rss_clear_hash_function(struct i40e_pf *pf, } for (j = I40E_FILTER_PCTYPE_INVALID + 1; - j < I40E_FILTER_PCTYPE_MAX; j++) { + j < I40E_FILTER_PCTYPE_MAX && i < UINT64_BIT; j++) { if (pf->adapter->pctypes_tbl[i] & (1ULL << j)) i40e_write_global_rx_ctl(hw, I40E_GLQF_HSYM(j), -- 2.17.1