@@ -14,6 +14,9 @@ This feature allows for use of one of following sanitizers:
14
14
forward-edge control flow protection.
15
15
* [ HWAddressSanitizer] ( #hwaddresssanitizer ) a memory error detector similar to
16
16
AddressSanitizer, but based on partial hardware assistance.
17
+ * [ KernelControlFlowIntegrity] ( #kernelcontrolflowintegrity ) LLVM Kernel Control
18
+ Flow Integrity (KCFI) provides forward-edge control flow protection for
19
+ operating systems kernels.
17
20
* [ LeakSanitizer] ( #leaksanitizer ) a run-time memory leak detector.
18
21
* [ MemorySanitizer] ( #memorysanitizer ) a detector of uninitialized reads.
19
22
* [ MemTagSanitizer] ( #memtagsanitizer ) fast memory error detector based on
@@ -502,6 +505,32 @@ Registers where the failure occurred (pc 0xaaaae0ae4a98):
502
505
SUMMARY: HWAddressSanitizer: tag-mismatch (/.../main+0x54a94)
503
506
` ` `
504
507
508
+ # KernelControlFlowIntegrity
509
+
510
+ The LLVM Kernel Control Flow Integrity (CFI) support to the Rust compiler
511
+ initially provides forward-edge control flow protection for operating systems
512
+ kernels for Rust-compiled code only by aggregating function pointers in groups
513
+ identified by their return and parameter types. (See [LLVM commit cff5bef " KCFI
514
+ sanitizer" ](https://github.com/llvm/llvm-project/commit/cff5bef948c91e4919de8a5fb9765e0edc13f3de).)
515
+
516
+ Forward-edge control flow protection for C or C++ and Rust -compiled code " mixed
517
+ binaries" (i.e., for when C or C++ and Rust -compiled code share the same
518
+ virtual address space) will be provided in later work by defining and using
519
+ compatible type identifiers (see Type metadata in the design document in the
520
+ tracking issue [# 89653](https://github.com/rust-lang/rust/issues/89653)).
521
+
522
+ LLVM KCFI can be enabled with ` -Zsanitizer=kcfi` .
523
+
524
+ LLVM KCFI is supported on the following targets:
525
+
526
+ * ` aarch64-linux-android`
527
+ * ` aarch64-unknown-linux-gnu`
528
+ * ` x86_64-linux-android`
529
+ * ` x86_64-unknown-linux-gnu`
530
+
531
+ See the [Clang KernelControlFlowIntegrity documentation][clang-kcfi] for more
532
+ details.
533
+
505
534
# LeakSanitizer
506
535
507
536
LeakSanitizer is run-time memory leak detector.
@@ -693,6 +722,7 @@ Sanitizers produce symbolized stacktraces when llvm-symbolizer binary is in `PAT
693
722
[clang-asan]: https://clang.llvm.org/docs/AddressSanitizer.html
694
723
[clang-cfi]: https://clang.llvm.org/docs/ControlFlowIntegrity.html
695
724
[clang-hwasan]: https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
725
+ [clang-kcfi]: https://clang.llvm.org/docs/ControlFlowIntegrity.html#fsanitize-kcfi
696
726
[clang-lsan]: https://clang.llvm.org/docs/LeakSanitizer.html
697
727
[clang-msan]: https://clang.llvm.org/docs/MemorySanitizer.html
698
728
[clang-scs]: https://clang.llvm.org/docs/ShadowCallStack.html
0 commit comments