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/8.0-rc2] JIT: Fix invalid containment of vector broadcasts #92371

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 20, 2023

Backport of #92333 to release/8.0-rc2

/cc @jakobbotsch

Customer Impact

The JIT may generate bad code for VectorXYZ<T>.Create(x) where x is a memory location of smaller size than T. In that case the JIT may incorrectly read the memory location using the larger type T.
For example, Vector128<int>.Create(x.ShortField) may generate bad code reading 4 bytes from ShortField instead of just 2. Customer reported in #83387.

Testing

Regression test included.

Risk

Low, disables the JIT's containment optimization in the affected cases.

The containment checks for vector broadcasts were missing a size check,
meaning that a uint broadcast could contain a ubyte/ushort indirection.
That would lead to out-of-bounds reads.

Fix #83387
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 20, 2023
@ghost
Copy link

ghost commented Sep 20, 2023

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

Issue Details

Backport of #92333 to release/8.0-rc2

/cc @jakobbotsch

Customer Impact

Testing

Risk

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

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

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member

jakobbotsch commented Sep 20, 2023

The issue here might be related to #92357, so I am waiting a bit to continue with this backport until we figure out exactly how they relate.

Edit: nope, that issue seems related to embedded broadcasts instead.

@jakobbotsch jakobbotsch added the Servicing-consider Issue for next servicing release review label Sep 21, 2023
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. please get a code review. we will take for consideration in RC2

@jeffschwMSFT jeffschwMSFT added this to the 8.0.0 milestone Sep 21, 2023
@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 21, 2023
@carlossanlop carlossanlop merged commit d365be8 into release/8.0-rc2 Sep 21, 2023
121 of 125 checks passed
@carlossanlop carlossanlop deleted the backport/pr-92333-to-release/8.0-rc2 branch September 21, 2023 22:37
@radical radical mentioned this pull request Sep 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants