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 A224EA00E6 for ; Mon, 5 Aug 2019 16:46:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA8BD1BDE9; Mon, 5 Aug 2019 16:46:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 4EA7B1B9CD for ; Mon, 5 Aug 2019 16:46:03 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x75Ef0SY003641; Mon, 5 Aug 2019 07:46:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : reply-to : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=PJCkZw4qjBlUQy27+WdnYWsJ8ZhUp7ZGPPFUQ+EeLO8=; b=PD6ru/BmebJaUqBKgGq5ftdehm3hqLSu5jt3D0yxJBAlzBq49LQ1dCTF/6hrFEyybbDT +x2RTwSTvEuMTrihIDQWoH+JHs5IxmTg7E4W80Zg13JpG628vEyAARZfKnHDpIoCAgwX t14u5QzyQtuDvMyOgy9ZJ0V7ssRmB6WTPuAeWt9hn7F+ihzbGPra2SyVp65AQRA7Ue3Q m3phsMUPmvZToR9f+lTq3Q3/56/HZlp+23M9uTJW1DeWI6nLr0gyHifKA4ZWwEvhuRn+ fqtqHV64xih9rkt12UDUVXY63HTVLaaB95GyuzbIck+bzugxZVsekDh+kinLSMBenolp tQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2u59skpmmp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 05 Aug 2019 07:46:01 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 5 Aug 2019 07:45:59 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 5 Aug 2019 07:45:59 -0700 Received: from kk-box-0.marvell.com (unknown [10.95.130.77]) by maili.marvell.com (Postfix) with ESMTP id 07B3E3F703F; Mon, 5 Aug 2019 07:45:57 -0700 (PDT) From: To: , , Chas Williams CC: Krzysztof Kanas , Date: Mon, 5 Aug 2019 16:44:53 +0200 Message-ID: <20190805144454.10496-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-08-05_07:2019-07-31,2019-08-05 signatures=0 Subject: [dpdk-dev] [PATCH 1/2] net/bonding: fix stack overflow in selection logic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: CAJFAV8yRusdA7A9TC9M+ZsaA_LZbV3_XdSsTDjd4+oEUBk6vAg@mail.gmail.com 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 d764dad331ed..89a8ba3de963 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -670,8 +670,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