crossbeam-channel Undefined Behavior before v0.4.4
High severity
GitHub Reviewed
Published
Oct 14, 2020
in
crossbeam-rs/crossbeam
•
Updated Jun 13, 2023
Description
Published by the National Vulnerability Database
Oct 16, 2020
Reviewed
Aug 3, 2021
Published to the GitHub Advisory Database
Aug 25, 2021
Last updated
Jun 13, 2023
Impact
The affected version of this crate's the
bounded
channel incorrectly assumes thatVec::from_iter
has allocated capacity that same as the number of iterator elements.Vec::from_iter
does not actually guarantee that and may allocate extra memory. The destructor of thebounded
channel reconstructsVec
from the raw pointer based on the incorrect assumes described above. This is unsound and causing deallocation with the incorrect capacity whenVec::from_iter
has allocated different sizes with the number of iterator elements.Patches
This has been fixed in crossbeam-channel 0.4.4.
We recommend users to upgrade to 0.4.4.
References
See crossbeam-rs/crossbeam#533, crossbeam-rs/crossbeam#539, and rustsec/advisory-db#425 for more details.
License
This advisory is in the public domain.
References