summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2019-01-07 07:56:49 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2019-01-14 19:42:23 +0100
commitd08575759e5a853e157e6e418e9fea5d5864f725 (patch)
tree4f8789549e4aea0c2e21a665daeb53f8fe8903ce /ArmPkg/Library
parente695e44545b41dc6321af73277a9056f5f4808d7 (diff)
downloadedk2-d08575759e5a853e157e6e418e9fea5d5864f725.tar.gz
edk2-d08575759e5a853e157e6e418e9fea5d5864f725.tar.bz2
edk2-d08575759e5a853e157e6e418e9fea5d5864f725.zip
ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions
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>
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r--ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
index 3b3b20aa9b..bffab83d4f 100644
--- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
@@ -744,6 +744,10 @@ ArmSetMemoryAttributes (
UINT64 ChunkLength;
BOOLEAN FlushTlbs;
+ if (BaseAddress > (UINT64)MAX_ADDRESS - Length + 1) {
+ return EFI_UNSUPPORTED;
+ }
+
if (Length == 0) {
return EFI_SUCCESS;
}