Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 9, 2024

Backport of #107266 to release/9.0

/cc @michaelgsharp

Customer Impact

  • Customer reported
  • Found internally

Fixes #106534. Essentially you could do this new TensorSpan<double>(array: new[] {1}); and the type was declared as a double, but because of how the automatic type works for inline arrays, the array: new[] {1} would actually be an array of ints. This is a safety issue as the backing memory would now be shorter than expected causing memory overwrite/access issues.

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

[How was the fix verified? How was the issue missed previously? What tests were added?]
Bug was missed because I didn't understand that behavior for the auto typing of the inline arrays so I didn't have a check for it. There is now a check for it as well as tests around it.

Risk

Low risk. Tensor is going to be a preview release and was added in this 9.0 release.

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.

@ghost ghost added the area-System.Numerics label Sep 9, 2024
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

@artl93 artl93 added the Servicing-approved Approved for servicing release label Sep 9, 2024
@artl93 artl93 merged commit d32b461 into release/9.0 Sep 9, 2024
@buyaa-n buyaa-n deleted the backport/pr-107266-to-release/9.0 branch September 12, 2024 22:12
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Numerics Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants