Skip to content

Commit 44e95ec

Browse files
authored
Add documentation for LLVM KCFI support (rust-lang#1529)
This commit adds initial documentation for LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler (see rust-lang/rust#105109 and rust-lang/rust#89653).
1 parent 11c34c7 commit 44e95ec

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/sanitizers.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ The rustc compiler contains support for following sanitizers:
99
forward-edge control flow protection.
1010
* [Hardware-assisted AddressSanitizer][clang-hwasan] a tool similar to
1111
AddressSanitizer but based on partial hardware assistance.
12+
* [KernelControlFlowIntegrity][clang-kcfi] LLVM Kernel Control Flow Integrity
13+
(KCFI) provides forward-edge control flow protection for operating systems
14+
kernels.
1215
* [LeakSanitizer][clang-lsan] a run-time memory leak detector.
1316
* [MemorySanitizer][clang-msan] a detector of uninitialized reads.
1417
* [ThreadSanitizer][clang-tsan] a fast data race detector.
1518

1619
## How to use the sanitizers?
1720

1821
To enable a sanitizer compile with `-Z sanitizer=...` option, where value is one
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
21-
book](https://doc.rust-lang.org/unstable-book/).
22+
of `address`, `cfi`, `hwaddress`, `kcfi`, `leak`, `memory` or `thread`. For more
23+
details on how to use sanitizers please refer to the sanitizer flag in [the
24+
unstable book](https://doc.rust-lang.org/unstable-book/).
2225

2326
## How are sanitizers implemented in rustc?
2427

@@ -109,13 +112,15 @@ To enable a sanitizer on a new target which is already supported by LLVM:
109112
* [AddressSanitizer in Clang][clang-asan]
110113
* [ControlFlowIntegrity in Clang][clang-cfi]
111114
* [Hardware-assisted AddressSanitizer][clang-hwasan]
115+
* [KernelControlFlowIntegrity in Clang][clang-kcfi]
112116
* [LeakSanitizer in Clang][clang-lsan]
113117
* [MemorySanitizer in Clang][clang-msan]
114118
* [ThreadSanitizer in Clang][clang-tsan]
115119

116120
[clang-asan]: https://clang.llvm.org/docs/AddressSanitizer.html
117121
[clang-cfi]: https://clang.llvm.org/docs/ControlFlowIntegrity.html
118122
[clang-hwasan]: https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
123+
[clang-kcfi]: https://clang.llvm.org/docs/ControlFlowIntegrity.html#fsanitize-kcfi
119124
[clang-lsan]: https://clang.llvm.org/docs/LeakSanitizer.html
120125
[clang-msan]: https://clang.llvm.org/docs/MemorySanitizer.html
121126
[clang-tsan]: https://clang.llvm.org/docs/ThreadSanitizer.html

0 commit comments

Comments
 (0)