RUSTSEC-2020-0059
Dashboard / Vulnerabilities / RUSTSEC-2020-0059
RUSTSEC-2020-0059
Summary: MutexGuard::map can cause a data race in safe code
Details: Affected versions of the crate had a Send/Sync implementation for MappedMutexGuard that only considered variance on T, while MappedMutexGuard dereferenced to U. This could of led to data races in safe Rust code when a closure used in MutexGuard::map() returns U that is unrelated to T. The issue was fixed by fixing `Send` and `Sync` implementations, and by adding a `PhantomData<&'a mut U>` marker to the `MappedMutexGuard` type to tell the compiler that the guard is over U too.
References: https://crates.io/crates/futures-util, https://rustsec.org/advisories/RUSTSEC-2020-0059.html, https://github.com/rust-lang/futures-rs/issues/2239
Affected packages
Package
Name: futures-util
Purl: pkg:cargo/futures-util
Affected ranges
Type: SEMVER
Events:
