summaryrefslogtreecommitdiff
path: root/MdePkg/Library/StackCheckLib/Readme.md
AgeCommit message (Collapse)AuthorFilesLines
2025-09-26MdePkg: Remove ARM32 Support from StackCheckLibOliver Smith-Denny1-9/+3
edk2 is dropping support for the ARM32 architecture. This commit removes ARM32 code from StackCheckLib and moves the AARCH64 files to the top level. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-11MdePkg/DynamicStackCookieEntryPointLib: Drop execute-in-place versionsArd Biesheuvel1-11/+6
SEC, PEI_CORE and PEIM type modules generally execute in place from memory that is not writable. This means that it is not generally possible to use an entrypoint implementation that stores a dynamically generated stack cookie into a global variable. For PEIMs in particular, there may be other options, such as a DEPEX on the permanent memory PPI, but the current dynamic implementations of the stack checking library entrypoints for PEI_CORE and PEIM modules must not be used as-is. So remove them, and update the readme accordingly. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-02-07MdePkg: Add Dynamic Stack Cookie SupportOliver Smith-Denny1-71/+127
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>
2024-10-04MdePkg: MdeLibs.dsc.inc: Introduce CUSTOM_STACK_CHECK_LIB MacroOliver Smith-Denny1-7/+75
In order to support a platform overriding StackCheckLibNull provided by MdeLibs.dsc.inc, the CUSTOM_STACK_CHECK_LIB macro is introduced. If this macro is defined, MdeLibs.dsc.inc will not link StackCheckLibNull and it is expected that the platform will link the version(s) of StackCheckLib that it requires. The StackCheckLib README is also updated in this patch to document the new macro and provide additional information. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-13MdePkg: Create Stack Check LibTaylor Beebe1-0/+126
StackCheckLib contains the required functionality for initializing the stack cookie value, checking the value, and triggering an interrupt when a mismatch occurs. The stack cookie is a random value placed on the stack between the stack variables and the return address so that continuously writing past the stack variables will cause the stack cookie to be overwritten. Before the function returns, the stack cookie value will be checked and if there is a mismatch then StackCheckLib handles the failure. Because UEFI doesn't use the C runtime libraries provided by MSVC, the stack check code is written in assembly within this library. GCC and Clang compilers have built-in support for stack cookie checking, so this library only handles failures. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>