OpenBSD Journal

W^X enabled in Firefox port

Contributed by tj on 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.

CVSROOT: /cvs Module name: ports Changes by: 2015/10/19 02:09:23 Modified files: www/mozilla-firefox: Makefile Added files: www/mozilla-firefox/patches: patch-js_src_jit_ExecutableAllocator_cpp Log message: 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 TARGET_OS_IPHONE +#if defined(__OpenBSD__) || TARGET_OS_IPHONE bool ExecutableAllocator::nonWritableJitCode = true; #else 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.

(Comments are closed)

  1. By Ed Ahlsen-Girard ( on

    How are test results preferred? I have noticed a hit.

  2. By Anonymous Coward ( on

    Note that the first package version with this in is 41.0.2p0. At the time of writing it's in the i386 package snapshot but not amd64 yet, though that will change soon.


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]