Skip to content

Conversation

MichalStrehovsky
Copy link
Member

Would fix #113114.

Opening as a draft, just want to see what the CI says.

I already know this has problems with CFG. SetProcessValidCallTargets works fine first time we call it for the thunks block that is still within the image. But second time we call it when a remapping actually happens, it fails and the thunks are not marked as valid call targets.

Cc @filipnavara (I'm including your x86 fix for testing but this could easily be a separate pull request once this is validated - so that you get the credit... and the blame).

Cc @dotnet/ilc-contrib

@filipnavara
Copy link
Member

I'm including your x86 fix for testing but this could easily be a separate pull request once this is validated - so that you get the credit...

No need for credit, but I am pretty sure I messed up the relative addressing, so I'd need to address that anyway :)

@MichalStrehovsky
Copy link
Member Author

Oh, actually this won't work at all.

If I do:

PROCESS_MITIGATION_DYNAMIC_CODE_POLICY pp = {};
pp.ProhibitDynamicCode = 1;

SetProcessMitigationPolicy(ProcessDynamicCodePolicy, &pp, sizeof(pp));

Then this part:

I already know this has problems with CFG. SetProcessValidCallTargets works fine first time we call it for the thunks block that is still within the image.

Actually becomes: SetProcessValidCallTargets seems to fail with an access denied on the first attempt to call it.

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky
Copy link
Member Author

Closing due to reasons explained in #113114.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ThunkPool doesn't work with PROCESS_MITIGATION_DYNAMIC_CODE_POLICY
2 participants