Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[release/7.0] Make DacValidateMD more resilient to invalid MethodDesc #79862

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 20, 2022

Backport of #79846 to release/7.0

/cc @janvorli

Customer Impact

BenchmarkDotNet crashes when attempting to translate addresses to methods in its disassembly feature

Testing

BenchmarkDotNet tests

Risk

Very low, it just explicitly detects NULL MethodTable in MethodDesc as invalid. Without this detection, the DacValidateMD when passed an invalid MethodDesc with NULL MethodTable just crashes the process with AV. This change is in DAC only.

The DacValidateMD is not resilient to invalid MethodDesc that contains
NULL in its m_pMethTab field. It was found when using the ClrMD in the
BenchmarkDotNet disassembler code which is trying to find if some constants
in the code represent MethodDesc so that it can dump the related method
name.

This change fixes it by checking the MethodTable after it is extracted
from the MethodDesc. There are two values that are not translated between
the target and the debugger sides - NULL and -1. So I have added handling
both as invalid there.
@ghost
Copy link

ghost commented Dec 20, 2022

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

Issue Details

Backport of #79846 to release/7.0

/cc @janvorli

Customer Impact

Testing

Risk

IMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-Diagnostics-coreclr

Milestone: -

@janvorli janvorli self-assigned this Dec 20, 2022
@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Dec 20, 2022
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we will take for consideration in 7.0.x

@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 5, 2023
@rbhanda rbhanda added this to the 7.0.3 milestone Jan 5, 2023
@carlossanlop
Copy link
Member

Approved by Tactics (7.0.3).
Signed off by area owners.
No OOB changes needed.
CI green.
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit 88cff5e into release/7.0 Jan 5, 2023
@carlossanlop carlossanlop deleted the backport/pr-79846-to-release/7.0 branch January 5, 2023 19:40
@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants