arc::Weak::upgrade
does not account for overflow
#30031
Labels
A-atomic
Area: Atomics, barriers, and sync primitives
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
Similar to the issue fixed in #27174, these two methods do not account for overflow, causing use-after-frees in extremely contrived situations on machines with 32-bit
usize
s.Both of these examples exhibit the erroneous behavior when compiled and run with
-C opt-level=3 --target=i686-unknown-linux-gnu
:downgrade.rs
:upgrade.rs
:Note that I've been working on a general consolidation of both reference-counted types at https://github.com/apasel422/ref_count.
The text was updated successfully, but these errors were encountered: