Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1831)

Unified Diff: src/platform-posix.cc

Issue 296853005: Improve ASLR for arm64 Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index bc315b2e7e15ade647f0a92b121669eb69aaeb8f..5a149bc9119782e75646f4263392eff8290e7c93 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -205,6 +205,11 @@ void* OS::GetRandomMmapAddr() {
// the hint address to 46 bits to give the kernel a fighting chance of
// fulfilling our placement request.
raw_addr &= V8_UINT64_C(0x3ffffffff000);
+#elif V8_HOST_ARCH_ARM64
+ // Currently available CPUs have 40 bits of virtual addressing with 39 for
Rodolph Perfetta 2014/05/21 08:00:08 DBC: arm64 has 48-bit virtual addresses
+ // user space. Truncate the hint address to 38 bits to give the kernel a
+ // fighting chance of fulfilling our placement request.
+ raw_addr &= V8_UINT64_C(0x3ffffff000);
#else
raw_addr &= 0x3ffff000;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698