summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@microsoft.com>2025-01-29 11:05:03 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-02-07 02:23:11 +0000
commite6b6aa90d490c298da140bc118d73ceff510f563 (patch)
treee20b3795b7d5bab5c7280396aafbfb61e9b1b577 /MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf
parentefbf5ed08c48478b51bb6b6da5670b1312755854 (diff)
downloadedk2-e6b6aa90d490c298da140bc118d73ceff510f563.tar.gz
MdePkg: Add Dynamic Stack Cookie Support
Adds dynamic stack cookies in the form of copies of the entry point libraries that use shared logic to update stack cookies at runtime. This relies on RDRAND on IA32/X64 and RNDR on AARCH64 to get a random number to apply to the stack cookie on module entry point. This simplifies the logic a platform must do to include stack check functionality. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Diffstat (limited to 'MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf')
-rw-r--r--MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf68
1 files changed, 68 insertions, 0 deletions
diff --git a/MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf b/MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf
new file mode 100644
index 0000000000..d624c3e1a3
--- /dev/null
+++ b/MdePkg/Library/DynamicStackCookieEntryPointLib/UefiDriverEntryPoint.inf
@@ -0,0 +1,68 @@
+## @file
+# Module entry point library for UEFI driver, DXE driver and SMM driver that dynamically sets the stack cookie.
+#
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = UefiDriverEntryPointDynamicInit
+ MODULE_UNI_FILE = UefiDriver/UefiDriverEntryPoint.uni
+ FILE_GUID = 900238F9-1421-4596-9548-A1BF58C97693
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = UefiDriverEntryPoint|DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER SMM_CORE DXE_SMM_DRIVER
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 AARCH64
+#
+
+[Sources]
+ UefiDriver/DriverEntryPoint.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[Sources.IA32]
+ IA32/DynamicCookieGcc.nasm | GCC
+ IA32/DynamicCookieMsvc.nasm | MSFT
+
+[Sources.X64]
+ X64/DynamicCookieGcc.nasm | GCC
+ X64/DynamicCookieMsvc.nasm | MSFT
+
+[Sources.AARCH64]
+ AArch64/DynamicCookieGcc.S | GCC
+
+[LibraryClasses]
+ UefiBootServicesTableLib
+ DebugLib
+ BaseLib
+ StackCheckLib
+
+[Protocols]
+ gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMES
+
+#
+# For UEFI drivers, these architectural protocols defined in PI 1.0 spec need
+# to be appended and merged to the final dependency section.
+#
+[Depex.common.UEFI_DRIVER]
+ gEfiBdsArchProtocolGuid AND
+ gEfiCpuArchProtocolGuid AND
+ gEfiMetronomeArchProtocolGuid AND
+ gEfiMonotonicCounterArchProtocolGuid AND
+ gEfiRealTimeClockArchProtocolGuid AND
+ gEfiResetArchProtocolGuid AND
+ gEfiRuntimeArchProtocolGuid AND
+ gEfiSecurityArchProtocolGuid AND
+ gEfiTimerArchProtocolGuid AND
+ gEfiVariableWriteArchProtocolGuid AND
+ gEfiVariableArchProtocolGuid AND
+ gEfiWatchdogTimerArchProtocolGuid