Contributed by tj on Wed Oct 21 17:33:32 2015 (GMT)
from the fireF^X dept.
After recent discussions of revisiting W^X support in Mozilla Firefox, David Coppa (dcoppa@) has flipped the switch to enable it for OpenBSD users running -current.
Module name: ports
Changes by: firstname.lastname@example.org 2015/10/19 02:09:23
Enable option to mark JIT pages as non-writable.
We're enabling this now so people can test and eventual regressions
can be catched and reported upstream.
There's a bug opened on Bugzilla@Mozilla:
OK landry@, sthen@
deraadt@ also agrees
Due to Apple's iOS requiring JIT pages to be non-writable, most of the upstream code was already in place. The patch itself is very simple, only altering the conditional check in the build to include OpenBSD as well:
$OpenBSD: patch-js_src_jit_ExecutableAllocator_cpp,v 1.1 2015/10/19 08:09:23 dcoppa Exp $
Mark JIT pages as non-writable
--- js/src/jit/ExecutableAllocator.cpp.orig Tue Sep 29 23:44:56 2015
+++ js/src/jit/ExecutableAllocator.cpp Fri Oct 16 17:02:15 2015
@@ -88,7 +88,7 @@ ExecutableAllocator::addSizeOfCode(JS::CodeSizes* size
+#if defined(__OpenBSD__) || TARGET_OS_IPHONE
bool ExecutableAllocator::nonWritableJitCode = true;
bool ExecutableAllocator::nonWritableJitCode = false;
If you're a desktop user running snapshots, now's the time to help test. Initial testing shows a very minimal performance hit, but everyday users also need to give it a try and share their findings. If no issues are discovered, the patch will likely be merged upstream. Further discussion and status updates can be found in the Mozilla bug report and on the ports@ mailing list.