From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web08.1990.1655091556516189970 for ; Sun, 12 Jun 2022 20:39:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=VCHHil2S; spf=pass (domain: intel.com, ip: 134.134.136.31, 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=1655091556; x=1686627556; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zBasg+3Y5o0dNiHTJUVHG67viGt6MHCGQu39xeXiaS8=; b=VCHHil2SBGKCnemBWaX4Xuti0eyPW9gFFy4f0MR5oFXZV9wkt/nRe1Jr uAw314PazPnPg9e9+OTK6/5StazH3ym6+tI4aGtVTdIqumtl5zNTsntzH FO71DnWJnYyqeg6LCK6upi+qRPhx4JawBV/darLHiuGyJOnlCGdC+iOAS GLMN7YGm4GYpJwKip/JvNirJc72Tw1QUFNNeDiyMyIOJPlA1chjjr9hAs JkDUttzWNmrSi7C5JnOQI4KBe1H8it93fIVLtxSAbp4wWhG6bFaxePomn m+8jld7XDvnBn6dUFn6xszPfuFHP7FxFQwDrV+pIO8gzQ2+khet0KFtNF w==; X-IronPort-AV: E=McAfee;i="6400,9594,10376"; a="339826056" X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="339826056" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2022 20:39:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="639470402" Received: from shwdeopenlab706.ccr.corp.intel.com ([10.239.183.102]) by fmsmga008.fm.intel.com with ESMTP; 12 Jun 2022 20:39:10 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao Subject: [PATCH 2/2] DxeMain: Fix the bug that StackGuard is not enabled Date: Mon, 13 Jun 2022 11:39:03 +0800 Message-Id: <20220613033903.1395-3-ray.ni@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220613033903.1395-1-ray.ni@intel.com> References: <20220613033903.1395-1-ray.ni@intel.com> 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 Reviewed-by: 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