Data races in cache
High severity
GitHub Reviewed
Published
Aug 25, 2021
to the GitHub Advisory Database
•
Updated Feb 1, 2023
Description
Published by the National Vulnerability Database
Aug 8, 2021
Reviewed
Aug 18, 2021
Published to the GitHub Advisory Database
Aug 25, 2021
Last updated
Feb 1, 2023
An issue was discovered in the cache crate through 2020-11-24 for Rust.
Affected versions of this crate unconditionally implement Send/Sync for
Cache<K>
.This allows users to insert
K
that is not Send or not Sync.This allows users to create data races by using non-Send types like
Arc<Cell<T>>
orRc<T>
asK
inCache<K>
. It is also possible to create data races by using types likeCell<T>
orRefCell<T>
(types that areSend
but notSync
).Such data races can lead to memory corruption.
References