From: "Ni, Ray" <ray.ni@intel.com>
To: devel@edk2.groups.io
Cc: Jian J Wang <jian.j.wang@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH 2/2] DxeMain: Fix the bug that StackGuard is not enabled
Date: Mon, 13 Jun 2022 11:39:03 +0800 [thread overview]
Message-ID: <20220613033903.1395-3-ray.ni@intel.com> (raw)
In-Reply-To: <20220613033903.1395-1-ray.ni@intel.com>
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 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 83f49d7c00..0a1f3d79e2 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -256,6 +256,14 @@ DxeMain (
Status = InitializeCpuExceptionHandlers (VectorInfoList);
ASSERT_EFI_ERROR (Status);
+ //
+ // Setup Stack Guard
+ //
+ if (PcdGetBool (PcdCpuStackGuard)) {
+ Status = InitializeSeparateExceptionStacks (NULL);
+ ASSERT_EFI_ERROR (Status);
+ }
+
//
// Initialize Debug Agent to support source level debug in DXE phase
//
--
2.35.1.windows.2
next prev parent reply other threads:[~2022-06-13 3:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 3:39 [PATCH 0/2] DxeMain: Fix the bug that StackGuard is not enabled Ni, Ray
2022-06-13 3:39 ` [PATCH 1/2] ArmPkg/ArmExceptionLib: Follow new CpuExceptionHandlerLib APIs Ni, Ray
2022-06-13 11:26 ` Sami Mujawar
2022-06-13 3:39 ` Ni, Ray [this message]
2022-06-13 11:28 ` [edk2-devel] [PATCH 2/2] DxeMain: Fix the bug that StackGuard is not enabled Sami Mujawar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220613033903.1395-3-ray.ni@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox