about summary refs log tree commit diff
path: root/instrumentation/README.llvm.md
diff options
context:
space:
mode:
authorAlexander Shvedov <60114847+a-shvedov@users.noreply.github.com>2023-05-22 16:57:45 +0300
committerGitHub <noreply@github.com>2023-05-22 16:57:45 +0300
commit629edb1e78d791894ce9ee6d53259f95fe1a29af (patch)
tree3337fbdabebc223c5222b650127af7469a77f693 /instrumentation/README.llvm.md
parent8012b555a8cbc49f1c78d4a33cad56ea59280780 (diff)
parentc4b1566ba35c697cda7822bd0cf30e2e3eeee0c7 (diff)
downloadafl++-629edb1e78d791894ce9ee6d53259f95fe1a29af.tar.gz
Merge pull request #2 from AFLplusplus/stable
push to stable (#1734)
Diffstat (limited to 'instrumentation/README.llvm.md')
-rw-r--r--instrumentation/README.llvm.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/instrumentation/README.llvm.md b/instrumentation/README.llvm.md
index c0677474..126cf1a2 100644
--- a/instrumentation/README.llvm.md
+++ b/instrumentation/README.llvm.md
@@ -280,3 +280,27 @@ Please note that the default counter implementations are not thread safe!
 
 Support for thread safe counters in mode LLVM CLASSIC can be activated with
 setting `AFL_LLVM_THREADSAFE_INST=1`.
+
+## 8) Source code coverage through instrumentation
+
+Measuring source code coverage is a common task in fuzzing, but it is very
+difficut to do in some situations (e.g. when using snapshot fuzzing).
+
+When using the `AFL_LLVM_INSTRUMENT=llvm-codecov` option, afl-cc will use
+native trace-pc-guard instrumentation but additionally select options that
+are required to utilize the instrumentation for source code coverage.
+
+In particular, it will switch the instrumentation to be per basic block
+instead of instrumenting edges, disable all guard pruning and enable the
+experimental pc-table support that allows the runtime to gather 100% of
+instrumented basic blocks at start, including their locations.
+
+Note: You must compile AFL with the `CODE_COVERAGE=1` option to enable the
+respective parts in the AFL compiler runtime. Support is currently only
+implemented for Nyx, but can in theory also work without Nyx.
+
+Note: You might have to adjust `MAP_SIZE_POW2` in include/config.h to ensure
+that your coverage map is large enough to hold all basic blocks of your
+target program without any collisions.
+
+More documentation on how to utilize this with Nyx will follow.