Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

W^X concerns with C++/CLI #69691

Closed
AaronRobinsonMSFT opened this issue May 23, 2022 · 1 comment
Closed

W^X concerns with C++/CLI #69691

AaronRobinsonMSFT opened this issue May 23, 2022 · 1 comment

Comments

@AaronRobinsonMSFT
Copy link
Member

AaronRobinsonMSFT commented May 23, 2022

@jkoritzinsky:
We create an executable heap with this code

g_heapHandle = HeapCreate(HEAP_CREATE_ENABLE_EXECUTE, 0, 0);

and then write to the data on that heap here:

bootstrap_thunk_chunk* chunk = new (pbChunk) bootstrap_thunk_chunk(numThunks, (pal::dll_t)pe.GetBase());

@janvorli:
Since the host cannot use coreclr PAL or coreclr itself, we’ll need to have a separate implementation of the necessary stuff for it. It seems that the thunks are just created at the initialization time and never changed again. We could possibly just allocate the block of thunks with page granularity as RW and then switch them to RX after they are initialized. But we would waste part of the last page allocated for the thunks. An outstanding question is, how many of these thunks we have and whether the waste would be significant. Perhaps we could reuse the coreclr minipal in the host and use the double mapping implementation. Since the minipal is a native piece of code that uses standard platform headers / libraries, it seems it would work too.

Related: #50391 and #69672

/cc @dotnet/interop-contrib

@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.0 milestone May 23, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT modified the milestones: 7.0.0, 8.0.0 Aug 5, 2022
@jkoritzinsky jkoritzinsky modified the milestones: 8.0.0, 9.0.0 Jul 19, 2023
@agocke
Copy link
Member

agocke commented Jul 29, 2024

Closing until we get some signal that this is blocking.

@agocke agocke closed this as completed Jul 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
Archived in project
Development

No branches or pull requests

3 participants