Reviewers: ulan,

Description:
Improve ASLR for arm64

[email protected]


Please review this at https://chromiumcodereview.appspot.com/296853005/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+5, -0 lines):
  M src/platform-posix.cc


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 + // 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;



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to