On Sat, 13 Jun 2015, Ted Unangst wrote:

> So I was supposed to be working on making the JIT engine conform to W^X a few
> months ago. It took a bit longer than expected, but I had a mostly working
> patch. Then I disappeared from OpenBSD for a bit and took my patch with me.
> Last week I was just starting to feed that patch upstream to firefox, when I
> found out about another developer who had already done similar work. Sigh.
> 
> The official firefox patch seems likely to ship in some future version, which
> is good news for everyone. It's quite similar to the patch I had (though more
> polished). To make it available sooner for OpenBSD, here's a backport to the
> Firefox in ports.
> 
> I haven't been able to test this very much, as I'm still at BSDCan, but when I
> get back next week I hope to be able to devote more time to finalizing this
> patch. Posting now to let people know it's coming and to give a preview if
> you're interested.

Hi!

The official patch is now in.

I don't know why it's enabled exclusively for iOS (maybe because it's
the only platform that has been thoroughly tested? Or because major
linux distros are not yet ready), probably Landry can shed some light
on this...

Btw, my firefox-41.0.1 (rebuilt with the patch below) still hasn't
exploded during my tests: routinary browsing, GMail, Google Maps,
Twitter, etc...

Comments? Opinions?

Ciao,
David

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/mozilla-firefox/Makefile,v
retrieving revision 1.280
diff -u -p -u -p -r1.280 Makefile
--- Makefile    5 Oct 2015 08:48:14 -0000       1.280
+++ Makefile    16 Oct 2015 07:52:32 -0000
@@ -8,6 +8,7 @@ MOZILLA_VERSION =       41.0.1
 MOZILLA_BRANCH =       release
 MOZILLA_PROJECT =      firefox
 MOZILLA_CODENAME =     browser
+REVISION =             0
 BROKEN-sparc64 =       xpcshell SIGBUS during fake
 EXTRACT_SUFX =         .tar.xz
 
Index: patches/patch-js_src_jit_ExecutableAllocator_cpp
===================================================================
RCS file: patches/patch-js_src_jit_ExecutableAllocator_cpp
diff -N patches/patch-js_src_jit_ExecutableAllocator_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-js_src_jit_ExecutableAllocator_cpp    16 Oct 2015 07:52:32 
-0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Mark JIT pages as non-writable
+
+--- js/src/jit/ExecutableAllocator.cpp.orig    Thu Oct 15 12:47:51 2015
++++ js/src/jit/ExecutableAllocator.cpp Thu Oct 15 12:48:15 2015
+@@ -88,8 +88,4 @@ ExecutableAllocator::addSizeOfCode(JS::CodeSizes* size
+     }
+ }
+ 
+-#if TARGET_OS_IPHONE
+ bool ExecutableAllocator::nonWritableJitCode = true;
+-#else
+-bool ExecutableAllocator::nonWritableJitCode = false;
+-#endif

Reply via email to