-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Labels
I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
Description
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
$(#[$meta])* | |
static mut $name: (::core::mem::MaybeUninit<$ty>, bool) = | |
(::core::mem::MaybeUninit::uninit(), false); |
We could potentially put the bool
in a separate static that is in the "normal" .bss
section, but we'd have to document this.
Metadata
Metadata
Assignees
Labels
I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness