-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
OSX CFI produces relocation issues #122848
Copy link
Copy link
Open
Labels
A-control-flow-integrityArea: Control Flow Integrity (CFI) security mitigationArea: Control Flow Integrity (CFI) security mitigationA-sanitizersArea: Sanitizers for correctness and code qualityArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.Category: This is a bug.O-macosOperating system: macOSOperating system: macOSPG-exploit-mitigationsProject group: Exploit mitigationsProject group: Exploit mitigationsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-control-flow-integrityArea: Control Flow Integrity (CFI) security mitigationArea: Control Flow Integrity (CFI) security mitigationA-sanitizersArea: Sanitizers for correctness and code qualityArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.Category: This is a bug.O-macosOperating system: macOSOperating system: macOSPG-exploit-mitigationsProject group: Exploit mitigationsProject group: Exploit mitigationsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
As seen when testing #122456
I tried this code:
compiled with
rustc --crate-type=bin -C prefer-dynamic=off -Clto -Zsanitizer=cfi -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0on OSXI expected to see this happen: Builds successfully
Instead, this happened: Relocation issues:
The patch being tested only adjusts labels, so this bug is about fixing actually producing CFI executables on OSX - all the previously existing tests were codegen only.
It is likely that a much smaller program (possibly anything with an indirect call? any function?) will trigger this issue without needing the
FnPtrShim, but I don't personally have a mac to test with.