Commit 8b726534 authored by PHO's avatar PHO Committed by Marge Bot
Browse files

Fix rts allocateExec() on NetBSD

Similar to SELinux, NetBSD "PaX mprotect" prohibits marking a page
mapping both writable and executable at the same time. Use libffi
which knows how to work around it.
parent 6e2d9ee2
...@@ -1595,11 +1595,12 @@ void flushExec (W_ len, AdjustorExecutable exec_addr) ...@@ -1595,11 +1595,12 @@ void flushExec (W_ len, AdjustorExecutable exec_addr)
#endif #endif
} }
#if defined(linux_HOST_OS) #if defined(linux_HOST_OS) || defined(netbsd_HOST_OS)
// On Linux we need to use libffi for allocating executable memory, // On Linux we need to use libffi for allocating executable memory,
// because it knows how to work around the restrictions put in place // because it knows how to work around the restrictions put in place
// by SELinux. // by SELinux. The same goes for NetBSD where it is prohibited to
// mark a page mapping both writable and executable at the same time.
AdjustorWritable allocateExec (W_ bytes, AdjustorExecutable *exec_ret) AdjustorWritable allocateExec (W_ bytes, AdjustorExecutable *exec_ret)
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment