Lines Matching +full:d3 +full:- +full:hierarchy
8 Forward-Edge CFI for Virtual Calls
12 call, a region of read-only storage in the object file holding a bit vector
19 .. code-block:: c++
42 .. csv-table:: Virtual Table Layout for A, B, C
45 …A::offset-to-top, &A::rtti, &A::f1, &A::f2, &A::f3, B::offset-to-top, &B::rtti, &B::f1, &B::f2, &B…
49 .. csv-table:: Bit Vectors for A, B, C
65 .. code-block:: c++
70 the object's virtual table pointer is in-bounds and aligned and that the
75 .. code-block:: none
91 The compiler relies on co-operation from the linker in order to assemble
93 `type metadata`_ mechanism together with link-time optimization.
95 .. _address point: https://mentorembedded.github.io/cxx-abi/abi.html#vtable-general
100 -------------
119 example class hierarchy will be emitted like this:
121 .. csv-table:: Bit Vectors for A, B, C
137 .. code-block:: none
156 .. code-block:: none
170 11d3: ff 10 callq *(%rax)
177 .. code-block:: none
193 need to cover their disjoint hierarchy. But the closer that classes in
194 sub-hierarchies are laid out to each other, the smaller the bit vectors for
195 those sub-hierarchies need to be (see "Stripping Leading/Trailing Zeros in Bit
199 .. _GlobalLayoutBuilder: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO…
207 this class hierarchy:
209 .. code-block:: c++
232 .. csv-table:: Virtual Table Layout for A, B, C
235 …A::offset-to-top, &A::rtti, &A::f1, &A::f2, B::offset-to-top, &B::rtti, &B::f1, &B::f2, &B::f3, &B…
240 .. csv-table::
246 using a different rotate count. For example, on a 64-bit machine where the
247 address points are 4-word aligned (as in A from our example), the ``rol``
250 .. code-block:: none
270 Eliminating Bit Vector Checks for All-Ones Bit Vectors
277 Forward-Edge CFI for Indirect Function Calls
280 Under forward-edge CFI for indirect function calls, each unique function
283 works in a similar way to forward-edge CFI for virtual calls, the distinction
287 Unlike when re-arranging global variables, we cannot re-arrange functions
304 .. code-block:: none
326 .. code-block:: none
367 for All-Ones Bit Vectors`_ optimizations thus simplifying the check at each
377 targets and the entire class hierarchy are known at link time. The
378 cross-DSO mode, enabled with **-f[no-]sanitize-cfi-cross-dso** relaxes
384 dlopen-ed/dlclose-d periodically, even frequently.
386 - Calls made from uninstrumented DSOs are not checked and just work.
387 - Calls inside any instrumented DSO are fully protected.
388 - Calls between different instrumented DSOs are also protected, with
391 - Calls from an instrumented DSO to an uninstrumented one are
393 - Calls from an instrumented DSO outside of any known DSO are
398 .. code-block:: none
404 In the cross-DSO scheme it becomes
406 .. code-block:: none
413 --------------
415 ``CallSiteTypeId`` is a stable process-wide identifier of the
416 call-site type. For a virtual call site, the type in question is the class
422 - Obtain the mangled name for "typeinfo name for T".
423 - Calculate MD5 hash of the name as a string.
424 - Reinterpret the first 8 bytes of the hash as a little-endian
425 64-bit integer.
432 ---------
438 .. code-block:: none
452 ----------
463 - Address in a CFI-instrumented DSO.
464 - Unchecked address (a “trusted” non-instrumented DSO). Encoded as
466 - Invalid address (everything else). Encoded as value 0.
468 For a CFI-instrumented DSO, a shadow value encodes the address of the
473 .. code-block:: none
475 __cfi_check = AlignUpTo(Addr, 4096) - (V + 1) * 4096
482 ------------
484 The slow path check is implemented in compiler-rt library as
486 .. code-block:: none
493 Position-independent executable requirement
494 -------------------------------------------
496 Cross-DSO CFI mode requires that the main executable is built as PIE.
497 In non-PIE executables the address of an external function (taken from