I just committed a little change to MoarVM that'll turn off the jit if
we notice we're not allowed to turn a page executable.

   
https://github.com/MoarVM/MoarVM/commit/b07acdfd92a88d1e40ad42c1c853922b20f1a056

now it won't crash if deny_execmem is turned on. it'll just be slower.

There's apparently a way around this which involves creating a temporary
file (immediately unlinked) and mmapping it into memory twice (once
writable, once executable). That's a bit hairy, since we can't assume
that /tmp isn't mounted "noexec". However, we could notice we're not
allowed to change modes on a page and just switch over to the
file-mapped-twice approach and only disable the jit completely if that
fails (because "noexec" or because no write permissions to /tmp or
something like that).

that's very internalsy and i'd like brrt - our jit maker - to look over
this a bit before attempting anything more drastic

thanks!
  - Timo

Reply via email to