Skip to content

Commit

Permalink
Unsound sending of non-Send types in threadalone, patched (#1858)
Browse files Browse the repository at this point in the history
* Add advisory for threadalone

* Fix filename
  • Loading branch information
Shnatsel authored Jan 22, 2024
1 parent 78ab241 commit 412fc10
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions crates/threadalone/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "threadalone"
date = "2024-01-07"
url = "https://github.com/cr0sh/threadalone/issues/1"
informational = "unsound"

[versions]
patched = [">= 0.2.1"]
```

# Unsound sending of non-Send types across threads

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

0 comments on commit 412fc10

Please sign in to comment.