Merge pull request #707 from JOE1994/0065-v9

v9: SyncRef's clone() and debug() allow data races
This commit is contained in:
Sergey "Shnatsel" Davidoff
2021-01-30 19:04:45 +01:00
committed by GitHub

View File

@@ -0,0 +1,18 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "v9"
date = "2020-12-18"
url = "https://github.com/purpleposeidon/v9/issues/1"
categories = ["memory-corruption", "thread-safety"]
[versions]
patched = []
```
# SyncRef's clone() and debug() allow data races
Affected versions of this crate unconditionally implement `Sync` for `SyncRef<T>`.
This definition allows data races if `&T` is accessible through `&SyncRef`.
`SyncRef<T>` derives `Clone` and `Debug`, and the default implementations of those traits access `&T` by invoking `T::clone()` & `T::fmt()`. It is possible to create data races & undefined behavior by concurrently invoking `SyncRef<T>::clone()` or `SyncRef<T>::fmt()` from multiple threads with `T: !Sync`.