llvm-project/clang/docs
Peter Collingbourne e44acadf6a Implement CFI for indirect calls via a member function pointer.
Similarly to CFI on virtual and indirect calls, this implementation
tries to use program type information to make the checks as precise
as possible.  The basic way that it works is as follows, where `C`
is the name of the class being defined or the target of a call and
the function type is assumed to be `void()`.

For virtual calls:
- Attach type metadata to the addresses of function pointers in vtables
  (not the functions themselves) of type `void (B::*)()` for each `B`
  that is a recursive dynamic base class of `C`, including `C` itself.
  This type metadata has an annotation that the type is for virtual
  calls (to distinguish it from the non-virtual case).
- At the call site, check that the computed address of the function
  pointer in the vtable has type `void (C::*)()`.

For non-virtual calls:
- Attach type metadata to each non-virtual member function whose address
  can be taken with a member function pointer. The type of a function
  in class `C` of type `void()` is each of the types `void (B::*)()`
  where `B` is a most-base class of `C`. A most-base class of `C`
  is defined as a recursive base class of `C`, including `C` itself,
  that does not have any bases.
- At the call site, check that the function pointer has one of the types
  `void (B::*)()` where `B` is a most-base class of `C`.

Differential Revision: https://reviews.llvm.org/D47567

llvm-svn: 335569
2018-06-26 02:15:47 +00:00
..
CommandGuide [diagtool] Add diagtool to install target. 2018-05-16 10:23:25 +00:00
analyzer Fix typos in clang 2018-04-06 15:14:32 +00:00
tools [ASTMatchers] Support generating docs for single-line matchers 2018-01-17 23:14:49 +00:00
AddressSanitizer.rst ASan docs: no_sanitize("address") works on globals. 2018-06-21 00:16:32 +00:00
AttributeReference.rst
AutomaticReferenceCounting.rst
Block-ABI-Apple.rst
Block-ABI-Apple.txt
BlockLanguageSpec.rst
CMakeLists.txt
ClangCheck.rst
ClangCommandLineReference.rst Add -fforce-emit-vtables 2018-06-13 13:55:42 +00:00
ClangFormat.rst [Docs] Update list of languages clang-format can format 2017-11-22 10:47:35 +00:00
ClangFormatStyleOptions.rst clang-format: Fix documentation generation 2018-06-14 13:32:14 +00:00
ClangPlugins.rst
ClangTools.rst
ControlFlowIntegrity.rst Implement CFI for indirect calls via a member function pointer. 2018-06-26 02:15:47 +00:00
ControlFlowIntegrityDesign.rst
CrossCompilation.rst
DataFlowSanitizer.rst
DataFlowSanitizerDesign.rst
DiagnosticsReference.rst Fix malformed table introduced by r330174 2018-04-17 05:48:36 +00:00
DriverArchitecture.png
DriverInternals.rst
ExternalClangExamples.rst
FAQ.rst
HardwareAssistedAddressSanitizerDesign.rst [HWASan] Update HWASan assembly snippet in the docs 2018-04-24 17:41:48 +00:00
HowToSetupToolingForLLVM.rst Allow the creation of human-friendly ASTDumper to arbitrary output stream 2018-04-06 13:01:12 +00:00
InternalsManual.rst [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` messages. 2018-05-19 03:12:04 +00:00
IntroductionToTheClangAST.rst
ItaniumMangleAbiTags.rst
JSONCompilationDatabase.rst [Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found. 2017-11-09 10:37:39 +00:00
LTOVisibility.rst Implement CFI for indirect calls via a member function pointer. 2018-06-26 02:15:47 +00:00
LanguageExtensions.rst Added atomic_fetch_min, max, umin, umax intrinsics to clang. 2018-05-13 07:45:58 +00:00
LeakSanitizer.rst
LibASTMatchers.rst
LibASTMatchersReference.html [ASTMatchers] Introduce a blockDecl matcher for matching block declarations 2018-05-16 22:47:03 +00:00
LibASTMatchersTutorial.rst Add missing newlines to cl::extrahelp uses 2018-05-08 19:46:29 +00:00
LibFormat.rst Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
LibTooling.rst Add missing newlines to cl::extrahelp uses 2018-05-08 19:46:29 +00:00
MSVCCompatibility.rst
Makefile.sphinx
MemorySanitizer.rst
Modules.rst [Modules] Add more language features to be used with requires-declaration 2018-02-14 19:01:03 +00:00
ObjectiveCLiterals.rst
OpenMPSupport.rst [DOCS] Mention OpenMP Tools Interface in runtime library 2018-01-22 15:27:45 +00:00
PCHInternals.rst
PCHLayout.graffle
PCHLayout.png
PTHInternals.rst
RAVFrontendAction.rst Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>" 2018-02-27 15:54:55 +00:00
README.txt
RefactoringEngine.rst
ReleaseNotes.rst Add -fforce-emit-vtables 2018-06-13 13:55:42 +00:00
SafeStack.rst
SanitizerCoverage.rst
SanitizerSpecialCaseList.rst
SanitizerStats.rst [docs] -fsanitize=cfi only allowed with -fvisibility= 2018-06-15 23:11:18 +00:00
ShadowCallStack.rst [ShadowCallStack] fix the docs 2018-05-01 00:15:56 +00:00
SourceBasedCodeCoverage.rst
ThinLTO.rst [NFC] fix trivial typo in document 2018-01-16 13:19:31 +00:00
ThreadSafetyAnalysis.rst
ThreadSanitizer.rst
Toolchain.rst [Docs] Fix typo in toolchain documentation 2018-01-12 02:57:02 +00:00
Tooling.rst
UndefinedBehaviorSanitizer.rst [ubsan] Diagnose noreturn functions which return 2017-12-21 00:10:25 +00:00
UsersManual.rst Add -fforce-emit-vtables 2018-06-13 13:55:42 +00:00
conf.py Update docs version and clear release notes for 7.0.0 2018-01-03 15:49:39 +00:00
doxygen-mainpage.dox
doxygen.cfg.in Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
index.rst Add the -fsanitize=shadow-call-stack flag 2018-04-03 22:33:53 +00:00
make.bat

README.txt

See llvm/docs/README.txt