-
-
Notifications
You must be signed in to change notification settings - Fork 15k
std personality _Unwind_Action should not be a enum #138558
Copy link
Copy link
Closed
Labels
A-panicArea: Panicking machineryArea: Panicking machineryA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.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/SoundnessP-highHigh priorityHigh priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Metadata
Metadata
Assignees
Labels
A-panicArea: Panicking machineryArea: Panicking machineryA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.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/SoundnessP-highHigh priorityHigh priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The personality function takes an
_Unwind_Actionas 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)