@@ -27,8 +27,8 @@ the program must be structured such that certain object files are compiled
27
27
with CFI enabled, and are statically linked into the program. This may
28
28
preclude the use of shared libraries in some cases.
29
29
30
- Clang currently implements forward-edge CFI for virtual calls. More schemes
31
- are under development.
30
+ Clang currently implements forward-edge CFI for member function calls and
31
+ bad cast checking. More schemes are under development.
32
32
33
33
.. _gold plugin : http://llvm.org/docs/GoldPlugin.html
34
34
@@ -38,11 +38,11 @@ Forward-Edge CFI for Virtual Calls
38
38
This scheme checks that virtual calls take place using a vptr of the correct
39
39
dynamic type; that is, the dynamic type of the called object must be a
40
40
derived class of the static type of the object used to make the call.
41
- This CFI scheme can be enabled on its own using ``-fsanitize=cfi-vptr ``.
41
+ This CFI scheme can be enabled on its own using ``-fsanitize=cfi-vcall ``.
42
42
43
43
For this scheme to work, all translation units containing the definition
44
44
of a virtual member function (whether inline or not) must be compiled
45
- with ``-fsanitize=cfi-vptr `` enabled and be statically linked into the
45
+ with ``-fsanitize=cfi-vcall `` enabled and be statically linked into the
46
46
program. Classes in the C++ standard library (under namespace ``std ``) are
47
47
exempted from checking, and therefore programs may be linked against a
48
48
pre-built standard library, but this may change in the future.
@@ -95,6 +95,23 @@ and be statically linked into the program. Classes in the C++ standard library
95
95
may be linked against a pre-built standard library, but this may change in
96
96
the future.
97
97
98
+ Non-Virtual Member Function Call Checking
99
+ -----------------------------------------
100
+
101
+ This scheme checks that non-virtual calls take place using an object of
102
+ the correct dynamic type; that is, the dynamic type of the called object
103
+ must be a derived class of the static type of the object used to make the
104
+ call. The checks are currently only introduced where the object is of a
105
+ polymorphic class type. This CFI scheme can be enabled on its own using
106
+ ``-fsanitize=cfi-nvcall ``.
107
+
108
+ For this scheme to work, all translation units containing the definition
109
+ of a virtual member function (whether inline or not) must be compiled
110
+ with ``-fsanitize=cfi-nvcall `` enabled and be statically linked into the
111
+ program. Classes in the C++ standard library (under namespace ``std ``) are
112
+ exempted from checking, and therefore programs may be linked against a
113
+ pre-built standard library, but this may change in the future.
114
+
98
115
.. _cfi-strictness :
99
116
100
117
Strictness
0 commit comments