Skip to content

BitArray race conditions may lead to memory corruption #30141

@GrabYourPitchforks

Description

@GrabYourPitchforks

As of dotnet/corefx#33781, the BitArray class contains unsafe code as a performance optimization. Since BitArray instances are not thread-safe, this opens the possibility that improper cross-thread access to a BitArray instance may result in global memory corruption.

We should modify the BitArray internal logic to be resilient against this possibility. We don't need to make the type thread-safe, but improper cross-thread access shouldn't be able to cause damage beyond corruption of the individual BitArray instances involved.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions