Skip to content

Concurrent read and dispose zlib race condition #128550

@alinpahontu2912

Description

@alinpahontu2912

Description

A race condition exists between inflate operations and disposal. Inflater synchronizes reads with SyncLock, but Dispose() is not synchronized, allowing the underlying zlib state to be released while an inflate call is in progress, leading to possible crashes.

Reproduction Steps

Attempt multiple Read and Dispose operations on the same DeflateStream.

Expected behavior

Dispose should not be able to release the native inflater state while an inflate call is in progress.

Actual behavior

Concurrent Read and Dispose can result in invalid native state being used during decompression.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions