From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.24625.1654850993321265702 for ; Fri, 10 Jun 2022 01:49:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=nNwbcjVG; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654850993; x=1686386993; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7wb64/urwftY4LHZnPYKoWccGbj95VFZz6zmRwVNfgI=; b=nNwbcjVG4Ul9HT+JISIn4w8EIu2QFpQyiWkPrfdVU3Y93CKjZQiFfFEv Tn8Lt0zM3tTZWbIMlX7C/YPYpd45c4k4ZwKGPyE1YDUwtyEH8oRkjbWEB hLLTKCwzNQ0FdIojUQOkgLzDNHVDqcvFCYz3klRzWb671VP8sqevCJE5i DARrdk1rZXK2/sIzw5cSwK0xwYyKk3jntb8Rks3H6BfiEN3hADLax3mIG q77oNFsuZM0tZ2SzwwjI1CcCVYr7pFgzkfUShLkfg9XS2GBfrqPxYMvbS GG5zxQHnLWIqG7Lk17T8hB15ftigkzghX7silUP+AYjIGP0Dqnudcipe1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="257999173" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="257999173" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:49:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="638025576" Received: from shwdeopenlab706.ccr.corp.intel.com ([10.239.183.102]) by fmsmga008.fm.intel.com with ESMTP; 10 Jun 2022 01:49:51 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao Subject: [PATCH] DxeMain: Fix the bug that StackGuard is not enabled Date: Fri, 10 Jun 2022 16:49:46 +0800 Message-Id: <20220610084946.853-1-ray.ni@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Jian J Wang Cc: Liming Gao --- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dx= e/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 =3D InitializeCpuExceptionHandlers (VectorInfoList);=0D ASSERT_EFI_ERROR (Status);=0D =0D + //=0D + // Setup Stack Guard=0D + //=0D + if (PcdGetBool (PcdCpuStackGuard)) {=0D + Status =3D InitializeSeparateExceptionStacks (NULL);=0D + ASSERT_EFI_ERROR (Status);=0D + }=0D +=0D //=0D // Initialize Debug Agent to support source level debug in DXE phase=0D //=0D --=20 2.35.1.windows.2