Commit e00b23d1 authored by Samuel Groß's avatar Samuel Groß Committed by V8 LUCI CQ

Align page allocation hint in VirtualMemoryCage initialization

Bug: chromium:1263504
Change-Id: I32091478eb1662b72e0b9507e7cd17314cb277d7
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3247634Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77588}
parent 52b4aae2
......@@ -308,10 +308,12 @@ bool V8VirtualMemoryCage::Initialize(v8::PageAllocator* page_allocator,
// PA anyway uses MAP_JIT for V8 mappings. Further, we want to eventually
// move JIT pages out of the cage, at which point we'd like to forbid
// making pages inside the cage executable, and so don't want MAP_JIT.
void* hint = page_allocator->GetRandomMmapAddr();
Address hint = RoundDown(
reinterpret_cast<Address>(page_allocator->GetRandomMmapAddr()),
kVirtualMemoryCageAlignment);
reservation_base_ = reinterpret_cast<Address>(page_allocator->AllocatePages(
hint, reservation_size, kVirtualMemoryCageAlignment,
PageAllocator::kNoAccess));
reinterpret_cast<void*>(hint), reservation_size,
kVirtualMemoryCageAlignment, PageAllocator::kNoAccess));
if (!reservation_base_) {
size /= 2;
}
......
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