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 F1F9AA0613 for ; Tue, 30 Jul 2019 13:31:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 215771C0BF; Tue, 30 Jul 2019 13:31:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id D750A1C0AE for ; Tue, 30 Jul 2019 13:31:48 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6UBL1G3030951; Tue, 30 Jul 2019 04:31:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=YlN+2g414rQWyqGgL7V9CZzq8nXb87Uxk8dHCrlVPyI=; b=vpJ8+3N2Lu1bTSyEk/JWX3Ny/A2CLKBrhvEA1SPsGnriIxG5Cnbt5EYNvwxPcheFuOVj hJS0rUx7DzEn8dp45aWu3SWTg4trDGwQHBOX0dbk3yIIlhCx+hoH4tXhIu5e2sAK0EIr uV6ltOm2cwPK+h7c3kEv6Lf675BSdRmiuptuiy8xeHrZWEwAvw52XQPyVI/ARpbfW1cq x8qevS1ZqUOYBuGZNyISH+/sfXVACHP9BZ+HOz3nFR97rXlCbT6e+bWHWsZFmH75ylve R3zIVNZE3Vsmkkh+NbMJXcJlpbpvu/LsTynskguKvHMI792rEXy0vaa9DuPnaYzNCwH0 uA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2u0kyq4j9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jul 2019 04:31:47 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 30 Jul 2019 04:31:46 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 30 Jul 2019 04:31:46 -0700 Received: from kk-box-0.marvell.com (unknown [10.95.130.26]) by maili.marvell.com (Postfix) with ESMTP id CD4313F703F; Tue, 30 Jul 2019 04:31:44 -0700 (PDT) From: To: , Chas Williams CC: Krzysztof Kanas , Date: Tue, 30 Jul 2019 13:31:35 +0200 Message-ID: <20190730113135.19907-1-kkanas@marvell.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-30_05:2019-07-29,2019-07-30 signatures=0 Subject: [dpdk-dev] [PATCH] net/bonding: fix stack overflow in selection logic 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" From: Krzysztof Kanas Bonding selection logic uses agg_bandwidth, agg_count indexed by port_id but those arrays are 8 entries long. Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") Cc: danielx.t.mrzyglod@intel.com Signed-off-by: Krzysztof Kanas --- drivers/net/bonding/rte_eth_bond_8023ad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 1e6a3fc7c641..a7c040e26931 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -669,8 +669,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) struct port *agg, *port; uint16_t slaves_count, new_agg_id, i, j = 0; uint16_t *slaves; - uint64_t agg_bandwidth[8] = {0}; - uint64_t agg_count[8] = {0}; + uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0}; + uint64_t agg_count[RTE_MAX_ETHPORTS] = {0}; uint16_t default_slave = 0; uint8_t mode_count_id, mode_band_id; struct rte_eth_link link_info; -- 2.21.0