From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: rangasai.v.chaganty@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Mon, 26 Aug 2019 16:41:18 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Aug 2019 16:41:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,435,1559545200"; d="scan'208";a="204755797" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 26 Aug 2019 16:41:16 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 26 Aug 2019 16:41:16 -0700 Received: from fmsmsx104.amr.corp.intel.com ([169.254.3.2]) by fmsmsx116.amr.corp.intel.com ([169.254.2.181]) with mapi id 14.03.0439.000; Mon, 26 Aug 2019 16:41:16 -0700 From: "Chaganty, Rangasai V" To: "Kubacki, Michael A" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/IntelVTdDxe: Fix NULL pointer dereference Thread-Topic: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/IntelVTdDxe: Fix NULL pointer dereference Thread-Index: AQHVWic8RDlAqBrKKU2c/4eqmCOwWKcOGs2g Date: Mon, 26 Aug 2019 23:41:15 +0000 Message-ID: References: <20190824025411.1192-1-michael.a.kubacki@intel.com> In-Reply-To: <20190824025411.1192-1-michael.a.kubacki@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDkzYmZmNDItMTQwYi00OTBlLTllYTctN2QyMTY2N2EzZjUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVXNyeVkwSDRNWm84T2RBSDB3TU1yZFZrZlVQMHVENDRQY1AxSFJ6ZXhWZHlxV001WUVBbDJEczFIclNOV1ZSNSJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Return-Path: rangasai.v.chaganty@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty -----Original Message----- From: Kubacki, Michael A=20 Sent: Friday, August 23, 2019 7:54 PM To: devel@edk2.groups.io Cc: Ni, Ray ; Chaganty, Rangasai V Subject: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/IntelVTdDxe: Fix NU= LL pointer dereference REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2116 Cc: Ray Ni Cc: Rangasai V Chaganty Signed-off-by: Michael Kubacki --- Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c | 19= +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProte= ction.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtecti= on.c index 956ebb2d3d..9b6135ef94 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtectio +++ n.c @@ -158,10 +158,13 @@ ProcessRequestedAccessAttribute ( } =20 /** - return the UEFI memory information. + Return UEFI memory map information. + + @param[out] Below4GMemoryLimit The below 4GiB memory limit address or 0= if insufficient resources exist to + determine the address. + @param[out] Above4GMemoryLimit The above 4GiB memory limit address or 0= if insufficient resources exist to + determine the address. =20 - @param[out] Below4GMemoryLimit The below 4GiB memory limit - @param[out] Above4GMemoryLimit The above 4GiB memory limit **/ VOID = ReturnUefiMemoryMap ( @@ -206,7 +209,11 @@ ReturnUefiMemoryMap ( // we process bogus entries and create bogus E820 entries. // EfiMemoryMap =3D (EFI_MEMORY_DESCRIPTOR *) AllocatePool (EfiMemoryMapS= ize); - ASSERT (EfiMemoryMap !=3D NULL); + if (EfiMemoryMap =3D=3D NULL) { + ASSERT (EfiMemoryMap !=3D NULL); + return; + } + Status =3D gBS->GetMemoryMap ( &EfiMemoryMapSize, EfiMemoryMap, @@ -218,7 +225,6 @@ ReturnUefiMemoryMap ( FreePool (EfiMemoryMap); } } while (Status =3D=3D EFI_BUFFER_TOO_SMALL); - ASSERT_EFI_ERROR (Status); =20 // @@ -242,9 +248,6 @@ ReturnUefiMemoryMap ( NextEfiEntry =3D NEXT_MEMORY_DESCRIPTOR (EfiEntry, EfiDescriptorSize)= ; } =20 - // - // - // DEBUG ((DEBUG_INFO, "MemoryMap:\n")); EfiEntry =3D EfiMemoryMap; EfiMemoryMapEnd =3D (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) EfiMemoryMap + = EfiMemoryMapSize); -- 2.16.2.windows.1