From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 11B6EA00E6 for ; Fri, 22 Mar 2019 12:19:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1D221B5B0; Fri, 22 Mar 2019 12:19:01 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 657D51B5A9; Fri, 22 Mar 2019 12:18:59 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3745C049E22; Fri, 22 Mar 2019 11:18:58 +0000 (UTC) Received: from [10.36.112.59] (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 61FB660857; Fri, 22 Mar 2019 11:18:55 +0000 (UTC) To: David Marchand , dev@dpdk.org Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> <1553200094-5487-2-git-send-email-david.marchand@redhat.com> From: Maxime Coquelin Message-ID: <425b9d12-8c1f-c921-440e-4fb777bfd57f@redhat.com> Date: Fri, 22 Mar 2019 12:18:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1553200094-5487-2-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 22 Mar 2019 11:18:58 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 2/2] net/bonding: fix oob access in "other" aggregator modes 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" Message-ID: <20190322111853.6c2RJAacy7HsWWtuJifusKCP0R6Nrt0SIXKP3JXyCOw@z> On 3/21/19 9:28 PM, David Marchand wrote: > From: Zhaohui > > slave aggregator_port_id is in [0, RTE_MAX_ETHPORTS-1] range. > If RTE_MAX_ETHPORTS is > 8, we can hit out of bound accesses on > agg_bandwidth[] and agg_count[] arrays. > > Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") > Cc: stable@dpdk.org > > Signed-off-by: Zhaohui > Signed-off-by: David Marchand > --- > 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 3943ec1..5004898 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -669,8 +669,8 @@ > 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; > uint16_t mode_count_id; > uint16_t mode_band_id; > Reviewed-by: Maxime Coquelin