Data race in ruspiro-singleton
High severity
GitHub Reviewed
Published
Aug 25, 2021
to the GitHub Advisory Database
•
Updated Jan 27, 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
Jan 27, 2023
Singleton<T>
is meant to be a static object that can be initialized lazily. Inorder to satisfy the requirement that
static
items must implementSync
,Singleton
implemented bothSync
andSend
unconditionally.This allows for a bug where non-
Sync
types such asCell
can be used insingletons and cause data races in concurrent programs.
The flaw was corrected in commit
b0d2bd20e
by adding trait bounds, requiringthe contaiend type to implement
Sync
.References