Skip to content

Conversation

@lambdageek
Copy link
Member

@lambdageek lambdageek commented Jul 12, 2024

Contributes to #99302

This is largely a placeholder just to get the MethodDesc/MethodDescChunk infrastructure in place. To further fill out ValidateMethodDesc and to implement the GetMethodDescData DAC API, I also need to add an executable code manager contract for mapping between native code pointer values and methods. I'd like to do that as a separate PR.

Debugged WinDbg enough to verify that GetMethodDescData is implemented enough to extract the correct MethodTable pointer value from a MethodDesc.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

{
// may throw if the method desc at methodDescPointer is corrupted
// we bypass the target data cache here because we don't want to cache non-validated data
Data.MethodDesc desc = new Data.MethodDesc(_target, methodDescPointer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the existing non-validated types, we only read the parts that are needed to do the validation. For this, we're always going to read everything on MethodDesc/MethodDescChunk - are we expecting to need most of it / do we care about trying to read only what is needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're going to need to access most of the fields of the MethodDesc base class for validation: you have to compute the MethodDescChunk address right away, and after that the first check is looking at the flags and the slot.

lambdageek and others added 2 commits July 20, 2024 09:36
Co-authored-by: Elinor Fung <elfung@microsoft.com>
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.

3 participants