Skip to content

Commit abe3bde

Browse files
committed
Improve the docs by explaining why the salt improves CFI safety.
1 parent cd975ea commit abe3bde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,11 +3648,14 @@ def CFISaltDocs : Documentation {
36483648
let Heading = "cfi_salt";
36493649
let Label = "langext-cfi_salt";
36503650
let Content = [{
3651-
The ``cfi_salt`` attribute allows you to add a salt value to Control Flow
3652-
Integrity (CFI) type hashes to help distinguish between functions with the
3653-
same type signature. This attribute can be applied to function declarations,
3651+
The ``cfi_salt`` attribute specifies a string literal that is used as a salt
3652+
for Control-Flow Integrity (CFI) checks to distinguish between functions with
3653+
the same type signature. This attribute can be applied to function declarations,
36543654
function definitions, and function pointer typedefs.
36553655

3656+
The attribute prevents function pointers from being replaced with pointers to
3657+
functions that have a compatible type, which can be a CFI bypass vector.
3658+
36563659
**Syntax:**
36573660

36583661
* GNU-style: ``__attribute__((cfi_salt("<salt_string>")))``

0 commit comments

Comments
 (0)