Commit 2e70a9f7 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Use ZX_VMO_NON_RESIZABLE for zx_vmo_create()

By default zx_vmo_create() creates resizable VMOs, which may be
hazardous in some cases. It's safer to use ZX_VMO_NON_RESIZABLE unless
VMO needs to be resizable. It doesn't make much difference in
OS::Allocate() because it drops the VMO handle immediately after
mapping it, still it's better to use ZX_VMO_NON_RESIZABLE for
consistency.

Change-Id: I688ee44b08042a9df7e3fae0b1b3298271b53b1c
Reviewed-on: https://chromium-review.googlesource.com/c/1277605Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56788}
parent d0ac176d
......@@ -49,7 +49,7 @@ void* OS::Allocate(void* address, size_t size, size_t alignment,
size_t request_size = size + (alignment - page_size);
zx_handle_t vmo;
if (zx_vmo_create(request_size, 0, &vmo) != ZX_OK) {
if (zx_vmo_create(request_size, ZX_VMO_NON_RESIZABLE, &vmo) != ZX_OK) {
return nullptr;
}
static const char kVirtualMemoryName[] = "v8-virtualmem";
......
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