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 7AFE8A0561; Thu, 18 Mar 2021 03:07:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2ED2141000; Thu, 18 Mar 2021 03:07:35 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 82B49140FFE; Thu, 18 Mar 2021 03:07:34 +0100 (CET) IronPort-SDR: h/YAdAM/CEFIY+SaP8PoeujvEJLDBCgDfSMV0UgnNn89xMZW38wAMFIec5zDhLdxgi8kyJmShh jA4/QIeXS4cA== X-IronPort-AV: E=McAfee;i="6000,8403,9926"; a="176713297" X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="176713297" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 19:07:31 -0700 IronPort-SDR: SLe2nmgfAOUNqSv5FUVkpdi0BsqkfazNVazYdCmuB2qHnXsd5qLicl1z2LKyWqyITI5K0F7CqC H+qyVBf9phYQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="605951406" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga005.fm.intel.com with ESMTP; 17 Mar 2021 19:07:31 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 17 Mar 2021 19:07:31 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 17 Mar 2021 19:07:31 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.170) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 17 Mar 2021 19:07:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TnQipi6vCyWuYOv8gmBDSzfRs4pZj6h5W23tSand3ClAxmegYO/cc3QYm3klbpj36JqnlVH6X7uCyAw6Sfq2s/d/Hx+S4zT4sDe90fp9M9vkCnCA61l4HyihEmgh1Ver5bawA4M3qI0jXt8L5NUW8xRhR7erYo9cBcip+iZ0pzKwp36hGp4owmCjpICbq+3OBmNqcY9BBG1lcTLPF/UT8tQh/qsnCarYB6ipRbBnPx0rQ95DqMZQtYgxanht5PIJzi0/CKOJ8J2dqmDsKWV2vG2Dt01yWlJJksOZA6H0/RGXRmILak4aOxhBfc6Ohak/CIcgM3yr313aAVNXTx9KtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRVoDr8u+QWXZttnIPHuRRqTnmjYg8z/DO42D9yrhMk=; b=ncbjo6RSMY0S8OP0jqqKTp7jrAp9XxC64RerIQr+NafupfWTGVnM3KKoh1GfrOKZ3ESDIc+7Ioq1agl4v9LDCUD+DdPqsyUR8ASxczwM0XOdiJkOu8Y/lszqsWNVihH3pwlXhYB0K42pEDta7Hk6uqGJ63btE/5in3dad9VcXV8ZFXIjH+lhBBZVLm+uW0GvF80J/AkUnXUwS6J4s1PlORebbnDRHgUXFdxiyMi2IORzSLSKcxl2WwEW5lOYqVNKISren3XaPtB+bZWBSuthulGVHCpO0kGbIEKuE1Jr7OahMfm4hv3Ax3Fk8KYNjLimGTR6Nd1t7DikmtbxV949lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRVoDr8u+QWXZttnIPHuRRqTnmjYg8z/DO42D9yrhMk=; b=T8ZjCix3v2u7JP++JTOZCLKqhJbPeJdoXPaRs8ZGQdOc7ZOkoF1phqafdOFOoGiZ8lB7ofiPoH7dg39zgeURgWU4AGL/xyAMBRPUbmOTGaLb94MQsU2EGXfAF7aHiLwbsFTnLhCFv5ONr7MVdUhdO/cNSBUtHJe56/rByZdtjfA= Received: from BN6PR11MB0017.namprd11.prod.outlook.com (2603:10b6:405:6c::34) by BN6PR11MB1428.namprd11.prod.outlook.com (2603:10b6:405:a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Thu, 18 Mar 2021 02:07:27 +0000 Received: from BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::31fc:8a3:8229:1619]) by BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::31fc:8a3:8229:1619%4]) with mapi id 15.20.3933.032; Thu, 18 Mar 2021 02:07:27 +0000 From: "Yang, Qiming" To: "Zhang, Qi Z" 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: AQHXGvKTmHfuczpQxkuFGvhsTcgV1qqJANkg Date: Thu, 18 Mar 2021 02:07:27 +0000 Message-ID: References: <20210317060219.2162370-1-qi.z.zhang@intel.com> In-Reply-To: <20210317060219.2162370-1-qi.z.zhang@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f231b49f-17b7-44df-89ed-08d8e9b2947d x-ms-traffictypediagnostic: BN6PR11MB1428: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3044; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yCMo16w/YC6MDfnktdrG1We6AcUszBIRjn0W40ZzTu+azBUftkJ6VumKeN+CtLicdvfoE2RYmGRaVF1BktuPUVabPWGt9EbgmAHe4lBznWmvFvqXxalpxyBvAXGiR+HbCz3mVLLgfSF1cU76cVS2OoHp8vkTxnJ2597g7h31m4OOaC8CXOYxTcUReMbhKODMUv3UduAh0Doh+lyeFBgKy1JxGZ+w1GJ3ONyl/jj/GEuX3o7QAO10/V5DSpBg8mIYQBrhr+WdoYEud8wf0PXvDvZtE1/kz/nUeKMPKsl7GLm1JDWOnDYds9Q4kHtHfffN0LVUmbCqc3+mpG+drJYtlT3U+CQuP4j9oynwvqN4yo01V7pJCmDMS+yu9ALTEdqm1R5Ks5kQPR2p+eVMoauR+f3qBzjgbLOoPbGs2jn2Qf5SE49V5TCpztAjru8UjBukqqt/7/tX7P3YQjDAq7BqntwPNzebJSJEDkZoZYIKNkN3zpdZm2dzyGJ2+STFgjC5I+5sWVOHrLeojAvSE6QgHi4v7R9kjJ8Phe5b1Z409OdR18lTNjRpSLiIcUhtvI2RW3zkGSEP+rYW2dDDttVqI/bsT+9WsHJ58NSRLK5STKVhk4VXf34Sxo703yheh7xf x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB0017.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(376002)(396003)(39860400002)(366004)(346002)(86362001)(83380400001)(316002)(33656002)(66556008)(6506007)(5660300002)(64756008)(54906003)(8676002)(6862004)(66446008)(66476007)(53546011)(52536014)(8936002)(478600001)(66946007)(7696005)(2906002)(4326008)(55016002)(6636002)(186003)(26005)(71200400001)(450100002)(76116006)(38100700001)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?I8Na+VblMePNzSH0vADpKyRMNgZtie1/GB4qrM5WaslmcE9+QvJ8b/RtYWkE?= =?us-ascii?Q?458Ws29/TiSZChbsQkvFQJ0b7h+fz4mL9mAo6g7KuIOiuZC0jETjztDB43+H?= =?us-ascii?Q?ei1m5oZ8/GW9yr1OI3nSXmm+0z8w8m8xhlRMN1SJCEFZE70pu7RZq9zXTGVW?= =?us-ascii?Q?ubErvJMAX2JiHzbr9ASFkis5THwZEYV+o0b8LzJ2iOKI5oJHVuneMD/d+fqR?= =?us-ascii?Q?XeGf8MHyyCTVc5n7nYE7X+8zYKrg66MRVlgBXVzAExjF+46F+VepUCtNS3zb?= =?us-ascii?Q?okJLWy/DzGj0Nuo/LPcgLKOjrUadNCzAUgghOUc+AfvVd+hIGBst9EAogdXW?= =?us-ascii?Q?WEJ/cFeWa9evpkE/adpdcb+LbncYX5Fe2SfL+Url5U1sML4tsFi6m20tD7wy?= =?us-ascii?Q?F7HinTI+nJ1peaDdwlBMZ4UrbkrjeCMDgWEgA5dEN0myHix7E+bvGZWXJsTX?= =?us-ascii?Q?dSTaVu+KBAcDmfg+veYG2TTYQVIxuYrhdbi2Qo8b5EhrsjZZseu2XWf7100k?= =?us-ascii?Q?a0QfMu5mxbLuMPOFj1yt5Sr0rhdbQ+4LM+i85mYj/madSBSsWghqX942s/M2?= =?us-ascii?Q?23Wkxe/l2WsXpeOpFdT+3lpJYVPcGesZF+slVo9MMX/Vr/OaKdXxVsU4RdnH?= =?us-ascii?Q?Z8BdpHavwGtPYdBzqZRl8XmGPlkFBQ+1fhYJdRNGNd1koTz5PC3D/d5b9LA0?= =?us-ascii?Q?ZuoX+EkiD5Joib4XiO8YLcAEBY6rwUjYuldWS5MkHO5ge/4W54RBpud53FKO?= =?us-ascii?Q?Ugbbf3Q+ZqawYhay88TJJqbBMQLvB3+LiIo2GBu5zlAjPfT7SmysKWT/0kgE?= =?us-ascii?Q?/QdfjGEei1OR/zy1wcyl7vn0DH6KhzzQFnjkOkcS5V4mtme3FkcD0pum66Vz?= =?us-ascii?Q?fPZQ3YC7/MqANvjBMOtE4izxaoxkvaDNtC6da/FJrlodnb6dIzFR5nbnvPOn?= =?us-ascii?Q?txHOF9ZaPaTvpxIv7DsScY1VB3PGwpHBFKV+8Re+qSZIGbkMCZdv0Ba3FrO/?= =?us-ascii?Q?2TNc5CNR4m2rCr4MmXNIFcr4E8Goemjkw/cWc6uJ763efFQnKW094ZsM3Yem?= =?us-ascii?Q?qfMxlGVAIwEsjAPO+t6twFI3T8ZXT16QI0Qhhzss8CezG+THgiv5S+FcC7nu?= =?us-ascii?Q?YdZuhuRmDezBo9fhcE6piiHXe/z8eywDnLqFTIz+jY2GUtDvTzFps8pWrc7o?= =?us-ascii?Q?KNS1TyCPQ4zd/YkGWC1VJOLSbjtkdtugI2kBhQXylh0U2fMkYPU0Z+4+3Vc9?= =?us-ascii?Q?Jn0MDzePpNXqmi+01nkjaG5k8yNCNOPBewk7WEQlVJtq0TGED3yYgVdS/deZ?= =?us-ascii?Q?e9M=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0017.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f231b49f-17b7-44df-89ed-08d8e9b2947d X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2021 02:07:27.6251 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9KJPNGEd6dne4WjUgUG97zWTWiAA2p9768hGOpn1McBp2eBAOWTAd6W9Ai8brmSZ5z/YNQAe3l7szX0+KIilfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1428 X-OriginatorOrg: intel.com 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: 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 >=20 > 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. >=20 > Fixes: f9cf4f864150 ("net/ice: support device initialization") > Cc: stable@dpdk.org >=20 > Reported-by: Ferruh Yigit > Signed-off-by: Qi Zhang > --- > drivers/net/ice/ice_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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); >=20 > 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 Acked-by: Qiming Yang