Skip to content

Commit dd8d97e

Browse files
rzscclamp03jkotas
authored
[RISC-V] Disable EnableWriteXorExecute by default on riscv64 architectue (#103408)
* Disable EnableWriteXorExecute by default on riscv64 architectue On riscv64 architectue any dotnet process that loads corossgened assembly without DOTNET_EnableWriteXorExecute=0 environment variable set crashes with "Segmentation fault" error. For example System.Private.CoreLib.dll is compiled with crossgen2 by default during build phase so this crash applies to any processes that loads it. Setting EnableWriteXorExecute=0 disables this options on riscv64 architecure and prevents these crashes. Co-authored-by: Dong-Heon Jung <[email protected]> * Add a link to an issue about re-enabling WriteXorExecute on riscv64 arch. Co-authored-by: Jan Kotas <[email protected]> --------- Co-authored-by: Dong-Heon Jung <[email protected]> Co-authored-by: Jan Kotas <[email protected]>
1 parent 121230d commit dd8d97e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/coreclr/inc/clrconfigvalues.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,12 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_LTTng, W("LTTng"), 1, "If DOTNET_LTTng is s
722722
//
723723
// Executable code
724724
//
725+
// TODO: https://github.com/dotnet/runtime/issues/103465
726+
#ifdef TARGET_RISCV64
727+
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableWriteXorExecute, W("EnableWriteXorExecute"), 0, "Enable W^X for executable memory.");
728+
#else
725729
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableWriteXorExecute, W("EnableWriteXorExecute"), 1, "Enable W^X for executable memory.");
730+
#endif // TARGET_RISCV64
726731

727732
#ifdef FEATURE_GDBJIT
728733
///

0 commit comments

Comments
 (0)