From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org
Subject: [PATCH] ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions
Date: Mon, 7 Jan 2019 07:56:49 +0100 [thread overview]
Message-ID: <20190107065649.2003-1-ard.biesheuvel@linaro.org> (raw)
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>
---
ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c
index 3b3b20aa9b78..bffab83d4fd0 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;
}
--
2.20.1
next reply other threads:[~2019-01-07 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 6:56 Ard Biesheuvel [this message]
2019-01-14 11:43 ` [PATCH] ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions Leif Lindholm
2019-01-14 18:46 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190107065649.2003-1-ard.biesheuvel@linaro.org \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox