@@ -5,6 +5,8 @@ The rustc compiler contains support for following sanitizers:
5
5
* [ AddressSanitizer] [ clang-asan ] a faster memory error detector. Can
6
6
detect out-of-bounds access to heap, stack, and globals, use after free, use
7
7
after return, double free, invalid free, memory leaks.
8
+ * [ ControlFlowIntegrity] [ clang-cfi ] LLVM Control Flow Integrity (CFI) provides
9
+ forward-edge control flow protection.
8
10
* [ Hardware-assisted AddressSanitizer] [ clang-hwasan ] a tool similar to
9
11
AddressSanitizer but based on partial hardware assistance.
10
12
* [ LeakSanitizer] [ clang-lsan ] a run-time memory leak detector.
@@ -14,15 +16,16 @@ The rustc compiler contains support for following sanitizers:
14
16
## How to use the sanitizers?
15
17
16
18
To enable a sanitizer compile with ` -Z sanitizer=... ` option, where value is one
17
- of ` address ` , ` hwaddress ` , ` leak ` , ` memory ` or ` thread ` . For more details on how
18
- to use sanitizers please refer to the sanitizer flag in [ the unstable
19
+ of ` address ` , ` cfi ` , ` hwaddress ` , ` leak ` , ` memory ` or ` thread ` . For more details
20
+ on how to use sanitizers please refer to the sanitizer flag in [ the unstable
19
21
book] ( https://doc.rust-lang.org/unstable-book/ ) .
20
22
21
23
## How are sanitizers implemented in rustc?
22
24
23
- The implementation of sanitizers relies almost entirely on LLVM. The rustc is
24
- an integration point for LLVM compile time instrumentation passes and runtime
25
- libraries. Highlight of the most important aspects of the implementation:
25
+ The implementation of sanitizers (except CFI) relies almost entirely on LLVM.
26
+ The rustc is an integration point for LLVM compile time instrumentation passes
27
+ and runtime libraries. Highlight of the most important aspects of the
28
+ implementation:
26
29
27
30
* The sanitizer runtime libraries are part of the [ compiler-rt] project, and
28
31
[ will be built] [ sanitizer-build ] on [ supported targets] [ sanitizer-targets ]
@@ -104,12 +107,14 @@ To enable a sanitizer on a new target which is already supported by LLVM:
104
107
105
108
* [ Sanitizers project page] ( https://github.com/google/sanitizers/wiki/ )
106
109
* [ AddressSanitizer in Clang] [ clang-asan ]
110
+ * [ ControlFlowIntegrity in Clang] [ clang-cfi ]
107
111
* [ Hardware-assisted AddressSanitizer] [ clang-hwasan ]
108
112
* [ LeakSanitizer in Clang] [ clang-lsan ]
109
113
* [ MemorySanitizer in Clang] [ clang-msan ]
110
114
* [ ThreadSanitizer in Clang] [ clang-tsan ]
111
115
112
116
[ clang-asan ] : https://clang.llvm.org/docs/AddressSanitizer.html
117
+ [ clang-cfi ] : https://clang.llvm.org/docs/ControlFlowIntegrity.html
113
118
[ clang-hwasan ] : https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
114
119
[ clang-lsan ] : https://clang.llvm.org/docs/LeakSanitizer.html
115
120
[ clang-msan ] : https://clang.llvm.org/docs/MemorySanitizer.html
0 commit comments