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.65, mailfrom: jiewen.yao@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Fri, 28 Jun 2019 15:14:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2019 15:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,429,1557212400"; d="scan'208";a="314260107" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 28 Jun 2019 15:14:00 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 28 Jun 2019 15:14:00 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 28 Jun 2019 15:14:00 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.33]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.236]) with mapi id 14.03.0439.000; Sat, 29 Jun 2019 06:13:58 +0800 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Kinney, Michael D" CC: "Wang, Jian J" , "Wu, Hao A" , "Ni, Ray" , "Zeng, Star" Subject: Re: [edk2-devel] [Patch] MdeModulePkg/PiSmmCore: Use unique structure signatures Thread-Topic: [edk2-devel] [Patch] MdeModulePkg/PiSmmCore: Use unique structure signatures Thread-Index: AQHVLe62FWLb6nJYq06RHySQ+eanG6axoY2Q Date: Fri, 28 Jun 2019 22:13:57 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F6D5DDE@shsmsx102.ccr.corp.intel.com> References: <20190628201836.788-1-michael.d.kinney@intel.com> In-Reply-To: <20190628201836.788-1-michael.d.kinney@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmU0ZmExYTEtNTk3Mi00NDE1LWE0ZWQtNzA4ZDhlZjUwOThmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOXZxeDE5Q2t0eGhOZmczeGJoMGRhck92RURwRzBRUVNjZEhiTGRZQ2NKQmoyTHdtXC93RU9xSmthSWQxVTlzQmsifQ== 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: jiewen.yao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Good idea to catch the issue earlier. Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Michael D Kinney > Sent: Saturday, June 29, 2019 4:19 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A > ; Ni, Ray ; Zeng, Star > ; Yao, Jiewen > Subject: [edk2-devel] [Patch] MdeModulePkg/PiSmmCore: Use unique > structure signatures >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1948 >=20 > Update the data structure signatures in the PiSmmCore > to be unique. Some of the signatures are the same as those > used by the DxeCore. For example, the memory pool head and > tail structures use the same signature in the PiSmmCore > and DxeCore. This means the use of the wrong FreePool API > will not be noticed at the time FreePool is called and a > failure can occur much later. By making the signatures > unique, misuse of an API is caught at that time the API is > called. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Star Zeng > Cc: Jiewen Yao > Signed-off-by: Michael D Kinney > --- > MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > index da01a1f07d..0908e7f4e9 100644 > --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h > @@ -2,7 +2,7 @@ > The internal header file includes the common header files, defines > internal structure and functions used by SmmCore module. >=20 > - Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. > + Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved. > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -140,7 +140,7 @@ typedef struct { > EFI_LOADED_IMAGE_PROTOCOL SmmLoadedImage; > } EFI_SMM_DRIVER_ENTRY; >=20 > -#define EFI_HANDLE_SIGNATURE SIGNATURE_32('h','n','d','l') > +#define EFI_HANDLE_SIGNATURE > SIGNATURE_32('s','h','d','l') >=20 > /// > /// IHANDLE - contains a list of protocol handles > @@ -156,7 +156,7 @@ typedef struct { >=20 > #define ASSERT_IS_HANDLE(a) ASSERT((a)->Signature =3D=3D > EFI_HANDLE_SIGNATURE) >=20 > -#define PROTOCOL_ENTRY_SIGNATURE > SIGNATURE_32('p','r','t','e') > +#define PROTOCOL_ENTRY_SIGNATURE > SIGNATURE_32('s','p','t','e') >=20 > /// > /// PROTOCOL_ENTRY - each different protocol has 1 entry in the protoco= l > @@ -175,7 +175,7 @@ typedef struct { > LIST_ENTRY Notify; > } PROTOCOL_ENTRY; >=20 > -#define PROTOCOL_INTERFACE_SIGNATURE SIGNATURE_32('p','i','f','c') > +#define PROTOCOL_INTERFACE_SIGNATURE SIGNATURE_32('s','p','i','f') >=20 > /// > /// PROTOCOL_INTERFACE - each protocol installed on a handle is tracked > @@ -195,7 +195,7 @@ typedef struct { > VOID *Interface; > } PROTOCOL_INTERFACE; >=20 > -#define PROTOCOL_NOTIFY_SIGNATURE > SIGNATURE_32('p','r','t','n') > +#define PROTOCOL_NOTIFY_SIGNATURE > SIGNATURE_32('s','p','t','n') >=20 > /// > /// PROTOCOL_NOTIFY - used for each register notification for a protoco= l > @@ -1245,7 +1245,7 @@ extern LIST_ENTRY mSmmMemoryMap; > // > #define MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1) >=20 > -#define POOL_HEAD_SIGNATURE SIGNATURE_32('p','h','d','0') > +#define POOL_HEAD_SIGNATURE SIGNATURE_32('s','p','h','d') >=20 > typedef struct { > UINT32 Signature; > @@ -1254,7 +1254,7 @@ typedef struct { > UINTN Size; > } POOL_HEADER; >=20 > -#define POOL_TAIL_SIGNATURE SIGNATURE_32('p','t','a','l') > +#define POOL_TAIL_SIGNATURE SIGNATURE_32('s','p','t','l') >=20 > typedef struct { > UINT32 Signature; > -- > 2.21.0.windows.1 >=20 >=20 >=20