Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 28, 2022

Backport of #64469 to release/6.0

/cc @lambdageek

Customer Impact

Valid customer code that copies object[] to a more specific array type with Enum elements may throw unexpected InvalidCastExceptions on WebAssembly, iOS and Android despite working in desktop configurations.

Testing

Manual testing and CI regression testing.

Risk

Moderate: The fix removes a one type check and relaxes another before performing an unsafe copy operation. Existing code is unlikely to become broken. New code may incorrectly allow an unexpected copy of some valuetypes leading to silent data corruption instead of a runtime exception.

where each element in the source array is the appropriate type
When we have to resort to checking element by element, compare the type of each
actual element with the destination type. In particular, not the destinations
underlying type when it's an enum - we don't want to allow unrelated enums
using the same representation to copy over.

Fixes #64387
@github-actions github-actions bot requested a review from marek-safar as a code owner January 28, 2022 23:57
@ghost
Copy link

ghost commented Jan 28, 2022

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@lambdageek lambdageek added Servicing-consider Issue for next servicing release review area-CoreLib-mono labels Jan 29, 2022
@lewing lewing added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 1, 2022
@lambdageek
Copy link
Member

coreclr failure is unrelated

@marek-safar marek-safar added this to the 6.0.x milestone Feb 1, 2022
@safern
Copy link
Member

safern commented Feb 7, 2022

Failure is: #64389

@safern safern merged commit c849005 into release/6.0 Feb 7, 2022
@safern safern deleted the backport/pr-64469-to-release/6.0 branch February 7, 2022 19:41
@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants