-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Synthetic object files disable control flow protection features #103001
Copy link
Copy link
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-securityArea: Security (example: address space layout randomization).Area: Security (example: address space layout randomization).C-bugCategory: This is a bug.Category: This is a bug.PG-exploit-mitigationsProject group: Exploit mitigationsProject group: Exploit mitigations
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-securityArea: Security (example: address space layout randomization).Area: Security (example: address space layout randomization).C-bugCategory: This is a bug.Category: This is a bug.PG-exploit-mitigationsProject group: Exploit mitigationsProject group: Exploit mitigations
Type
Fields
Give feedbackNo fields configured for issues without a type.
I noticed that the synthetic object files added in #95604 will disable the IBT (on x86, enabled by
-Z cf-protection=branch) and BTI (on AArch64, enabled by-Z branch-protection=bti) features because the object files are missing.note.gnu.propertysections indicating that the object file is compatible with those features. Normally, if an object file is missing a.note.gnu.propertysection, the linker will disable all such features, on the assumption that the object file is not compatible.This issue is reproducible on the master branch (slightly awkwardly because many distros don't ship IBT-enabled
*crt*.ofiles, and neither is it enabled in Rust's standard library by default):In another directory:
After commenting out the line of code that adds
symbols.oto the link:the binary has the correct property note: