From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 02 Sep 2019 07:45:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 07:44:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,459,1559545200"; d="scan'208,217";a="357497650" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 02 Sep 2019 07:44:42 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Sep 2019 07:44:42 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.140]) with mapi id 14.03.0439.000; Mon, 2 Sep 2019 22:44:40 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Gao, Liming" , "Jayanth.Raghuram@dell.com" Subject: Re: [edk2-devel] Subject: [PATCH v2] MdePkg/DxeHstiLib: Added checks to improve error handling. Thread-Topic: [edk2-devel] Subject: [PATCH v2] MdePkg/DxeHstiLib: Added checks to improve error handling. Thread-Index: AdVehjHw++tTtEy/SKqgCaNBx6H93ACvsHswABX9v3A= Date: Mon, 2 Sep 2019 14:44:39 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0685@SHSMSX104.ccr.corp.intel.com> References: <375c3f4c7c874a8d8989a8d57dd9e575@ausx13mps324.AMER.DELL.COM> <15C083E9BA6B755C.32459@groups.io> In-Reply-To: <15C083E9BA6B755C.32459@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDY5NzEwOWEtZTBhNy00NjNlLWI0YjAtMzEzODU3NGJkNDk5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaWEwZ1RTUXpjOEorZ2tDNGdrR05WT3RuSm14em5xK0J1aWZHY29Obk8xbFJZTXZLczR2dnI4QUhlYlgyOEpxZSJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0685SHSMSX104ccrcor_" --_000_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0685SHSMSX104ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Push @17f8c9e97d770c74f84194576bcd97322fbed21e From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Limi= ng Gao Sent: Monday, September 2, 2019 12:15 PM To: devel@edk2.groups.io; Jayanth.Raghuram@dell.com Subject: Re: [edk2-devel] Subject: [PATCH v2] MdePkg/DxeHstiLib: Added che= cks to improve error handling. This change is good to me. Reviewed-by: Liming Gao > From: devel@edk2.groups.io [mailto:devel@edk2= .groups.io] On Behalf Of Jayanth.Raghuram@dell.com Sent: Friday, August 30, 2019 12:32 AM To: devel@edk2.groups.io Subject: [edk2-devel] Subject: [PATCH v2] MdePkg/DxeHstiLib: Added checks = to improve error handling. Hi Liming, per your recommendation, Please review the below [PATCH v2] and the commit can be found in: git@git= hub.com:JayRaghuram/edk2.git (h= ttps://github.com/JayRaghuram/edk2) REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2138 ________________________________ >>From 95c48454d6d14cb7537dec98d58f7dc01efa644e Mon Sep 17 00:00:00 2001 Message-Id: <95c48454d6d14cb7537dec98d58f7dc01efa644e.1567095734.git.Jayan= th_Raghuram@Dell.com> From: Jayanth Raghuram > Date: Thu, 29 Aug 2019 11:17:09 -0500 Subject: [PATCH v2] MdePkg/DxeHstiLib: Added checks to improve error handl= ing. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2138 Added checks for return parameters of GetSupportedTypes function calls in InternalHstiFindAip to improve error handling. An issue was observed on Dell Poweredge R740, where the Dell PERC H740P controller UEFI driver returned InfoTypesBuffer =3D NULL, InfoTypesBufferCount =3D 0 and caused an FreePool assert. Signed-off-by: Jayanth Raghuram > Cc: Wei G Liu > --- MdePkg/Library/DxeHstiLib/HstiDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiL= ib/HstiDxe.c index 9466e3dcb3..4e1c67616b 100644 --- a/MdePkg/Library/DxeHstiLib/HstiDxe.c +++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c @@ -77,7 +77,7 @@ InternalHstiFindAip ( &InfoTypesBuffer, &InfoTypesBufferCount ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status) || (InfoTypesBuffer =3D=3D NULL) || (InfoTypes= BufferCount =3D=3D 0)) { continue; } -- 2.19.1.windows.1 ________________________________ Regards Jayanth Raghuram DellEMC | Server Platform BIOS office + 1 512 723 1470 --_000_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0685SHSMSX104ccrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Push @17f8c9e97d770c74f84194576bcd97322fbed21e

 

From: devel@edk2.groups.io [mai= lto:devel@edk2.groups.io] On Behalf Of Liming Gao
Sent: Monday, September 2, 2019 12:15 PM
To: devel@edk2.groups.io; Jayanth.Raghuram@dell.com
Subject: Re: [edk2-devel] Subject: [PATCH v2] MdePkg/DxeHstiLib: Ad= ded checks to improve error handling.

 

This change is good to me. Reviewed-by: Liming Gao <liming.gao@intel.com>

 

 

Hi Liming, <= /p>

per your recommendation,<= /o:p>

 

Please review the below [PATCH= v2] and the commit can be found in: git@github.com:JayR= aghuram/edk2.git (https= ://github.com/JayRaghuram/edk2)

REF:https://bugzilla.tianocore= .org/show_bug.cgi?id=3D2138


From 95c48454d6d14cb7537dec98d= 58f7dc01efa644e Mon Sep 17 00:00:00 2001

Message-Id: <95c48454d6d14cb7537dec98d58f7dc01efa644e.1567095734.git.Jayanth= _Raghuram@Dell.com>

From: Jayanth Raghuram <Jayanth_Raghuram@Dell.com>=

Date: Thu, 29 Aug 2019 11:17:0= 9 -0500

Subject: [PATCH v2] MdePkg/Dxe= HstiLib: Added checks to improve error handling.

 

REF:https://bugzilla.tianocore= .org/show_bug.cgi?id=3D2138

 

Added checks for return parame= ters of GetSupportedTypes

function calls in InternalHsti= FindAip to improve error handling.

An issue was observed on Dell = Poweredge R740, where the Dell

PERC H740P controller UEFI dri= ver returned InfoTypesBuffer =3D NULL,

InfoTypesBufferCount =3D 0 and= caused an FreePool assert.

 

Signed-off-by: Jayanth Raghura= m <Jayanth.Raghuram@Dell.co= m>

Cc: Wei G Liu <Wei_G_Liu@Dell.com>

---

MdePkg/Library/DxeHstiLib/Hsti= Dxe.c | 2 +-

1 file changed, 1 insertion(&#= 43;), 1 deletion(-)

 

diff --git a/MdePkg/Library/Dx= eHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c<= /p>

index 9466e3dcb3..4e1c67616b 1= 00644

--- a/MdePkg/Library/DxeHstiLi= b/HstiDxe.c

+++ b/MdePkg/Libra= ry/DxeHstiLib/HstiDxe.c

@@ -77,7 +77,7 @@ Internal= HstiFindAip (

     =             &nb= sp;   &InfoTypesBuffer,

     =             &nb= sp;   &InfoTypesBufferCount

     =             &nb= sp;   );

-    if (EFI_ER= ROR (Status)) {

+    if (EF= I_ERROR (Status) || (InfoTypesBuffer =3D=3D NULL) || (InfoTypesBufferCount = = =3D=3D 0)) {

     =   continue;

     }

 

--

2.19.1.windows.1


 

Regard= s

Jayant= h Raghuram

DellEMC | Server Platform BIOS

office<= /b> + 1 512 723 1470

 

--_000_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0685SHSMSX104ccrcor_--