Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin....@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>
---
 MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c                            | 2 +-
 .../PropertiesTableAttributesDxe/PropertiesTableAttributesDxe.c         | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c 
b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
index 3515993..89d4493 100644
--- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
+++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c
@@ -856,7 +856,7 @@ SetPropertiesTableSectionAlignment (
   if (((SectionAlignment & (SIZE_4KB - 1)) != 0) &&
       ((mPropertiesTable.MemoryProtectionAttribute & 
EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) != 0)) {
     DEBUG ((EFI_D_VERBOSE, "SetPropertiesTableSectionAlignment - Clear\n"));
-    mPropertiesTable.MemoryProtectionAttribute &= 
~EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA;
+    mPropertiesTable.MemoryProtectionAttribute &= 
~((UINT64)EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA);
     gBS->GetMemoryMap = CoreGetMemoryMap;
     gBS->Hdr.CRC32 = 0;
     gBS->CalculateCrc32 ((UINT8 *)gBS, gBS->Hdr.HeaderSize, &gBS->Hdr.CRC32);
diff --git 
a/MdeModulePkg/Universal/PropertiesTableAttributesDxe/PropertiesTableAttributesDxe.c
 
b/MdeModulePkg/Universal/PropertiesTableAttributesDxe/PropertiesTableAttributesDxe.c
index 6e5c4f8..718c567 100644
--- 
a/MdeModulePkg/Universal/PropertiesTableAttributesDxe/PropertiesTableAttributesDxe.c
+++ 
b/MdeModulePkg/Universal/PropertiesTableAttributesDxe/PropertiesTableAttributesDxe.c
@@ -130,6 +130,8 @@ UpdateMemoryAttributesDefault (
   if (EFI_ERROR (Status)) {
     goto Done;
   }
+  
+  ASSERT (PropertiesTable != NULL);
 
   DEBUG ((EFI_D_INFO, "MemoryProtectionAttribute - 0x%016lx\n", 
PropertiesTable->MemoryProtectionAttribute));
   if ((PropertiesTable->MemoryProtectionAttribute & 
EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) == 0) {
-- 
1.9.5.msysgit.1


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to