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.151, mailfrom: liming.gao@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Sun, 01 Sep 2019 21:15:10 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Sep 2019 21:15:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,457,1559545200"; d="scan'208,217";a="206704938" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2019 21:15:09 -0700 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 1 Sep 2019 21:15:09 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 1 Sep 2019 21:15:09 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.146]) with mapi id 14.03.0439.000; Mon, 2 Sep 2019 12:15:07 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Jayanth.Raghuram@dell.com" Subject: Re: Subject: [PATCH v2] MdePkg/DxeHstiLib: Added checks to improve error handling. Thread-Topic: Subject: [PATCH v2] MdePkg/DxeHstiLib: Added checks to improve error handling. Thread-Index: AdVehjHw++tTtEy/SKqgCaNBx6H93ACvsHsw Date: Mon, 2 Sep 2019 04:15:07 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0257@SHSMSX104.ccr.corp.intel.com> References: <375c3f4c7c874a8d8989a8d57dd9e575@ausx13mps324.AMER.DELL.COM> In-Reply-To: <375c3f4c7c874a8d8989a8d57dd9e575@ausx13mps324.AMER.DELL.COM> 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_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0257SHSMSX104ccrcor_" --_000_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0257SHSMSX104ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This change is good to me. Reviewed-by: Liming Gao From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Jaya= nth.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_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0257SHSMSX104ccrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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

 

From: devel@edk2.groups.io [mai= lto: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, <= /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_4A89E2EF3DFEDB4C8BFDE51014F606A14E4F0257SHSMSX104ccrcor_--