Current software attacks often build on exploits that subvert machine-code execution. The enforcement of a basic safety property, Control-Flow Integrity (CFI), can prevent such attacks from arbitrarily controlling program behavior. CFI enforcement is simple, and its guarantees can be established formally, even with respect to powerful adversaries. Moreover, CFI enforcement is practical: it is compatible with existing software and can be done efficiently using software rewriting in commodity systems. Finally, CFI provides a useful foundation for enforcing further security policies, as we demonstrate with efficient software implementations of a protected shadow call stack and of access control for memory regions. Categories and Subject Descriptors D.3.4 [Programming Languages]: Processors; D.2.4 [Software Engineering]: Software/Program Verification; D.4.6 [Operating Systems]: Security and Protection General Terms Security, Languages, Verification Keywords Binary Rewriting, Control-F...