Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler Hardening Guide should include -fcf-protection #247

Closed
thomasnyman opened this issue Oct 9, 2023 · 3 comments
Closed

Compiler Hardening Guide should include -fcf-protection #247

thomasnyman opened this issue Oct 9, 2023 · 3 comments

Comments

@thomasnyman
Copy link
Contributor

Brought up during the C/C++ Compiler BP Call 2023-09.27.

The -fcf-protection=[full|branch|return|none|check] enables the instrumentation of control-flow transfers to ensure that target addresses of indirect control-flow transfer instructions (such as indirect function calls, function returns, and indirect jumps) are within a statically or dynamically determined set of possible targets. This is intended to protect against threats as Return-oriented Programming (ROP), and similarly call/jmp-oriented programming (COP/JOP).

This flag is supported since GCC 8.0 and Clang 7.0.0.

Considerations and references

@siddhesh
Copy link
Contributor

It could go into an architecture-specific flags section. There's also -mbranch-protection=none|standard|pac-ret[+leaf +b-key]|bti for aarch64.

@thesamesam
Copy link

See also #267.

@thomasnyman
Copy link
Contributor Author

Fixed by #260.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants