From 901fd656ddda9153dbf46dfa4591ec7cacc03fe0 Mon Sep 17 00:00:00 2001 From: Basile Picard <4pipopolam@gmail.com> Date: Mon, 29 Apr 2024 08:54:50 +0300 Subject: [PATCH] Read EnableWriteXorExecute from runtimeConfig (#101490) * Read System.Runtime.EnableWriteXorExecute from config. * Fixed default value for W^X enabling option. * Revert "Fixed default value for W^X enabling option." This reverts commit b6857a1a9a02b3ffb0f637ca9d30a394e6b21006. --------- Co-authored-by: Manish Godse <61718172+mangod9@users.noreply.github.com> --- src/coreclr/utilcode/executableallocator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/utilcode/executableallocator.cpp b/src/coreclr/utilcode/executableallocator.cpp index 65802615fc6aa..09a4801d2d5db 100644 --- a/src/coreclr/utilcode/executableallocator.cpp +++ b/src/coreclr/utilcode/executableallocator.cpp @@ -3,6 +3,7 @@ #include "pedecoder.h" #include "executableallocator.h" +#include #if USE_LAZY_PREFERRED_RANGE // Preferred region to allocate the code in. @@ -260,7 +261,7 @@ HRESULT ExecutableAllocator::StaticInitialize(FatalErrorHandler fatalErrorHandle #endif g_fatalErrorHandler = fatalErrorHandler; - g_isWXorXEnabled = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableWriteXorExecute) != 0; + g_isWXorXEnabled = Configuration::GetKnobBooleanValue(W("System.Runtime.EnableWriteXorExecute"), CLRConfig::EXTERNAL_EnableWriteXorExecute); g_instance = new (nothrow) ExecutableAllocator(); if (g_instance == NULL) {