public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wang, Jian J" <jian.j.wang@intel.com>
To: "Ni, Ray" <ray.ni@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [PATCH] DxeMain: Fix the bug that StackGuard is not enabled
Date: Sat, 11 Jun 2022 14:20:36 +0000	[thread overview]
Message-ID: <CO1PR11MB4945A9880EA7321CB4F817F6B6A99@CO1PR11MB4945.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220610084946.853-1-ray.ni@intel.com>

Reviewed-by: Jian J Wang <jian.j.wang@intel.com>

Regards,
Jian

> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com>
> Sent: Friday, June 10, 2022 4:50 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>
> Subject: [PATCH] DxeMain: Fix the bug that StackGuard is not enabled
> 
> 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>
> Cc: 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


      reply	other threads:[~2022-06-11 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  8:49 [PATCH] DxeMain: Fix the bug that StackGuard is not enabled Ni, Ray
2022-06-11 14:20 ` Wang, Jian J [this message]

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=CO1PR11MB4945A9880EA7321CB4F817F6B6A99@CO1PR11MB4945.namprd11.prod.outlook.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