]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
MdeModulePkg: Fix use-after-free error in InstallConfigurationTable()
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / MemoryAttributesTable.c
index f8edb78157380f19c416a482cfdb1b08de612283..e3c505ef18abf9b31f1f1f1b4019225525f71076 100644 (file)
@@ -146,10 +146,10 @@ SmmMemoryAttributesTableConsistencyCheck (
 /**\r
   Sort memory map entries based upon PhysicalStart, from low to high.\r
 \r
-  @param[in]  MemoryMap              A pointer to the buffer in which firmware places\r
-                                 the current memory map.\r
-  @param[in]  MemoryMapSize          Size, in bytes, of the MemoryMap buffer.\r
-  @param[in]  DescriptorSize         Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.\r
+  @param[in,out]  MemoryMap         A pointer to the buffer in which firmware places\r
+                                    the current memory map.\r
+  @param[in]      MemoryMapSize     Size, in bytes, of the MemoryMap buffer.\r
+  @param[in]      DescriptorSize    Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.\r
 **/\r
 STATIC\r
 VOID\r
@@ -785,7 +785,7 @@ SmmCoreGetMemoryMapMemoryAttributesTable (
 //\r
 \r
 /**\r
-  Set MemoryProtectionAttribute accroding to PE/COFF image section alignment.\r
+  Set MemoryProtectionAttribute according to PE/COFF image section alignment.\r
 \r
   @param[in]  SectionAlignment    PE/COFF section alignment\r
 **/\r
@@ -795,7 +795,7 @@ SetMemoryAttributesTableSectionAlignment (
   IN UINT32  SectionAlignment\r
   )\r
 {\r
-  if (((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) &&\r
+  if (((SectionAlignment & (RUNTIME_PAGE_ALLOCATION_GRANULARITY - 1)) != 0) &&\r
       ((mMemoryProtectionAttribute & EFI_MEMORY_ATTRIBUTES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) != 0)) {\r
     DEBUG ((DEBUG_VERBOSE, "SMM SetMemoryAttributesTableSectionAlignment - Clear\n"));\r
     mMemoryProtectionAttribute &= ~((UINT64)EFI_MEMORY_ATTRIBUTES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA);\r
@@ -1125,9 +1125,9 @@ SmmInsertImageRecord (
   }\r
 \r
   SetMemoryAttributesTableSectionAlignment (SectionAlignment);\r
-  if ((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {\r
+  if ((SectionAlignment & (RUNTIME_PAGE_ALLOCATION_GRANULARITY - 1)) != 0) {\r
     DEBUG ((DEBUG_WARN, "SMM !!!!!!!!  InsertImageRecord - Section Alignment(0x%x) is not %dK  !!!!!!!!\n",\r
-      SectionAlignment, EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT >> 10));\r
+      SectionAlignment, RUNTIME_PAGE_ALLOCATION_GRANULARITY >> 10));\r
     PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageAddress);\r
     if (PdbPointer != NULL) {\r
       DEBUG ((DEBUG_WARN, "SMM !!!!!!!!  Image - %a  !!!!!!!!\n", PdbPointer));\r
@@ -1225,7 +1225,7 @@ Finish:
 }\r
 \r
 /**\r
-  Find image record accroding to image base and size.\r
+  Find image record according to image base and size.\r
 \r
   @param[in]  ImageBase    Base of PE image\r
   @param[in]  ImageSize    Size of PE image\r