UefiCpuPkg/PiSmmCpuDxeSmm: Implement NULL pointer detection for SMM code
The mechanism behind is the same as NULL pointer detection enabled in EDK-II core. SMM has its own page table and we have to disable page 0 again in SMM mode. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Ayellet Wolman <ayellet.wolman@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
@@ -155,6 +155,18 @@ SmiPFHandler (
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// If NULL pointer was just accessed
|
||||
//
|
||||
if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & BIT1) != 0 &&
|
||||
(PFAddress < EFI_PAGE_SIZE)) {
|
||||
DEBUG ((DEBUG_ERROR, "!!! NULL pointer access !!!\n"));
|
||||
DEBUG_CODE (
|
||||
DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextIa32->Eip);
|
||||
);
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
if (FeaturePcdGet (PcdCpuSmmProfileEnable)) {
|
||||
SmmProfilePFHandler (
|
||||
SystemContext.SystemContextIa32->Eip,
|
||||
|
Reference in New Issue
Block a user