]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 7 Jan 2019 06:56:49 +0000 (07:56 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 14 Jan 2019 18:42:23 +0000 (19:42 +0100)
Ignore calls to ArmSetMemoryAttributes () when the region described
is outside of the 32-bit addressable range. This memory is not
mapped in the first place, and the current code does not deal with
the high bits correctly, resulting in hangs.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c

index 3b3b20aa9b7869e4869b70b7db53dc8d4163c730..bffab83d4fd0bbe1571fbab9ca3ae0c879a6357b 100644 (file)
@@ -744,6 +744,10 @@ ArmSetMemoryAttributes (
   UINT64        ChunkLength;\r
   BOOLEAN       FlushTlbs;\r
 \r
+  if (BaseAddress > (UINT64)MAX_ADDRESS - Length + 1) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   if (Length == 0) {\r
     return EFI_SUCCESS;\r
   }\r