diff options
| author | Alexander Graf <[email protected]> | 2018-06-22 14:44:13 +0200 |
|---|---|---|
| committer | Alexander Graf <[email protected]> | 2018-09-23 21:55:30 +0200 |
| commit | 6e6e4b2f73294ea363852273cb4196c9d792f6b6 (patch) | |
| tree | 3fa63067c0411a62e06c42256e5389805c1835f7 | |
| parent | 3fcb7147584f8cf5128e1c5eb6b7e49dd86a5473 (diff) | |
sandbox: Allow to execute from RAM
With efi_loader, we may want to execute payloads from RAM. By default,
permissions on the RAM region don't allow us to execute from there though.
So let's change the default allocation scheme for RAM to also allow
execution from it. That way payloads that live in U-Boot RAM can be
directly executed.
Signed-off-by: Alexander Graf <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
| -rw-r--r-- | arch/sandbox/cpu/os.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index bb075042ade..9fbcb9ef92f 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -146,7 +146,8 @@ void *os_malloc(size_t length) int page_size = getpagesize(); hdr = mmap(NULL, length + page_size, - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (hdr == MAP_FAILED) return NULL; hdr->length = length; |
