Skip to content

Commit

Permalink
Update Stack Cookie Exception Handler to Register Based on Fixed PCD (#…
Browse files Browse the repository at this point in the history
…98)

## Description

To enable more easily setting the stack cookie failure vector, update
the check to reference a fixed at build PCD in MdePkg.

## Breaking change?

No

## How This Was Tested

Triggering the interrupt on Q35

## Integration Instructions

N/A
  • Loading branch information
TaylorBeebe authored Nov 10, 2022
1 parent 618326a commit e8ec629
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/ResetSystemLib.h>
#include <Library/MsWheaEarlyStorageLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/PcdLib.h>

#define IA32_PF_EC_ID BIT4
#define EXCEPT_STACK_COOKIE 0x40
#define IA32_PF_EC_ID BIT4

STATIC EFI_HANDLE mImageHandle = NULL;

@@ -202,7 +202,7 @@ CpuArchRegisterMemoryProtectionExceptionHandler (

Status = mCpu->RegisterInterruptHandler (
mCpu,
EXCEPT_STACK_COOKIE,
PcdGet8 (PcdStackCookieExceptionVector),
MemoryProtectionStackCookieFailureHandler
);

Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@
HwResetSystemLib
MsWheaEarlyStorageLib
PeCoffGetEntryPointLib
PcdLib

[Guids]
gMemoryProtectionExceptionHandlerGuid ## PRODUCES
@@ -49,5 +50,8 @@
[Guids]
gMemoryProtectionExceptionHandlerGuid

[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdStackCookieExceptionVector

[DEPEX]
TRUE

0 comments on commit e8ec629

Please # to comment.