From nobody Mon May 6 04:41:14 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+44088+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+44088+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563771171; cv=none; d=zoho.com; s=zohoarc; b=P0UP+G7pukrHR9L5PucZ1HjGMP6au8USOjncfePTZz2fL8+1WSKFcJYVuf6UNf3y/nQi+fyOQwVgYjXeEcQvTWdYMPgZ0VdwBodk5iB7lbca3ULaVuhQWfWU2aKICfijlhqkB0xH0rm45IN5CxBoEgZVy9apAvZOmPVcjplL6pI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563771171; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=Rg1Ymj+YLGgpRbi0pZQxZqkC7VUhBJ6IF2yxlaBlNu8=; b=Xj++dQ34fi9aV38tGsHNH3GH7Gj1dRRGK1Gx3CUKmxf23SbDlfmjNhoPXmrZTQoZW9BEZUckilE/6LH3nw12YinxK/NDo8hWuWIgbBb9WB7qicEQdWG75clUy+qVRd2GHYjdse8vVRiGbj4uErjHHFEcWaqgHbZCXcA50FkAzo4= 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+44088+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 1563771171863375.52750746419315; Sun, 21 Jul 2019 21:52:51 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Sun, 21 Jul 2019 21:52:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 21:52:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,293,1559545200"; d="scan'208";a="188527046" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2019 21:52:49 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner Subject: [edk2-devel] [PATCH 1/5] MdeModulePkg: Add header file for SecurityLockAuditLib Date: Mon, 22 Jul 2019 12:02:00 +0800 Message-Id: <20190722040204.33108-2-zhichao.gao@intel.com> In-Reply-To: <20190722040204.33108-1-zhichao.gao@intel.com> References: <20190722040204.33108-1-zhichao.gao@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,zhichao.gao@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=1563771171; bh=flojFAUfOaaZv2aFuJR53+grlYkNVcIHb+fLXM1TMm0=; h=Cc:Date:From:Reply-To:Subject:To; b=mvRm5c1Uubmqk9LJBnr9vdN9is46F6dyKUkQTN/QeI2lupS9rArWvQgbcQGojCp184+ uGfr+KfjPuGcDIwPm1sawsRi+1FIZ951TKrgmKAsdNWNhAuOgj0zrd3UOiu2mTNe8NuXU 0165vusMcqXSB7Dtxmvaw81AKRJQY1YE+as= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2006 Add header file for SecurityLockAuditLib and add its file path to dec file. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- .../Include/Library/SecurityLockAuditLib.h | 47 +++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 4 ++ 2 files changed, 51 insertions(+) create mode 100644 MdeModulePkg/Include/Library/SecurityLockAuditLib.h diff --git a/MdeModulePkg/Include/Library/SecurityLockAuditLib.h b/MdeModul= ePkg/Include/Library/SecurityLockAuditLib.h new file mode 100644 index 0000000000..db3b145aba --- /dev/null +++ b/MdeModulePkg/Include/Library/SecurityLockAuditLib.h @@ -0,0 +1,47 @@ +/** @file + + This library implements the necessary functions + to log hardware and software security locks for post-processing + + Copyright (c) 2018, Microsoft Corporation + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __SECURITY_LOCK_LIB_H__ +#define __SECURITY_LOCK_LIB_H__ + + +#define SECURITY_LOCK_REPORT_EVENT(LockMessage,LockType) \ + SecurityLockReportEvent (&gEfiCallerIdGuid, __FUNCTION__, LockMessag= e, LockType); + +/** + Enum to hold the various lock types for use in post-processing + +**/ +typedef enum { + SOFTWARE_LOCK =3D 0, + HARDWARE_LOCK, +} LOCK_TYPE; + + +/** + Function for security Lock event logging and reporting + + @param[in] Module GUID of calling module + @param[in] Function Name of calling function + @param[in] LockEventText Event text explaining what is locked + @param[in] LockType Enumerated lock type for differentia= tion + +**/ +VOID +EFIAPI +SecurityLockReportEvent ( + IN GUID *Module, + IN CONST CHAR8 *Function, + IN CONST CHAR8 *LockEventText, + IN LOCK_TYPE LockType + ); + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 12e0bbf579..ee2828dd8e 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -153,6 +153,10 @@ # DisplayUpdateProgressLib|Include/Library/DisplayUpdateProgressLib.h =20 + ## @libraryclass Provides a way for logging security locks + # + SecurityLockAuditLib|Include/Library/SecurityLockAuditLib.h + [Guids] ## MdeModule package token space guid # Include/Guid/MdeModulePkgTokenSpace.h --=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 (#44088): https://edk2.groups.io/g/devel/message/44088 Mute This Topic: https://groups.io/mt/32555405/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- From nobody Mon May 6 04:41:14 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+44089+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+44089+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563771173; cv=none; d=zoho.com; s=zohoarc; b=RLiTo4pgI8eVGvi91DUSHQJh+2Qp7bpD556SAFBv/p1JHHbqP1LuXLT8J+4J4EoVw6l7LaN4KVmFHpvDGqBX4XMcpCYsZlxMqgfCedkW4PWAww9achEb7Xkbc1z4g+7bf58g/uzhYOVgh/dtO4hndTxjPXBGcuJkVln9xPgyzo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563771173; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=iMzHsD28S7Uz0HSvlIP79rnYYzCA+gRfPkwz8Tywcg8=; b=Fya9CW7zOILQ+xYSrIEnK7fktLoZAbgiY8ZhAhVN6t3AWotNRhlOS/vjA/alRNwNdczaCQ14twh3Y144v8mUBhRQnt0YpphZGsCZpJXZ1piK1BMcFPvT72BE1WNy/28jta89FG0DOim+OCq/ZYwDPTZc2OQwKZwYh9msNwdvt3E= 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+44089+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 1563771173613627.5365695103839; Sun, 21 Jul 2019 21:52:53 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Sun, 21 Jul 2019 21:52:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 21:52:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,293,1559545200"; d="scan'208";a="188527051" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2019 21:52:51 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner Subject: [edk2-devel] [PATCH 2/5] MdeModulePkg/SecurityLockAuditDebugLib: Add lib instance Date: Mon, 22 Jul 2019 12:02:01 +0800 Message-Id: <20190722040204.33108-3-zhichao.gao@intel.com> In-Reply-To: <20190722040204.33108-1-zhichao.gao@intel.com> References: <20190722040204.33108-1-zhichao.gao@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,zhichao.gao@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=1563771173; bh=XOCZHGxZj6n3X8zQSC4XUEJL/kAa5ukROSDIjt/bSTU=; h=Cc:Date:From:Reply-To:Subject:To; b=dGUhx9bY6kxnVzJoBw8yW36H3GdatfrL/Q/IskWlHNNC7d++oxL3/Blo5uy0mf52F7Z ug03u2j3irTb10Sfs7YxWRDgieMhWt1AJeytjIgSboImBNUu5F1ViAyR1kFctTNqY0K6V 67ye/cfGIuv/EJ8UeUF4MBWGtMFbcV8QOAA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2006 Add the instance of SecurityLockAuditLib. This instance has one interface SecurityLockReportEvent to log hardware and software security locks info. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- .../SecurityLockAuditDebugLib.c | 53 +++++++++++++++++++ .../SecurityLockAuditDebugLib.inf | 29 ++++++++++ 2 files changed, 82 insertions(+) create mode 100644 MdeModulePkg/Library/SecurityLockAuditDebugLib/Security= LockAuditDebugLib.c create mode 100644 MdeModulePkg/Library/SecurityLockAuditDebugLib/Security= LockAuditDebugLib.inf diff --git a/MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLockAud= itDebugLib.c b/MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLockA= uditDebugLib.c new file mode 100644 index 0000000000..c1872bc023 --- /dev/null +++ b/MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLockAuditDebug= Lib.c @@ -0,0 +1,53 @@ +/** @file + This library implements the necessary functions + to log hardware and software security locks for post-processing + + Copyright (c) 2018, Microsoft Corporation + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +// +// Used to look up lock name from LOCK_TYPE enum +// +CHAR8* mLockName[] =3D { + "SOFTWARE_LOCK", + "HARDWARE_LOCK" +}; + + +/** + Function for security Lock event logging and reporting + + @param[in] Module GUID of calling module + @param[in] Function Name of calling function + @param[in] LockEventText Debug message explaining what is loc= ked + @param[in] LockType Enumerated lock type for differentia= tion + +**/ +VOID +EFIAPI +SecurityLockReportEvent ( + IN GUID *Module, + IN CONST CHAR8 *Function, + IN CONST CHAR8 *LockEventText, + IN LOCK_TYPE LockType + ) +{ + UINTN LockTypeIndex; + UINTN LockNameCount; + + LockTypeIndex =3D (UINTN)LockType; + LockNameCount =3D sizeof (mLockName) / sizeof (mLockName[0]); + + if (LockTypeIndex < LockNameCount) { + DEBUG ((DEBUG_ERROR, "SecurityLock::LockType: %a, Module: %g, Function= : %a, Output: %a\n", mLockName[LockTypeIndex], Module, Function, LockEventT= ext)); + } else { + DEBUG ((DEBUG_ERROR, "SecurityLock::LockType: %d, Module: %g, Function= : %a, Output: %a\n", LockType, Module, Function, LockEventText)); + } +} diff --git a/MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLockAud= itDebugLib.inf b/MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLoc= kAuditDebugLib.inf new file mode 100644 index 0000000000..b641016087 --- /dev/null +++ b/MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLockAuditDebug= Lib.inf @@ -0,0 +1,29 @@ +## @file +# +# Library that implements logging and reporting for security locks +# Using DebugLib +# +# +# Copyright (c) 2018, Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SecurityLockAuditDebugLib + FILE_GUID =3D 459d0456-d6be-458e-9cc8-e9b21745f9aa + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SecurityLockAuditLib + +[Sources.common] + SecurityLockAuditDebugLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + BaseLib + DebugLib --=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 (#44089): https://edk2.groups.io/g/devel/message/44089 Mute This Topic: https://groups.io/mt/32555407/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- From nobody Mon May 6 04:41:14 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+44090+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+44090+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563771175; cv=none; d=zoho.com; s=zohoarc; b=cytuX/VvyNMzv5PEnd2W+JLnkTOAusCNxog3YGQ6RsRpYqrzoWlkWbcntoJN/Jt+LgCbBbhqw9GutoYSPuBoFbj/z8IpXGVuX6f125nm5p+e8nveFpNRc15zvNH25FwJg5ynnNmXfOXmVG/PLxMGvEpm74ibULdCKRr81/9UCoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563771175; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=Fd6N1GFes+7DTUa1+1iHQgT2V86ETqps0CrqFRci/pA=; b=FCf2ZK2JS3A06e/bBaj38u3RyGbDz9SvpqHsGa5YCdM/da8tXx/a/CIN8LJOvfoy3b7TcZqJIhQaouPl34Rc6y8VOeS17ARg60s9Oc1NZD2AvNRx3ysAdB6L/xQrI+ijc6DCMAFynzCrGdaQtMdqDH1i1dt20dGcZ2LM6GNRvEc= 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+44090+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 156377117525898.50329134692879; Sun, 21 Jul 2019 21:52:55 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Sun, 21 Jul 2019 21:52:54 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 21:52:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,293,1559545200"; d="scan'208";a="188527056" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2019 21:52:52 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner Subject: [edk2-devel] [PATCH 3/5] MdeModulePkg/SecurityLockAuditLibNull: Add null version lib Date: Mon, 22 Jul 2019 12:02:02 +0800 Message-Id: <20190722040204.33108-4-zhichao.gao@intel.com> In-Reply-To: <20190722040204.33108-1-zhichao.gao@intel.com> References: <20190722040204.33108-1-zhichao.gao@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,zhichao.gao@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=1563771174; bh=17Vic4qhJGX8HZMHpUFqIPevt07eg7D+oYTZ1OODa5I=; h=Cc:Date:From:Reply-To:Subject:To; b=eUAOv0F5zqjDpLE4WRqDO7hxYmmezESqSw6odYfEa5isQT0dgEgOIDEina+PDSwdNRO wx5d8hd+AZdejr1uEao0dmL0WEPNC5uY5mg4H2bPPD0vq6+kwIDbgEOfDuWp5qbYNidpo Z6Y11YH2Kaq2NkfV2irV0iDBAJ2x1nHeB7c= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2006 Add a null version library instance of SecurityLockAuditLib. It provides the new API SecurityLockReportEvent without any function. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- .../SecurityLockAuditLibNull.c | 32 +++++++++++++++++++ .../SecurityLockAuditLibNull.inf | 27 ++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityL= ockAuditLibNull.c create mode 100644 MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityL= ockAuditLibNull.inf diff --git a/MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAudi= tLibNull.c b/MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAudi= tLibNull.c new file mode 100644 index 0000000000..47a26684d3 --- /dev/null +++ b/MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAuditLibNul= l.c @@ -0,0 +1,32 @@ +/** @file + + Null library for security lock logging that does nothing but meet compil= e requirements + + Copyright (c) 2018, Microsoft Corporation + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + Null function for security Lock event logging and reporting + + @param[in] Module GUID of calling module + @param[in] Function Name of calling function + @param[in] LockEventText Event text explaining what is locked + @param[in] LockType Enumerated lock type for differentia= tion + +**/ +VOID +EFIAPI +SecurityLockReportEvent ( + IN GUID *Module, + IN CONST CHAR8 *Function, + IN CONST CHAR8 *LockEventText, + IN LOCK_TYPE LockType + ) +{ +} diff --git a/MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAudi= tLibNull.inf b/MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAu= ditLibNull.inf new file mode 100644 index 0000000000..bf3f9fc0b0 --- /dev/null +++ b/MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAuditLibNul= l.inf @@ -0,0 +1,27 @@ +## @file +# +# Null library for security lock logging that does nothing but meet compi= le requirements +# +# +# Copyright (c) 2018, Microsoft Corporation +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SecurityLockAuditLibNull + FILE_GUID =3D 1d333a6a-90a7-45cb-9897-0a172ee35066 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SecurityLockAuditLib + +[Sources.common] + SecurityLockAuditLibNull.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + BaseLib --=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 (#44090): https://edk2.groups.io/g/devel/message/44090 Mute This Topic: https://groups.io/mt/32555408/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- From nobody Mon May 6 04:41:14 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+44091+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+44091+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563771176; cv=none; d=zoho.com; s=zohoarc; b=kH/K+jyoVaBBNe4txunrQ2gxKr76qirTTs96PodjlEqwGgXJ4tzWS8kmVjElOrxbBnHqNTXOnb3BeaSKNwCcn+H4Zpr3ggr0DpZ1EP/ninyz9C4t/sqSGkwXtQtOv0w+i+dpaOEVjC37JFs6eGu+QolWe1Np3UEs1gPm5A0h7zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563771176; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=jYpe0b9AL/J5C3f4pWm/0kzLK1ajDA+Bg6kqyU1/3Ts=; b=MEsUjxbOpzG7dOAuca/7EmGHStE32z8M/UIejcuTpt66LQx45nRcS6VttwBpHhpUq/jNoSCSJAjXM8x/cWj4sZnGWc8NXbsMhcF3ZBk+c6ycPRIpRH6Mjz9FBEtVn5dfzURbdnLj0R5TWyukh9Pl+SaM1q7r52tjkIFFj0Wpbos= 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+44091+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 1563771176927202.80004723499178; Sun, 21 Jul 2019 21:52:56 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Sun, 21 Jul 2019 21:52:56 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 21:52:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,293,1559545200"; d="scan'208";a="188527061" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2019 21:52:54 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner Subject: [edk2-devel] [PATCH 4/5] MdeModulePkg: Add SecuritAuditLib to dec file Date: Mon, 22 Jul 2019 12:02:03 +0800 Message-Id: <20190722040204.33108-5-zhichao.gao@intel.com> In-Reply-To: <20190722040204.33108-1-zhichao.gao@intel.com> References: <20190722040204.33108-1-zhichao.gao@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,zhichao.gao@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=1563771176; bh=T4/3HtcOVQ5lz14ykCGHWA+0/3VkeLpPGMZus1safXc=; h=Cc:Date:From:Reply-To:Subject:To; b=c6NsPJmX3cPNNybHNTjL4tmdBYMFgeoSRHGukDdp5QQHdFHALy/LDiytJ0hXj9vODlT EC4iSHHafmi2qKdwcHMcrdperQY618rdxQDaYZzc5qjTjJz5n9PwpB/8YqyI90IsCiWBY CAB52Uxjzz/25wuwKKXgJZe4t5xod0G9ov0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2006 Add the lib instance to LibraryClasses for components that consume it. Add the lib instance to Components for build only. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdeModulePkg/MdeModulePkg.dsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 6ca7d9ade4..f3d8ffb5c6 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -27,6 +27,7 @@ DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiA= pplicationEntryPoint.inf + SecurityLockAuditLib|MdeModulePkg/Library/SecurityLockAuditDebugLib/Secu= rityLockAuditDebugLib.inf # # Basic # @@ -271,6 +272,8 @@ MdeModulePkg/Core/Pei/PeiMain.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf =20 + MdeModulePkg/Library/SecurityLockAuditDebugLib/SecurityLockAuditDebugLib= .inf + MdeModulePkg/Library/SecurityLockAuditLibNull/SecurityLockAuditLibNull.i= nf MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf MdeModulePkg/Library/UefiMemoryAllocationProfileLib/UefiMemoryAllocation= ProfileLib.inf MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationL= ib.inf --=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 (#44091): https://edk2.groups.io/g/devel/message/44091 Mute This Topic: https://groups.io/mt/32555409/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- From nobody Mon May 6 04:41:14 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+44092+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+44092+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563771178; cv=none; d=zoho.com; s=zohoarc; b=HXhWTBm7y9aKEzVUXCNBZEN8hSnIgPzPvHTg/h59UHQw3OXHfQ3lrQctA/yGuxP6vpwScNZHDF26V6/KDh7lC7vjwcgnWvbGt8zxZjlQcQ6SEVj0GkjZssb6MrEjz075yAgjPsUIqkiB1PS1eeyt2z/6R+CeDh3nSsBo932R70U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563771178; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=Uv8kiW5hEeZY9Iuo//JtlWPOq6oQpBTWr1g3XoTz1Xs=; b=aG1lQXL3fFtfT5IV90U3W1fiKgp+4SdTXo65+tIU4Lobog8T8u67/hZaRW2im+iVYgeQXwyjNvtDWhXGPCIw5dTpE+Gi1QBpRxwbHnUUVbJ7xgB8X2vEIfuHjm0SphbnxF/BBytTrEn0Yr7vWPc7LbV0kIUiy2re18coclmQd48= 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+44092+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 1563771178294523.1852366355564; Sun, 21 Jul 2019 21:52:58 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Sun, 21 Jul 2019 21:52:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 21:52:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,293,1559545200"; d="scan'208";a="188527065" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2019 21:52:56 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner Subject: [edk2-devel] [PATCH 5/5] MdeModulePkg/PiSmmIpl: Use SecurityLockAuditLib for debug Date: Mon, 22 Jul 2019 12:02:04 +0800 Message-Id: <20190722040204.33108-6-zhichao.gao@intel.com> In-Reply-To: <20190722040204.33108-1-zhichao.gao@intel.com> References: <20190722040204.33108-1-zhichao.gao@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,zhichao.gao@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=1563771177; bh=+446bd88/GU5ewBMMbTCwoFniUapzptq6g7J7WEv5mc=; h=Cc:Date:From:Reply-To:Subject:To; b=F8YTPG1ky78xbfDr3nhY7R3nTVhXg6icELpx+VKi91PTCBnooJMYQvxB2Bg+lmVB87E M7k3/8/dNdDlwxOil3jMcPo8640dyFblSVT1rQfrVf3QzUxjocFzO08IIvdwIgGvYjSli J5xBvDpd5lqAJT0yEVPFYRihzaZQiYzJFF8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2006 Use SecurityLockAuditLib in PiSmmIpl to output debug message while lock the SMRAM. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 2 ++ MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf | 1 + 2 files changed, 3 insertions(+) diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiS= mmCore/PiSmmIpl.c index 1cf8c93227..604eb1b98e 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -33,6 +33,7 @@ #include #include #include +#include =20 #include "PiSmmCorePrivateData.h" =20 @@ -780,6 +781,7 @@ SmmIplReadyToLockEventNotify ( // Lock the SMRAM (Note: Locking SMRAM may not be supported on all platf= orms) // mSmmAccess->Lock (mSmmAccess); + SECURITY_LOCK_REPORT_EVENT ("Lock SMRAM", HARDWARE_LOCK); =20 // // Close protocol and event notification events that do not apply after = the diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf b/MdeModulePkg/Core/P= iSmmCore/PiSmmIpl.inf index b6b1bbcdac..2240ab3c5f 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf @@ -46,6 +46,7 @@ DxeServicesLib PcdLib ReportStatusCodeLib + SecurityLockAuditLib =20 [Protocols] gEfiSmmBase2ProtocolGuid ## PRODUCES --=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 (#44092): https://edk2.groups.io/g/devel/message/44092 Mute This Topic: https://groups.io/mt/32555410/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-