Commit 77630f1e by Matthew Dempsky

[fuchsia] Ensure VMO has execute rights

Currently VMOs on Fuchsia are allocated with execute rights, but soon that will not be the case, so the calls later to re-map memory as executable will fail. Add zx_vmo_replace_as_executable call to ensure they don't. Change-Id: I45c5f5527bc36ed898b29095788006239bb2b0b3 Reviewed-on: https://swiftshader-review.googlesource.com/c/24188Reviewed-by: 's avatarWez <wez@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarMatthew Dempsky <mdempsky@google.com>
parent b08c5e92
...@@ -214,6 +214,9 @@ void *allocateExecutable(size_t bytes) ...@@ -214,6 +214,9 @@ void *allocateExecutable(size_t bytes)
if (zx_vmo_create(length, ZX_VMO_NON_RESIZABLE, &vmo) != ZX_OK) { if (zx_vmo_create(length, ZX_VMO_NON_RESIZABLE, &vmo) != ZX_OK) {
return nullptr; return nullptr;
} }
if (zx_vmo_replace_as_executable(vmo, ZX_HANDLE_INVALID, &vmo) != ZX_OK) {
return nullptr;
}
zx_vaddr_t reservation; zx_vaddr_t reservation;
zx_status_t status = zx_vmar_map( zx_status_t status = zx_vmar_map(
zx_vmar_root_self(), ZX_VM_PERM_READ | ZX_VM_PERM_WRITE, zx_vmar_root_self(), ZX_VM_PERM_READ | ZX_VM_PERM_WRITE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment