std personality _Unwind_Action should not be a enum #138558
Labels
A-panic
Area: Panicking machinery
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-high
High priority
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
The personality function takes an
_Unwind_Action
as an argument.rust/library/std/src/sys/personality/gcc.rs
Lines 208 to 211 in d497e43
This is declared in the unwind crate as an enum
rust/library/unwind/src/unwinding.rs
Lines 5 to 13 in d497e43
But in reality, this is actually bit flags:
(from https://gitlab.com/x86-psABIs/x86-64-ABI 6.2.6)
This means that invalid values are being passed to this function, which is undefined behavior (since the only valid values for an enum are its exact variants).
(found by @pitust)
The text was updated successfully, but these errors were encountered: