Skip to content

Commit d6d0664

Browse files
[llvm] Proofread CFIVerify.rst (#162431)
1 parent b7921f8 commit d6d0664

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/docs/CFIVerify.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Objective
1010

1111
This document provides an overview of an external tool to verify the protection
1212
mechanisms implemented by Clang's *Control Flow Integrity* (CFI) schemes
13-
(``-fsanitize=cfi``). This tool, provided a binary or DSO, should infer whether
13+
(``-fsanitize=cfi``). This tool, given a binary or DSO, should infer whether
1414
indirect control flow operations are protected by CFI, and should output these
1515
results in a human-readable form.
1616

@@ -22,12 +22,12 @@ Location
2222
========
2323

2424
This tool will be present as a part of the LLVM toolchain, and will reside in
25-
the "/llvm/tools/llvm-cfi-verify" directory, relative to the LLVM trunk. It will
25+
the ``/llvm/tools/llvm-cfi-verify`` directory, relative to the LLVM trunk. It will
2626
be tested in two methods:
2727

2828
- Unit tests to validate code sections, present in
29-
"/llvm/unittests/tools/llvm-cfi-verify".
30-
- Integration tests, present in "/llvm/tools/clang/test/LLVMCFIVerify". These
29+
``/llvm/unittests/tools/llvm-cfi-verify``.
30+
- Integration tests, present in ``/llvm/tools/clang/test/LLVMCFIVerify``. These
3131
integration tests are part of clang as part of a continuous integration
3232
framework, ensuring updates to the compiler that reduce CFI coverage on
3333
indirect control flow instructions are identified.
@@ -38,16 +38,16 @@ Background
3838
This tool will continuously validate that CFI directives are properly
3939
implemented around all indirect control flows by analysing the output machine
4040
code. The analysis of machine code is important as it ensures that any bugs
41-
present in linker or compiler do not subvert CFI protections in the final
41+
present in the linker or compiler do not subvert CFI protections in the final
4242
shipped binary.
4343

4444
Unprotected indirect control flow instructions will be flagged for manual
45-
review. These unexpected control flows may simply have not been accounted for in
46-
the compiler implementation of CFI (e.g. indirect jumps to facilitate switch
45+
review. These unexpected control flows may not have been accounted for in
46+
the compiler implementation of CFI (e.g., indirect jumps to facilitate switch
4747
statements may not be fully protected).
4848

4949
It may be possible in the future to extend this tool to flag unnecessary CFI
50-
directives (e.g. CFI directives around a static call to a non-polymorphic base
50+
directives (e.g., CFI directives around a static call to a non-polymorphic base
5151
type). This type of directive has no security implications, but may present
5252
performance impacts.
5353

@@ -66,7 +66,7 @@ the disassembly. A control flow graph would be generated from a small buffer of
6666
the instructions surrounding the 'target' control flow instruction. If the
6767
target instruction is branched-to, the fallthrough of the branch should be the
6868
CFI trap (on x86, this is a ``ud2`` instruction). If the target instruction is
69-
the fallthrough (i.e. immediately succeeds) of a conditional jump, the
69+
the fallthrough (i.e., immediately succeeds) of a conditional jump, the
7070
conditional jump target should be the CFI trap. If an indirect control flow
7171
instruction does not conform to one of these formats, the target will be noted
7272
as being CFI-unprotected.
@@ -76,7 +76,7 @@ fallthrough of a conditional jump), if the target represents a vcall that takes
7676
arguments, these arguments may be pushed to the stack after the branch but
7777
before the target instruction. In these cases, a secondary 'spill graph' in
7878
constructed, to ensure the register argument used by the indirect jump/call is
79-
not spilled from the stack at any point in the interim period. If there are no
79+
not spilled from the stack at any point in the interim. If there are no
8080
spills that affect the target register, the target is marked as CFI-protected.
8181

8282
Other Design Notes

0 commit comments

Comments
 (0)