HistoryEditJSON (OSV)

RUSTSEC-2020-0070

Some lock_api lock guard objects can cause data races

Reported
Issued
Package
lock_api (crates.io)
Type
INFO Unsound
Categories
Keywords
#concurrency
Aliases
References
Patched
  • >=0.4.2
Affected Functions
Version
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

Description

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

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.

Advisory available under CC0-1.0 license.