Headline
GHSA-w59h-378f-2frm: Unsound sending of non-Send types across threads in threadalone
Affected versions can run the Drop
impl of a non-Send type on a different
thread than it was created on.
The flaw occurs when a stderr write performed by the threadalone
crate fails,
for example because stderr is redirected to a location on a filesystem that is
full, or because stderr is a pipe that has been closed by the reader.
Dropping a non-Send type on the wrong thread is unsound. If used with a type
such as a pthread-based MutexGuard
, the consequence is undefined
behavior. If used with Rc
, there would be a data race on the
reference count, which is likewise undefined behavior.
Skip to content
Actions
Automate any workflow
Packages
Host and manage packages
Security
Find and fix vulnerabilities
Codespaces
Instant dev environments
Copilot
Write better code with AI
Code review
Manage code changes
Issues
Plan and track work
Discussions
Collaborate outside of code
GitHub Sponsors
Fund open source developers
* The ReadME Project
GitHub community articles
- Pricing
- GitHub Advisory Database
- GitHub Reviewed
- GHSA-w59h-378f-2frm
Unsound sending of non-Send types across threads in threadalone
Moderate severity GitHub Reviewed Published Jan 23, 2024 to the GitHub Advisory Database
Package
cargo threadalone (Rust)
Affected versions
< 0.2.1
Description
Affected versions can run the Drop impl of a non-Send type on a different
thread than it was created on.
The flaw occurs when a stderr write performed by the threadalone crate fails,
for example because stderr is redirected to a location on a filesystem that is
full, or because stderr is a pipe that has been closed by the reader.
Dropping a non-Send type on the wrong thread is unsound. If used with a type
such as a pthread-based MutexGuard, the consequence is undefined
behavior. If used with Rc, there would be a data race on the
reference count, which is likewise undefined behavior.
References
- cr0sh/threadalone#1
- https://rustsec.org/advisories/RUSTSEC-2024-0005.html
Published to the GitHub Advisory Database
Jan 23, 2024