r243793 - [libFuzzer] minimal documentation on data-flow-guided fuzzing
Kostya Serebryany
kcc at google.com
Fri Jul 31 14:48:11 PDT 2015
Author: kcc
Date: Fri Jul 31 16:48:10 2015
New Revision: 243793
URL: http://llvm.org/viewvc/llvm-project?rev=243793&view=rev
Log:
[libFuzzer] minimal documentation on data-flow-guided fuzzing
Modified:
cfe/trunk/docs/SanitizerCoverage.rst
Modified: cfe/trunk/docs/SanitizerCoverage.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=243793&r1=243792&r2=243793&view=diff
==============================================================================
--- cfe/trunk/docs/SanitizerCoverage.rst (original)
+++ cfe/trunk/docs/SanitizerCoverage.rst Fri Jul 31 16:48:10 2015
@@ -249,6 +249,33 @@ These counters may also be used for in-p
uintptr_t
__sanitizer_update_counter_bitset_and_clear_counters(uint8_t *bitset);
+Tracing data flow
+=================
+
+An *experimental* feature to support 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.
+
+.. code-block:: c++
+
+ // Called before a comparison instruction.
+ // SizeAndType is a packed value containing
+ // - [63:32] the Size of the operands of comparison in bits
+ // - [31:0] the Type of comparison (one of ICMP_EQ, ... ICMP_SLE)
+ // Arg1 and Arg2 are arguments of the comparison.
+ void __sanitizer_cov_trace_cmp(uint64_t SizeAndType, uint64_t Arg1, uint64_t Arg2);
+
+ // Called before a switch statement.
+ // Val is the switch operand.
+ // Cases[0] is the number of case constants.
+ // Cases[1] is the size of Val in bits.
+ // Cases[2:] are the case constants.
+ void __sanitizer_cov_trace_switch(uint64_t Val, uint64_t *Cases);
+
+This interface is a subject to change.
+
Output directory
================
More information about the cfe-commits
mailing list