Data races in generator
Moderate severity
GitHub Reviewed
Published
Aug 25, 2021
to the GitHub Advisory Database
•
Updated Feb 3, 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 3, 2023
The
Generator
type is an iterable which uses a generator function that yieldsvalues. In affected versions of the crate, the provided function yielding values
had no
Send
bounds despite theGenerator
itself implementingSend
.The generator function lacking a
Send
bound means that types that aredangerous to send across threads such as
Rc
could be sent as part of agenerator, potentially leading to data races.
This flaw was fixed in commit
f7d120a3b
by enforcing that the generator function be bound by
Send
.References