From b565fa4171d8ad95e9002b162d6d0908e64faa0c Mon Sep 17 00:00:00 2001 From: Ilia K Date: Tue, 21 Mar 2023 11:43:15 +0100 Subject: [PATCH 1/3] Fix reserving executable memory as per allocation type in ClrVirtualAllocWithinRange() Fixes #83818 --- src/coreclr/utilcode/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/utilcode/util.cpp b/src/coreclr/utilcode/util.cpp index 623ef923516ce5..26f09eea2564c1 100644 --- a/src/coreclr/utilcode/util.cpp +++ b/src/coreclr/utilcode/util.cpp @@ -369,7 +369,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, { NOTHROW; PRECONDITION(dwSize != 0); - PRECONDITION(flAllocationType == MEM_RESERVE); + PRECONDITION(flAllocationType == MEM_RESERVE); // ORed with MEM_RESERVE_EXECUTABLE on Unix } CONTRACTL_END; @@ -449,7 +449,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, (mbInfo.RegionSize >= (SIZE_T) dwSize || mbInfo.RegionSize == 0)) { // Try reserving the memory using VirtualAlloc now - pResult = (BYTE*)ClrVirtualAlloc(tryAddr, dwSize, MEM_RESERVE, flProtect); + pResult = (BYTE*)ClrVirtualAlloc(tryAddr, dwSize, flAllocationType, flProtect); // Normally this will be successful // From 60c3813546597975a6049dff28b0fc624be73270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Mon, 10 Apr 2023 13:20:08 -0600 Subject: [PATCH 2/3] Revert NuGet.config unexpected change. --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 1eaea524958636..82b1ce9063aa65 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - +