Skip to content

Commit 6fca004

Browse files
authored
Another motivation for CFG: return-oriented programming
1 parent e15510c commit 6fca004

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/doc/unstable-book/src/compiler-flags/control-flow-guard.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ CFG functionality is completely implemented in the LLVM backend and is supported
1919

2020
## When to use Control Flow Guard
2121

22-
The primary motivation for enabling CFG in Rust is to enhance security when linking against non-Rust code, especially C/C++ code. To achieve full CFG protection, all indirect calls (including any from Rust code) must have the appropriate CFG checks, as added by this flag. CFG can also improve security for Rust code that uses the `unsafe` keyword
22+
The primary motivation for enabling CFG in Rust is to enhance security when linking against non-Rust code, especially C/C++ code. To achieve full CFG protection, all indirect calls (including any from Rust code) must have the appropriate CFG checks, as added by this flag. CFG can also improve security for Rust code that uses the `unsafe` keyword.
2323

24+
Another motivation behind CFG is to harden programs against [return-oriented programming (ROP)](https://en.m.wikipedia.org/wiki/Return-oriented_programming) attacks. CFG disallows an attacker from taking advantage of the programs own instructions while redirecting control flow in unexpected ways.
2425

2526
## Overhead of Control Flow Guard
2627

0 commit comments

Comments
 (0)