Skip to content

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

Merged
carlossanlop merged 1 commit into
release/7.0from
backport/pr-79846-to-release/7.0
Jan 5, 2023
Merged

[release/7.0] Make DacValidateMD more resilient to invalid MethodDesc#79862
carlossanlop merged 1 commit into
release/7.0from
backport/pr-79846-to-release/7.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Dec 20, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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:-

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

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
Contributor

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.0Jan 5, 2023
@carlossanlop
carlossanlop deleted the backport/pr-79846-to-release/7.0 branch January 5, 2023 19:40
@ghostghost locked as resolved and limited conversation to collaborators Feb 5, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Diagnostics-coreclrServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@carlossanlop@jeffschwMSFT@mikem8361@hoyosjs@janvorli@rbhanda