[edk2-devel] [PATCH 1/5] MdeModulePkg: Add header file for SecurityLockAuditLib

Laszlo Ersek lersek at redhat.com
Mon Jul 22 20:27:15 UTC 2019


On 07/22/19 06:02, Gao, Zhichao wrote:
> From: Bret Barkelew <Bret.Barkelew at microsoft.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2006
> 
> Add header file for SecurityLockAuditLib and add its
> file path to dec file.
> 
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Star Zeng <star.zeng at intel.com>
> Cc: Liming gao <liming.gao at intel.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Michael Turner <Michael.Turner at microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
> Signed-off-by: Zhichao Gao <zhichao.gao at intel.com>
> ---
>  .../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/MdeModulePkg/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__, LockMessage, LockType);
> +
> +/**
> +  Enum to hold the various lock types for use in post-processing
> +
> +**/
> +typedef enum {
> +  SOFTWARE_LOCK = 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 differentiation
> +
> +**/
> +VOID
> +EFIAPI
> +SecurityLockReportEvent (
> +  IN GUID           *Module,
> +  IN CONST CHAR8    *Function,
> +  IN CONST CHAR8    *LockEventText,
> +  IN LOCK_TYPE      LockType
> +  );
> +
> +#endif

(1) Has support for conversion specifiers (i.e., a format string) been
considered?

Thanks!
Laszlo

> 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
>  
> +  ##  @libraryclass  Provides a way for logging security locks
> +  #
> +  SecurityLockAuditLib|Include/Library/SecurityLockAuditLib.h
> +
>  [Guids]
>    ## MdeModule package token space guid
>    # Include/Guid/MdeModulePkgTokenSpace.h
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#44152): https://edk2.groups.io/g/devel/message/44152
Mute This Topic: https://groups.io/mt/32555405/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list