diff options
| author | Kostya Serebryany <kcc@google.com> | 2016-08-30 01:27:03 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2016-08-30 01:27:03 +0000 |
| commit | 3b41971763e3fa03399bad56c92f006ac9c28af5 (patch) | |
| tree | 704a9ce426feaf5c215a6ba1d57aceb3be6aaf81 /clang/docs/SanitizerCoverage.rst | |
| parent | 5ac427b8e46cf32832708e584fe1a43a56097cfd (diff) | |
| download | bcm5719-llvm-3b41971763e3fa03399bad56c92f006ac9c28af5.tar.gz bcm5719-llvm-3b41971763e3fa03399bad56c92f006ac9c28af5.zip | |
[sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep, mostly usaful for value-profile-based fuzzing; clang part
llvm-svn: 280044
Diffstat (limited to 'clang/docs/SanitizerCoverage.rst')
| -rw-r--r-- | clang/docs/SanitizerCoverage.rst | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/clang/docs/SanitizerCoverage.rst b/clang/docs/SanitizerCoverage.rst index 1e506fc89fd..9673416420b 100644 --- a/clang/docs/SanitizerCoverage.rst +++ b/clang/docs/SanitizerCoverage.rst @@ -324,11 +324,14 @@ and can be used with `AFL <http://lcamtuf.coredump.cx/afl>`__. Tracing data flow ================= -An *experimental* feature to support data-flow-guided fuzzing. +Support for data-flow-guided fuzzing. With ``-fsanitize-coverage=trace-cmp`` the compiler will insert extra instrumentation around comparison instructions and switch statements. -The fuzzer will need to define the following functions, -they will be called by the instrumented code. +Similarly, with ``-fsanitize-coverage=trace-div`` the compiler will instrument +integer division instructions (to capture the right argument of division) +and with ``-fsanitize-coverage=trace-gep`` -- +the `LLVM GEP instructions <http://llvm.org/docs/GetElementPtr.html>`_ +(to capture array indices). .. code-block:: c++ @@ -346,6 +349,16 @@ they will be called by the instrumented code. // Cases[2:] are the case constants. void __sanitizer_cov_trace_switch(uint64_t Val, uint64_t *Cases); + // Called before a division statement. + // Val is the second argument of division. + void __sanitizer_cov_trace_div4(uint32_t Val); + void __sanitizer_cov_trace_div8(uint64_t Val); + + // Called before a GetElemementPtr (GEP) instruction + // for every non-constant array index. + void __sanitizer_cov_trace_gep(uintptr_t Idx); + + This interface is a subject to change. The current implementation is not thread-safe and thus can be safely used only for single-threaded targets. |

