summaryrefslogtreecommitdiff
path: root/js/src/jit/ProcessExecutableMemory.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-08-30 12:26:26 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-08-30 12:26:26 +0200
commitf214aa5dbe2c4aa3e543aecc2b6ad96d7786862e (patch)
treedcf1a9a2d351b6ab9364f0cbd06a341a8935a706 /js/src/jit/ProcessExecutableMemory.cpp
parent0bc2511432fe0cdcae92aae71576b6eb9bad7f5c (diff)
downloaduxp-f214aa5dbe2c4aa3e543aecc2b6ad96d7786862e.tar.gz
Revert "Bug 1444668 - Avoid allocating large AssemblerBuffers. r=luke, r=bbouvier, a=RyanVM"
This reverts commit 9472136272f01b858412f2d9d7854d2daa82496f.
Diffstat (limited to 'js/src/jit/ProcessExecutableMemory.cpp')
-rw-r--r--js/src/jit/ProcessExecutableMemory.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp
index 301541541e..71c2ab0dce 100644
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -385,6 +385,14 @@ class PageBitSet
#endif
};
+// Limit on the number of bytes of executable memory to prevent JIT spraying
+// attacks.
+#if JS_BITS_PER_WORD == 32
+static const size_t MaxCodeBytesPerProcess = 128 * 1024 * 1024;
+#else
+static const size_t MaxCodeBytesPerProcess = 1 * 1024 * 1024 * 1024;
+#endif
+
// Per-process executable memory allocator. It reserves a block of memory of
// MaxCodeBytesPerProcess bytes, then allocates/deallocates pages from that.
//