From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0BCE3A0A02; Wed, 24 Mar 2021 14:03:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E34E34067B; Wed, 24 Mar 2021 14:03:54 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 54FBF4014F; Wed, 24 Mar 2021 14:03:53 +0100 (CET) IronPort-SDR: 37C1ciuvEdfgD4vkarNqBSH7HbcQ0EUyzGqwofljdRKNZ9IiZv3uyXrzb7SmtK/FVzf+Crvr+5 hSH7OaBvGJmA== X-IronPort-AV: E=McAfee;i="6000,8403,9932"; a="190113413" X-IronPort-AV: E=Sophos;i="5.81,274,1610438400"; d="scan'208";a="190113413" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 06:03:52 -0700 IronPort-SDR: F2vKUKHcMEf/snmRGTxzSYp4eWj6mKtez6aEhzDcrr+TKay040aiCt11Ce0lQrTtNyu3vwSXEh 3Phhx16/iUAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,274,1610438400"; d="scan'208";a="415479467" Received: from irsmsx605.ger.corp.intel.com ([163.33.146.138]) by orsmga008.jf.intel.com with ESMTP; 24 Mar 2021 06:03:51 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by IRSMSX605.ger.corp.intel.com (163.33.146.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 24 Mar 2021 13:03:49 +0000 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2106.013; Wed, 24 Mar 2021 21:03:46 +0800 From: "Zhang, Qi Z" To: "Yang, Qiming" CC: "dev@dpdk.org" , "Yigit, Ferruh" , "stable@dpdk.org" Thread-Topic: [PATCH] net/ice/base: fix out of memory bound for MAC addresses Thread-Index: AQHXGvKSc8XETeQq8UKuTmcp1Dus/6qIeuGAgAqrYLA= Date: Wed, 24 Mar 2021 13:03:46 +0000 Message-ID: <2a83d6b8bf134dc995cbfd817f4629ff@intel.com> References: <20210317060219.2162370-1-qi.z.zhang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ice/base: fix out of memory bound for MAC addresses 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" > -----Original Message----- > From: Yang, Qiming > Sent: Thursday, March 18, 2021 10:07 AM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Yigit, Ferruh ; stable@dpdk.org > Subject: RE: [PATCH] net/ice/base: fix out of memory bound for MAC > addresses >=20 >=20 > > -----Original Message----- > > From: Zhang, Qi Z > > Sent: Wednesday, March 17, 2021 14:02 > > To: Yang, Qiming > > Cc: dev@dpdk.org; Yigit, Ferruh ; Zhang, Qi Z > > ; stable@dpdk.org > > Subject: [PATCH] net/ice/base: fix out of memory bound for MAC > > addresses > > > > Not enough memory be allocated for dev->data->mac_address which cause > > out of bound memory access when iterate all mac addresses by > > dev_info.max_mac_addrs. > > > > Fixes: f9cf4f864150 ("net/ice: support device initialization") > > Cc: stable@dpdk.org > > > > Reported-by: Ferruh Yigit > > Signed-off-by: Qi Zhang > > --- > > 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 8999d441ac..22104250fa 100644 > > --- a/drivers/net/ice/ice_ethdev.c > > +++ b/drivers/net/ice/ice_ethdev.c > > @@ -809,7 +809,7 @@ ice_init_mac_address(struct rte_eth_dev *dev) > > (struct rte_ether_addr *)hw->port_info[0].mac.perm_addr); > > > > dev->data->mac_addrs =3D > > -rte_zmalloc(NULL, sizeof(struct rte_ether_addr), 0); > > +rte_zmalloc(NULL, sizeof(struct rte_ether_addr) * > > +ICE_NUM_MACADDR_MAX, 0); > > if (!dev->data->mac_addrs) { > > PMD_INIT_LOG(ERR, > > "Failed to allocate memory to store mac address"); > > -- > > 2.26.2 >=20 > Acked-by: Qiming Yang Applied to dpdk-next-net-intel. Thanks Qi