\r
#include "PiSmmCpuDxeSmm.h"\r
\r
-UINT8 mPhysicalAddressBits;\r
-\r
/**\r
Create PageTable for SMM use.\r
\r
}\r
}\r
\r
+ //\r
+ // If NULL pointer was just accessed\r
+ //\r
+ if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & BIT1) != 0 &&\r
+ (PFAddress < EFI_PAGE_SIZE)) {\r
+ DEBUG ((DEBUG_ERROR, "!!! NULL pointer access !!!\n"));\r
+ DEBUG_CODE (\r
+ DumpModuleInfoByIp ((UINTN)SystemContext.SystemContextIa32->Eip);\r
+ );\r
+ CpuDeadLoop ();\r
+ }\r
+\r
if (FeaturePcdGet (PcdCpuSmmProfileEnable)) {\r
SmmProfilePFHandler (\r
SystemContext.SystemContextIa32->Eip,\r
BOOLEAN IsSplitted;\r
BOOLEAN PageTableSplitted;\r
\r
+ //
+ // Don't mark page table as read-only if heap guard is enabled.
+ //
+ // BIT2: SMM page guard enabled
+ // BIT3: SMM pool guard enabled
+ //
+ if ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) {
+ return ;
+ }
+
DEBUG ((DEBUG_INFO, "SetPageTableAttributes\n"));\r
\r
//\r