From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@dell.com header.s=smtpout1 header.b=HRFJRN9e; spf=pass (domain: dell.com, ip: 148.163.133.20, mailfrom: jayanth.raghuram@dell.com) Received: from mx0a-00154904.pphosted.com (mx0a-00154904.pphosted.com [148.163.133.20]) by groups.io with SMTP; Thu, 29 Aug 2019 09:32:07 -0700 Received: from pps.filterd (m0170389.ppops.net [127.0.0.1]) by mx0a-00154904.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7TCOR4P024640 for ; Thu, 29 Aug 2019 12:32:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dell.com; h=from : to : subject : date : message-id : content-type : mime-version; s=smtpout1; bh=kM9U7XhZ+IhpLo5ngJGHqvu4rsdL2IOp/RxHf8BtkoY=; b=HRFJRN9eEShnNje26zsTLhFJjBSeRawWqFYAs66SntSTCGAx7RXBtF8wOHlnQ+2ttK5R 7l8Xs6dPAu9/wcDd7ZaFb0G0sXqEi5seOkJCax3SgWfMtoLaayVKueyf9grXGSbiGzyE tsVsCGexhVxnvuC7LMUbnBv7ZP1M603YC2WjKo/yDEWWpgsZgjAIMC1UUXsvoMRFRD0e 0cw843VlXMEkubF6/f90WQAVorosy0/Yu5LxbcXyIbh6YTORtRrrhNrUXJwvWfillNUA m2zhsCB89pfuMDObCE71768+UBa22rwOfp5TGPPtsxCAbA/XP/Q5jLypH9tXn5IiRkRA 8g== Received: from mx0b-00154901.pphosted.com (mx0b-00154901.pphosted.com [67.231.157.37]) by mx0a-00154904.pphosted.com with ESMTP id 2uk2fxyd3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 29 Aug 2019 12:32:05 -0400 Received: from pps.filterd (m0144102.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7TCZgdA124304 for ; Thu, 29 Aug 2019 12:32:05 -0400 Received: from ausxipps310.us.dell.com (AUSXIPPS310.us.dell.com [143.166.148.211]) by mx0b-00154901.pphosted.com with ESMTP id 2unqv83c94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 29 Aug 2019 12:32:04 -0400 X-LoopCount0: from 10.166.135.142 X-PREM-Routing: D-Outbound X-IronPort-AV: E=Sophos;i="5.60,349,1549951200"; d="scan'208,217";a="415248984" From: To: Subject: 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/SKqgCaNBx6H93A== Date: Thu, 29 Aug 2019 16:32:03 +0000 Message-ID: <375c3f4c7c874a8d8989a8d57dd9e575@ausx13mps324.AMER.DELL.COM> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Enabled=True; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Owner=Jayanth_Raghuram@Dell.com; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SetDate=2019-08-29T16:24:35.3685291Z; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Name=External Public; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Application=Microsoft Azure Information Protection; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Extended_MSFT_Method=Manual; aiplabel=External Public x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [143.166.24.60] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-28_04:2019-08-28,2019-08-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 phishscore=0 impostorscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 adultscore=0 clxscore=1015 malwarescore=0 mlxlogscore=813 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1908280111 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 malwarescore=0 impostorscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=976 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1908240102 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_375c3f4c7c874a8d8989a8d57dd9e575ausx13mps324AMERDELLCOM_" --_000_375c3f4c7c874a8d8989a8d57dd9e575ausx13mps324AMERDELLCOM_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Liming, per your recommendation, Please review the below [PATCH v2] and the commit can be found in: git@gith= ub.com:JayRaghuram/edk2.git (ht= tps://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.Jayant= h_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 handli= ng. 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/DxeHstiLi= b/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) || (InfoTypesB= ufferCount =3D=3D 0)) { continue; } -- 2.19.1.windows.1 ________________________________ Regards Jayanth Raghuram DellEMC | Server Platform BIOS office + 1 512 723 1470 --_000_375c3f4c7c874a8d8989a8d57dd9e575ausx13mps324AMERDELLCOM_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Liming,

per your recommendation,

 

Please review the below [PATCH v2] and the commit ca= n be found in: git@github.com:JayRa= ghuram/edk2.git (https:= //github.com/JayRaghuram/edk2)

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


From 95c48454d6d14cb7537dec98d58f7dc01efa644e Mon Se= p 17 00:00:00 2001

Message-Id: <95c48454d6d14cb7537dec98d58f7dc01efa= 644e.1567095734.git.Jayanth_Raghuram@Dell.com>

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

Date: Thu, 29 Aug 2019 11:17:09 -0500

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

 

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

 

Added checks for return parameters of GetSupportedTy= pes

function calls in InternalHstiFindAip to improve err= or handling.

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

PERC H740P controller UEFI driver returned InfoTypes= Buffer =3D NULL,

InfoTypesBufferCount =3D 0 and caused an FreePool as= sert.

 

Signed-off-by: Jayanth Raghuram <Jayanth.Raghuram= @Dell.com>

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

---

MdePkg/Library/DxeHstiLib/HstiDxe.c | 2 +-<= /o:p>

1 file changed, 1 insertion(+), 1 deletion(-)

 

diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/M= dePkg/Library/DxeHstiLib/HstiDxe.c

index 9466e3dcb3..4e1c67616b 100644

--- a/MdePkg/Library/DxeHstiLib/HstiDxe.c=

+++ b/MdePkg/Library/DxeHstiLib/HstiDxe.= c

@@ -77,7 +77,7 @@ InternalHstiFindAip (

        &nbs= p;            &I= nfoTypesBuffer,

        &nbs= p;            &I= nfoTypesBufferCount

        &nbs= p;            );

-    if (EFI_ERROR (Status)) {

+    if (EFI_ERROR (Status) || (I= nfoTypesBuffer =3D=3D NULL) || (InfoTypesBufferCount =3D=3D 0)) {

       continue;<= /o:p>

     }

--

2.19.1.windows.1


 

Regards

Jayanth Raghuram<= /o:p>

DellEMC | Server Platform BIOS

office + 1 512 723 1470

 

--_000_375c3f4c7c874a8d8989a8d57dd9e575ausx13mps324AMERDELLCOM_--