From 3a9da5f329ab9683bffc451502a2f0680568a71f Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Fri, 14 Jun 2024 13:20:29 -0700 Subject: [PATCH] MdePkg: Add Stack Cookie Interrupt Vector PCD This patch adds a PCD allowing a platform to specify the interrupt vector to trigger on a stack check failure. On x86, this is an offset into the IDT. On ARM/AARCH64, this triggers a software interrupt that can be decoded to indicate this was a stack check failure. Signed-off-by: Oliver Smith-Denny --- MdePkg/MdePkg.dec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index d36bd2eda3..8d5947fc9e 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2259,6 +2259,9 @@ # @Prompt Speculation Barrier Type. gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType|0x01|UINT8|0x30001018 + ## This PCD specifies the interrupt vector for stack cookie check failures + gEfiMdePkgTokenSpaceGuid.PcdStackCookieExceptionVector|0x42|UINT8|0x30001019 + [PcdsFixedAtBuild,PcdsPatchableInModule] ## Indicates the maximum length of unicode string used in the following # BaseLib functions: StrLen(), StrSize(), StrCmp(), StrnCmp(), StrCpy(), StrnCpy()