Lucene search

K
osvGoogleOSV:RUSTSEC-2020-0059
HistoryOct 22, 2020 - 12:00 p.m.

MutexGuard::map can cause a data race in safe code

2020-10-2212:00:00
Google
osv.dev
9

0.0004 Low

EPSS

Percentile

12.8%

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.

CPENameOperatorVersion
futures-utilge0.3.2
futures-utillt0.3.7

0.0004 Low

EPSS

Percentile

12.8%

Related for OSV:RUSTSEC-2020-0059