summaryrefslogtreecommitdiffstats
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:33:56 +0200
commit73b202b1e5688c0cff883873950f0261c50018e7 (patch)
treeaf3bc9bfce8c1d47a96ba274d09b5224d6c1567e /js/src/jit/ProcessExecutableMemory.cpp
parent21042963de0513abbb74a57733e703a15df6111b (diff)
downloadUXP-73b202b1e5688c0cff883873950f0261c50018e7.tar
UXP-73b202b1e5688c0cff883873950f0261c50018e7.tar.gz
UXP-73b202b1e5688c0cff883873950f0261c50018e7.tar.lz
UXP-73b202b1e5688c0cff883873950f0261c50018e7.tar.xz
UXP-73b202b1e5688c0cff883873950f0261c50018e7.zip
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 301541541..71c2ab0dc 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.
//