]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DxeMain: Fix the bug that StackGuard is not enabled
authorRay Ni <ray.ni@intel.com>
Fri, 10 Jun 2022 08:43:32 +0000 (16:43 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 14 Jun 2022 02:59:22 +0000 (02:59 +0000)
Commit e7abb94d1 removed InitializeCpuExceptionHandlersEx
and updated DxeMain to call InitializeCpuExceptionHandlers
for exception setup. But the old behavior that calls *Ex() sets
up the stack guard as well. To match the old behavior,
the patch calls InitializeSeparateExceptionStacks.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c

index 83f49d7c0071b34b90722db2abff04b9b686823c..0a1f3d79e2420eb1e7a224efdbceaddf5224e740 100644 (file)
@@ -256,6 +256,14 @@ DxeMain (
   Status = InitializeCpuExceptionHandlers (VectorInfoList);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Setup Stack Guard\r
+  //\r
+  if (PcdGetBool (PcdCpuStackGuard)) {\r
+    Status = InitializeSeparateExceptionStacks (NULL);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
   //\r
   // Initialize Debug Agent to support source level debug in DXE phase\r
   //\r