]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuPageTable.c
UefiCpuPkg/CpuDxe: fix SetMemoryAttributes issue in 32-bit mode
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuPageTable.c
index a9c9bc9d5e9079f54b014ac880be5787c47e686c..3ad55f65c58abd5d0ab47c907d87f9f5dfcb6f9a 100644 (file)
@@ -699,6 +699,10 @@ ConvertMemoryPageAttributes (
       DEBUG ((DEBUG_ERROR, "Non-PAE Paging!\n"));\r
       return EFI_UNSUPPORTED;\r
     }\r
+    if ((BaseAddress + Length) > BASE_4GB) {\r
+      DEBUG ((DEBUG_ERROR, "Beyond 4GB memory in 32-bit mode!\n"));\r
+      return EFI_UNSUPPORTED;\r
+    }\r
     break;\r
   case IMAGE_FILE_MACHINE_X64:\r
     ASSERT (CurrentPagingContext.ContextData.X64.PageTableBase != 0);\r