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: shenglei.zhang@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Thu, 19 Sep 2019 08:21:34 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 08:21:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,523,1559545200"; d="scan'208";a="186833920" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 19 Sep 2019 08:21:33 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 08:21:33 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 08:21:33 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.86]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Thu, 19 Sep 2019 23:21:30 +0800 From: "Zhang, Shenglei" To: "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: Add check for pointers Thread-Topic: [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: Add check for pointers Thread-Index: AQHVbsFlskcLTuz560SDhuMMpirl7KcyupjwgABjlfA= Date: Thu, 19 Sep 2019 15:21:30 +0000 Message-ID: References: <20190919080810.50168-1-shenglei.zhang@intel.com> <3C3EFB470A303B4AB093197B6777CCEC504D3383@PGSMSX111.gar.corp.intel.com> In-Reply-To: <3C3EFB470A303B4AB093197B6777CCEC504D3383@PGSMSX111.gar.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzc2MzA2MWUtYTE3MC00NjU2LTlkZTgtNGVlMTc4YTQ1YjVhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNEh1c2NYclAyd2hxekt0MTBEaTNYcFVQMDByM1NZZEgwdXRsdUloajJuRWF0QVNDR2tYWE80XC9RUVZLOXAra0gifQ== x-ctpclassification: CTP_NT 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: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable OK I'll update that then. Thanks, Shenglei > -----Original Message----- > From: Chiu, Chasel > Sent: Thursday, September 19, 2019 5:27 PM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Kubacki, Michael A ; Desimone, Nathaniel= L > ; Gao, Liming > Subject: RE: [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: > Add check for pointers >=20 >=20 > Please update commit message as the latest change does not return > EFI_NOT_FOUND in DxeCheckBootVariable.c. > With above updated, Reviewed-by: Chasel Chiu >=20 >=20 > > -----Original Message----- > > From: Zhang, Shenglei > > Sent: Thursday, September 19, 2019 4:08 PM > > To: devel@edk2.groups.io > > Cc: Kubacki, Michael A ; Chiu, Chasel > > ; Desimone, Nathaniel L > > ; Gao, Liming > > Subject: [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: Ad= d > > check for pointers > > > > In DxeCheckBootVariable.c, add check for BootOrder and Variable that > > return EFI_NOT_FOUND when they are NULL. > > In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when > > allocating memory to what it points to. > > > > Cc: Michael Kubacki > > Cc: Chasel Chiu > > Cc: Nate DeSimone > > Cc: Liming Gao > > Signed-off-by: Shenglei Zhang > > --- > > > > v2: Update copyright > > > > v3: Fix the coding style. > > > > v4: Update the logic in DxeCheckBootVariable.c. > > We directly return when BootOrder/Variable =3D=3D NULL, in previous ver= sions. > > > > v5: Update the format of copyright and the coding style. > > > > .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 6 +++--- > > .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 8 +++++--- > > 2 files changed, 8 insertions(+), 6 deletions(-) > > > > diff --git > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= B > > ootVariable.c > > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= B > > ootVariable.c > > index 85bd5b3d..5437cf6a 100644 > > --- > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= B > > ootVariable.c > > +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeC= h > > +++ eckBootVariable.c > > @@ -1,6 +1,6 @@ > > /** @file > > > > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> > +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -130,7 +130,7 @@ TestPointCheckLoadOptionVariable ( > > for (ListIndex =3D 0; ListIndex < > > sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); > > ListIndex++) { > > UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", > > mLoadOptionVariableList[ListIndex]); > > Status =3D GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, > > (VOID **)&BootOrder, &OrderSize); > > - if (EFI_ERROR(Status)) { > > + if (EFI_ERROR(Status) || (BootOrder =3D=3D NULL)) { > > continue; > > } > > for (Index =3D 0; Index < OrderSize/sizeof(CHAR16); Index++) { @@ > -222,7 > > +222,7 @@ TestPointCheckKeyOptionVariable ( > > for (Index =3D 0; ; Index++) { > > UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), > L"%s%04x", > > mKeyOptionVariableList[ListIndex], Index); > > Status =3D GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, > > &Variable, &Size); > > - if (!EFI_ERROR(Status)) { > > + if (!EFI_ERROR(Status) && (Variable !=3D NULL)) { > > DumpKeyOption (KeyOptionName, Variable, Size); > > } else { > > break; > > diff --git > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= G > > cd.c > > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= G > > cd.c > > index 82709d44..066121c7 100644 > > --- > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= G > > cd.c > > +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeC= h > > +++ eckGcd.c > > @@ -1,6 +1,6 @@ > > /** @file > > > > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> > +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -241,11 +241,13 @@ TestPointDumpGcd ( > > } > > } > > if (GcdMemoryMap !=3D NULL) { > > - *GcdIoMap =3D AllocateCopyPool (NumberOfDescriptors * > > sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); > > + if (GcdIoMap !=3D NULL) { > > + *GcdIoMap =3D AllocateCopyPool (NumberOfDescriptors * > > sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); > > + } > > *GcdIoMapNumberOfDescriptors =3D NumberOfDescriptors; > > } > > } > > - > > + > > if (DumpPrint) { > > DEBUG ((DEBUG_INFO, "=3D=3D=3D=3D TestPointDumpGcd - Exit\n")); > > } > > -- > > 2.18.0.windows.1