From nobody Sun May 5 12:45:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43033+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43033+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1561753120; cv=none; d=zoho.com; s=zohoarc; b=ixc+frLlX/gHi1bcVMdD5YveboHRUgxZ2KMKBnivzt90pwJMb0wFXtkwk8rxW+mQsX3glVT9vYYC4mAXmirUFso8fBAb+KQKMxvsCJsSBUkL62SPCyz6KEs8j+Z1pxdTv5kxJRbArjMYHJdfD+9fuSqO9GB3FfmP4PzZ7jaU+6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561753120; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=wwa4s1x9G8W/caMm+sq4dIDLRZJK/blsj+q8EwJeZa0=; b=TJjsNGwK1k42pNh3Ec7A/isC2A04wo4kkly1j6q6Hvj8i5Jqu/MUwPp3m0ECGTlJxrHy2wxn4get5F4cRw/8qb4iLOeo0ncPVKyua2NriMc2x1OSXVmOGhyLUMI47o6fM2wNObXdczhoURmc3hUoWjoDSVrgY3qV+G7mS5tEIjA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43033+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1561753120079242.1029478541235; Fri, 28 Jun 2019 13:18:40 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Fri, 28 Jun 2019 13:18:38 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2019 13:18:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,428,1557212400"; d="scan'208";a="156672164" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga008.jf.intel.com with ESMTP; 28 Jun 2019 13:18:38 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Jiewen Yao Subject: [edk2-devel] [Patch] MdeModulePkg/PiSmmCore: Use unique structure signatures Date: Fri, 28 Jun 2019 13:18:36 -0700 Message-Id: <20190628201836.788-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1561753119; bh=xfqZtZGH1bCGOjkTt8c7TXbIf7vep5Y4UV500u4wRdU=; h=Cc:Date:From:Reply-To:Subject:To; b=nwJRZ8NHSP25lOvY9i7bnOJbi9+E6KxdWt32Nqimv1zCl2DPowcDCZw4L8/vw86RZZd pDJnoRVd8WXScjVHSXvilVDyvXYS0lnM3f+/pyKSN28QGT1+o88jAAt8kTOrOL5fLuIXK 5BQHZiXe1v0hOjB7tVvbIXLOWlrJaWMfC+o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D1948 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. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Jiewen Yao Signed-off-by: Michael D Kinney Reviewed-by: Jian J Wang Reviewed-by: Jiewen.yao@intel.com Reviewed-by: Ray Ni --- MdeModulePkg/Core/PiSmmCore/PiSmmCore.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.h b/MdeModulePkg/Core/Pi= SmmCore/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_SIGNA= TURE) =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 protocol @@ -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 protocol @@ -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; --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43033): https://edk2.groups.io/g/devel/message/43033 Mute This Topic: https://groups.io/mt/32245778/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-