]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
MdePkg: Remove Old Stack Check Lib Implementation
authorOliver Smith-Denny <osde@linux.microsoft.com>
Tue, 23 Jul 2024 23:07:25 +0000 (16:07 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 13 Sep 2024 03:58:46 +0000 (03:58 +0000)
Now that the new stack check lib implementation is being used
everywhere, remove the old one.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c [deleted file]
MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf [deleted file]
MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.uni [deleted file]
MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c [deleted file]
MdePkg/MdePkg.dsc

diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
deleted file mode 100644 (file)
index ea16884..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/** @file\r
- Base Stack Check library for GCC/clang.\r
-\r
- Use -fstack-protector-all compiler flag to make the compiler insert the\r
- __stack_chk_guard "canary" value into the stack and check the value prior\r
- to exiting the function. If the "canary" is overwritten __stack_chk_fail()\r
- is called. This is GCC specific code.\r
-\r
- Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\r
- Copyright (c) 2012, Apple Inc. All rights reserved.<BR>\r
- SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include <Base.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-/// "canary" value that is inserted by the compiler into the stack frame.\r
-VOID  *__stack_chk_guard = (VOID *)0x0AFF;\r
-\r
-// If ASLR was enabled we could use\r
-// void (*__stack_chk_guard)(void) = __stack_chk_fail;\r
-\r
-/**\r
- Error path for compiler generated stack "canary" value check code. If the\r
- stack canary has been overwritten this function gets called on exit of the\r
- function.\r
-**/\r
-VOID\r
-__stack_chk_fail (\r
-  VOID\r
-  )\r
-{\r
-  UINT8  DebugPropertyMask;\r
-\r
-  DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow at 0x%p.\n", RETURN_ADDRESS (0)));\r
-\r
-  //\r
-  // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if\r
-  // BaseDebugLibNull is in use.\r
-  //\r
-  DebugPropertyMask = PcdGet8 (PcdDebugPropertyMask);\r
-  if ((DebugPropertyMask & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r
-    CpuBreakpoint ();\r
-  } else if ((DebugPropertyMask & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r
-    CpuDeadLoop ();\r
-  }\r
-}\r
diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
deleted file mode 100644 (file)
index b827645..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-## @file\r
-#  Stack Check Library\r
-#\r
-#  Stack Check Library\r
-#\r
-#  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>\r
-#\r
-#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = BaseStackCheckLib\r
-  MODULE_UNI_FILE                = BaseStackCheckLib.uni\r
-  FILE_GUID                      = 5f6579f7-b648-4fdb-9f19-4c17e27e8eff\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = NULL\r
-\r
-\r
-#\r
-#  VALID_ARCHITECTURES           = ARM AARCH64\r
-#\r
-\r
-[Sources]\r
-  BaseStackCheckGcc.c  | GCC\r
-  BaseStackCheckNull.c | MSFT\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  DebugLib\r
-\r
-[Pcd]\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask  ## CONSUMES\r
diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.uni b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.uni
deleted file mode 100644 (file)
index 03b9d7c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// /** @file\r
-// Stack Check Library\r
-//\r
-// Stack Check Library\r
-//\r
-// Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>\r
-//\r
-// SPDX-License-Identifier: BSD-2-Clause-Patent\r
-//\r
-// **/\r
-\r
-\r
-#string STR_MODULE_ABSTRACT             #language en-US "Stack Check Library"\r
-\r
-#string STR_MODULE_DESCRIPTION          #language en-US "Stack Check Library"\r
-\r
diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c
deleted file mode 100644 (file)
index 3293200..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/** @file\r
- This file is purely empty as a work around for BaseStackCheck to pass MSVC build.\r
-\r
- Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
- SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-extern int  __BaseStackCheckNull;\r
index 92809e4a7599d620b9c9b31925ef1c8414c8a21a..0f00172be100027227275a6ce971e3f8b73a0609 100644 (file)
 \r
 [Components.ARM, Components.AARCH64]\r
   MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf\r
-  MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf\r
   MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf\r
 \r
 [Components.RISCV64]\r