cortex_m::singleton
attribute forwarding is unsound in some cases
#538
Labels
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
If you use
link_section
to put a singleton in an uninit section, the "has been taken" boolean is also in uninit memory at startup. We read this value which is uninitialized.cortex-m/cortex-m/src/macros.rs
Lines 72 to 74 in f3f85e6
We could potentially put the
bool
in a separate static that is in the "normal".bss
section, but we'd have to document this.CC @jordens and #522
The text was updated successfully, but these errors were encountered: