Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report soundness bug with lock_api #483

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions crates/lock_api/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "lock_api"
date = "2020-11-08"
url = "https://github.com/Amanieu/parking_lot/pull/262"
categories = ["memory-corruption"]
keywords = ["concurrency"]
informational = "unsound"

[versions]
patched = [">= 0.4.2"]

[affected.functions]
"lock_api::MappedMutexGuard" = [">= 0.1.0"]
"lock_api::MappedRwLockReadGuard" = [">= 0.1.0"]
"lock_api::MappedRwLockWriteGuard" = [">= 0.1.0"]
"lock_api::RwLockReadGuard" = [">= 0.1.0"]
"lock_api::RwLockWriteGuard" = [">= 0.1.0"]
```

# Some lock_api lock guard objects can cause data races

Affected versions of lock_api had unsound implementations of the `Send` or
`Sync` traits for some guard objects, namely:

* MappedMutexGuard
* MappedRwLockReadGuard
* MappedRwLockWriteGuard
* RwLockReadGuard
* RwLockWriteGuard

These guards could allow data races through types that are not safe to `Send`
across thread boundaries in safe Rust code.

This issue was fixed by changing the trait bounds on the `Mapped` guard types
and removing the `Sync` trait for the `RwLock` guards.