Advisory

GHSA-w59h-378f-2frm

Also known as: RUSTSEC-2024-0005

Summary

Unsound sending of non-Send types across threads in threadalone

Details

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][mutexguard]. If used with Rc, there would be a data race on the
reference count, which is likewise undefined behavior.

[mutexguard]: https://github.com/rust-lang/rust/issues/23465#issuecomment-82730326

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-01-23 14:43 UTC
Modified
2024-02-10 16:26 UTC

Affected packages and fixes

threadalone

crates.io · All systems

Affected

  • introduced 0, fixed 0.2.1 (semver)

Fixed versions

0.2.1

Fix

  • Fixed version 0.2.1
    cargo update -p threadalone --precise 0.2.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences