Skip to content

JIT: Ensure no overflow in ContainBlockStoreAddress - #76532

Merged
jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:fix-76506
Oct 3, 2022
Merged

JIT: Ensure no overflow in ContainBlockStoreAddress#76532
jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:fix-76506

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

The offset here can be a "base" address due to various JIT transformations so we should ensure the range [offset, offset+size) does not overflow.

Fix#76506

The offset here can be a "base" address due to various JIT
transformations so we should ensure the range [offset, offset+size) does
not overflow.
Fixdotnet#76506
@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 3, 2022
@ghostghost assigned jakobbotschOct 3, 2022
@ghost

ghost commented Oct 3, 2022

Copy link
Copy Markdown

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

Issue Details

The offset here can be a "base" address due to various JIT transformations so we should ensure the range [offset, offset+size) does not overflow.

Fix #76506

Author:jakobbotsch
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

Before #76273 we would see GT_ADDEX here so we wouldn't end up containing it.

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr jitstress

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@kunalspathak

Copy link
Copy Markdown
Contributor

cc: @tannergooding

}
#endif // TARGET_ARM
#else // !TARGET_ARM
if ((ClrSafeInt<int>(offset) + ClrSafeInt<int>(size)).IsOverflow())

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.

Can this overflow on arm too? Should this be outside the ifdef?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I think the ARM specific check above is fine -- we only get here for unrolled block copies so size is guaranteed to be small.

@tannergooding

tannergooding commented Oct 3, 2022

Copy link
Copy Markdown
Member

Some of the remaining failures may be related to the pending fix: #76517

@tannergooding

Copy link
Copy Markdown
Member

The failure for Runtime_40607 is #76546

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

#76507 also still seems to be failing even with this fix.

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

Bruce just opened #76550 for the remaining failure.

@jakobbotsch

jakobbotsch commented Oct 3, 2022

Copy link
Copy Markdown
MemberAuthor

superpmi-diffs failure is #76542. superpmi-replay failure is #76511. Still just waiting for the win-arm64 testing to finish...

@jakobbotsch
jakobbotsch merged commit a45611a into dotnet:mainOct 3, 2022
@jakobbotsch
jakobbotsch deleted the fix-76506 branch October 3, 2022 19:18
@ghostghost locked as resolved and limited conversation to collaborators Nov 3, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: access violation in cpblk tests

4 participants

@jakobbotsch@kunalspathak@tannergooding@jkotas