Uh oh!
There was an error while loading. Please reload this page.
[Mono] Fix OP_CHECK_THIS to read 1 byte instead of 4/8 on x86/x64/LLVM. - #74638
Merged
Merged
Conversation
lateralusX
requested review from
SamMonoRT, lambdageek and vargaz
as code ownersAugust 26, 2022 09:57
lambdageek
approved these changes
Aug 26, 2022
lambdageek
commented
Aug 26, 2022
Member
We should backport this |
lateralusX
commented
Aug 29, 2022
MemberAuthor
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
MemberAuthor
Failures in runtime-extra-platforms seems unrelated and appears on multiple other PR's. |
lateralusX
commented
Aug 29, 2022
MemberAuthor
/backport to release/7.0 |
Contributor
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/2950110740 |
Current implementation of OP_CHECK_THIS on x86/x64 and LLVM does a memory read of at least 4 bytes. This creates an issue when the target is a managed pointer, since that could point to the interior of a type, meaning it can read pass the allocated memory causing a crash. Fix change the size of the read to one byte since the only reason doing the read is to validate that the reference, managed pointer is not NULL. Reading only one byte is also inline with how it is implemented on arm/arm64, and it will reduce potential unaligned reads on x86/x64. Full fix for, dotnet#74179.
lateralusXforce-pushed
the
lateralusX/fix-74179-codegen
branch
from
August 30, 2022 07:36
182ec36 to
31fabbdComparelateralusX
commented
Aug 30, 2022
MemberAuthor
Rebased to get CI run after #74567 had been merged and tests had been re-enabled. |
lateralusX
commented
Aug 30, 2022
MemberAuthor
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
MemberAuthor
Failures looks unrelated and had failed in similar ways on other PR's as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current implementation of OP_CHECK_THIS on x86/x64 and LLVM does a memory read of at least 4 bytes. This creates an issue when the target is a managed pointer, since that could point to the interior of a type, meaning it can read pass the allocated memory causing a crash. Fix change the size of the read to one byte since the only reason doing the read is to validate that the reference, managed pointer is not NULL. Reading only one byte is also inline with how it is implemented on arm/arm64, and it will reduce potential unaligned reads on x86/x64.
Full fix for, #74179.
Fixes#74179