diff --git a/racket/src/racket/sconfig.h b/racket/src/racket/sconfig.h index 07ec0c1b67..404e9978ad 100644 --- a/racket/src/racket/sconfig.h +++ b/racket/src/racket/sconfig.h @@ -212,6 +212,7 @@ # if defined(__x86_64__) # define SCHEME_PLATFORM_LIBRARY_SUBPATH "x86_64-openbsd" +# define IMPLEMENT_WRITE_XOR_EXECUTE_BY_SIGNAL_HANDLER # elif defined(__i386__) || defined(i386) # define SCHEME_PLATFORM_LIBRARY_SUBPATH "i386-openbsd" # elif defined(__mips64__) @@ -249,7 +250,6 @@ # define USE_IEEE_FP_PREDS # define USE_MAP_ANON -# define IMPLEMENT_WRITE_XOR_EXECUTE_BY_SIGNAL_HANDLER # if defined(__x86_64__) # define MZ_USE_JIT_X86_64 diff --git a/racket/src/racket/src/salloc.c b/racket/src/racket/src/salloc.c index 7b0c7a0439..38cfc74bb2 100644 --- a/racket/src/racket/src/salloc.c +++ b/racket/src/racket/src/salloc.c @@ -110,6 +110,11 @@ static void init_allocation_callback(void); #endif #ifdef IMPLEMENT_WRITE_XOR_EXECUTE_BY_SIGNAL_HANDLER +/* For this option to work, the `si->si_addr` value provided + to the signal handler on a no-execute-permission signal + must be the address that isn't executable, as opposed to + the address of an instruction that tried to call or jump to + a non-executable address. */ static void install_w_xor_x_handler(); static void register_as_executable(void *p, size_t len, int can_exec); #endif