Skip to content
Snippets Groups Projects
Commit d3a1c675 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Allow RWX pages on NetBSD and OpenBSD.

By default, both NetBSD and OpenBSD will not allow pages to be mapped
both writable and executable.

On OpenBSD, if the filesystem is mounted with the wxallowed option,
this would work, and before v6.0, passing -z wxallowed to the linker
would allow it on a per-binary basis.  However, since this is not
the default, and since the JS engine can use mprotect() to switch
between RW and RX, I've decided to enable this instead.  This will
slow things down, but it will work "out of the box".

For NetBSD, the situation is different, you can't switch between
RW and RX using mprotect()... instead, you need to use mremap() to
get a separate mapping for each set of perms.  This does *not*
appear to be present in the 1.8.5 source, so we can't do the same
fix as OpenBSD.  Instead, NetBSD allows paxctl to add an elf note
indicating that RWX is needed, and it "just works" (by default).
parent dc440697
No related branches found
No related tags found
No related merge requests found
Pipeline #5498 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment