aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-05-22 10:24:00 +0200
committervan Hauser <vh@thc.org>2020-05-22 10:24:00 +0200
commit5d0bcf8152136df83337c8ae9808d2aacc1e6693 (patch)
tree452711f19937eeecf7d7a1260f3dcc554141dd62
parent83007f77f52dc2a0a11d879db1651fb7c2c9491a (diff)
downloadafl++-5d0bcf8152136df83337c8ae9808d2aacc1e6693.tar.gz
switching llvm_mode default to pcguard
-rw-r--r--docs/Changelog.md4
-rw-r--r--llvm_mode/afl-clang-fast.c21
2 files changed, 18 insertions, 7 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 2d01ce9a..8393a690 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -17,6 +17,10 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- If no master is present at a sync one slave automatically becomes
a temporary master until a real master shows up
- llvm_mode:
+ - the default instrumentation is now PCGUARD, as it is faster and provides
+ better coverage. The original afl instrumentation can be set via
+ AFL_LLVM_INSTRUMENT=AFL. This is automatically done when the WHITELIST
+ feature is used.
- lowered minimum required llvm version to 3.4 (except LLVMInsTrim,
which needs 3.8.0)
- fixed afl-gcc/afl-as that could break on fast systems reusing pids in
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index 49dc6c1c..981a204a 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -584,9 +584,12 @@ int main(int argc, char **argv, char **envp) {
be_quiet = 1;
-#ifdef USE_TRACE_PC
- instrument_mode = INSTRUMENT_PCGUARD;
+#ifndef USE_TRACE_PC
+ if (getenv("AFL_LLVM_WHITELIST"))
+ instrument_mode = INSTRUMENT_AFL;
+ else
#endif
+ instrument_mode = INSTRUMENT_PCGUARD;
if (getenv("USE_TRACE_PC") || getenv("AFL_USE_TRACE_PC") ||
getenv("AFL_LLVM_USE_TRACE_PC") || getenv("AFL_TRACE_PC")) {
@@ -780,6 +783,9 @@ int main(int argc, char **argv, char **envp) {
"AFL_LLVM_NOT_ZERO and AFL_LLVM_SKIP_NEVERZERO can not be set "
"together");
+ if (instrument_mode == INSTRUMENT_PCGUARD && getenv("AFL_LLVM_WHITELIST"))
+ WARNF("Instrumentation type PCGUARD does not support AFL_LLVM_WHITELIST!");
+
if (argc < 2 || strcmp(argv[1], "-h") == 0) {
if (!lto_mode)
@@ -843,12 +849,13 @@ int main(int argc, char **argv, char **envp) {
SAYF(
"\nafl-clang-fast specific environment variables:\n"
"AFL_LLVM_CMPLOG: log operands of comparisons (RedQueen mutator)\n"
- "AFL_LLVM_INSTRUMENT: set instrumentation mode: DEFAULT, CFG "
- "(INSTRIM), PCGUARD, LTO, CTX, NGRAM-2 ... NGRAM-16\n"
- " You can also use the old environment variables instead:"
- " AFL_LLVM_USE_TRACE_PC: use LLVM trace-pc-guard instrumentation\n"
+ "AFL_LLVM_INSTRUMENT: set instrumentation mode: AFL, CFG "
+ "(INSTRIM), PCGUARD [DEFAULT], LTO, CTX, NGRAM-2 ... NGRAM-16\n"
+ " You can also use the old environment variables instead:\n"
+ " AFL_LLVM_USE_TRACE_PC: use LLVM trace-pc-guard instrumentation "
+ "[DEFAULT]\n"
" AFL_LLVM_INSTRIM: use light weight instrumentation InsTrim\n"
- " AFL_LLVM_INSTRIM_LOOPHEAD: optimize loop tracing for speed (sub "
+ " AFL_LLVM_INSTRIM_LOOPHEAD: optimize loop tracing for speed ("
"option to INSTRIM)\n"
" AFL_LLVM_CTX: use context sensitive coverage\n"
" AFL_LLVM_NGRAM_SIZE: use ngram prev_loc count coverage\n");