diff options
-rw-r--r-- | docs/Changelog.md | 3 | ||||
-rw-r--r-- | llvm_mode/afl-clang-fast.c | 2 | ||||
-rw-r--r-- | llvm_mode/afl-llvm-pass.so.cc | 5 | ||||
-rw-r--r-- | src/afl-as.c | 2 | ||||
-rw-r--r-- | src/afl-gcc.c | 2 | ||||
-rwxr-xr-x | test/test.sh | 6 |
6 files changed, 14 insertions, 6 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md index 4ee83ecd..4206d2b3 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -26,6 +26,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>. (which is pointless) to total execs per second - bugfix for dictionary insert stage count (fix via Google repo PR) - added warning if -M is used together with custom mutators with _ONLY option + - AFL_TMPDIR checks are now later and better explained if they fail - llvm_mode InsTrim: no pointless instrumentation of 1 block functions - afl-clang-fast: - show in the help output for which llvm version it was compiled for @@ -37,6 +38,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>. - experimental support for undefined behaviour sanitizer UBSAN (set AFL_USE_UBSAN=1) - the instrumentation summary output now also lists activated sanitizers + - afl-as: added isatty(2) check back in + - added AFL_DEBUG (for upcoming merge) - qemu_mode: - persistent mode is now also available for arm and aarch64 - CmpLog instrumentation for QEMU (-c afl-fuzz command line option) diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 751d25b8..c2b89473 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -498,7 +498,7 @@ int main(int argc, char** argv, char** envp) { exit(1); - } else if ((isatty(2) && !getenv("AFL_QUIET")) || !getenv("AFL_DEBUG")) { + } else if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) { #ifdef USE_TRACE_PC SAYF(cCYA "afl-clang-fast" VERSION cRST diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc index b78c7660..6bd175f2 100644 --- a/llvm_mode/afl-llvm-pass.so.cc +++ b/llvm_mode/afl-llvm-pass.so.cc @@ -145,7 +145,9 @@ bool AFLCoverage::runOnModule(Module &M) { char be_quiet = 0; - if (isatty(2) && !getenv("AFL_QUIET")) { +printf("DEBUG? %s\n", getenv("AFL_DEBUG")); + + if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) { SAYF(cCYA "afl-llvm-pass" VERSION cRST " by <lszekeres@google.com>\n"); @@ -481,6 +483,7 @@ bool AFLCoverage::runOnModule(Module &M) { } } +printf ("BEQUIET!\n"); return true; diff --git a/src/afl-as.c b/src/afl-as.c index c116ac10..72a27cd2 100644 --- a/src/afl-as.c +++ b/src/afl-as.c @@ -510,7 +510,7 @@ int main(int argc, char** argv) { clang_mode = !!getenv(CLANG_ENV_VAR); - if (!getenv("AFL_QUIET")) { + if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) { SAYF(cCYA "afl-as" VERSION cRST " by Michal Zalewski\n"); diff --git a/src/afl-gcc.c b/src/afl-gcc.c index ff53cc8d..60e0a7ce 100644 --- a/src/afl-gcc.c +++ b/src/afl-gcc.c @@ -380,7 +380,7 @@ int main(int argc, char** argv) { } - if (isatty(2) && !getenv("AFL_QUIET")) { + if ((isatty(2) && !getenv("AFL_QUIET")) || getenv("AFL_DEBUG") != NULL) { SAYF(cCYA "afl-cc" VERSION cRST " by Michal Zalewski\n"); SAYF(cYEL "[!] " cBRI "NOTE: " cRST diff --git a/test/test.sh b/test/test.sh index 13fba6cc..dfb79c9a 100755 --- a/test/test.sh +++ b/test/test.sh @@ -65,6 +65,8 @@ unset AFL_PYTHON_MODULE unset AFL_PRELOAD unset LD_PRELOAD +rm -rf in in2 out + export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:abort_on_error=1:symbolize=0 # on OpenBSD we need to work with llvm from /usr/local/bin @@ -332,7 +334,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { CODE=1 } rm -f test-compcov.instrim test.out - AFL_LLVM_LAF_SPLIT_SWITCHES=1 AFL_LLVM_LAF_TRANSFORM_COMPARES=1 AFL_LLVM_LAF_SPLIT_COMPARES=1 ../afl-clang-fast -o test-compcov.compcov test-compcov.c > /dev/null 2> test.out + AFL_DEBUG=1 AFL_LLVM_LAF_SPLIT_SWITCHES=1 AFL_LLVM_LAF_TRANSFORM_COMPARES=1 AFL_LLVM_LAF_SPLIT_COMPARES=1 ../afl-clang-fast -o test-compcov.compcov test-compcov.c > /dev/null 2> test.out test -e test-compcov.compcov && { grep -Eq " [3-9][0-9] location" test.out && { $ECHO "$GREEN[+] llvm_mode laf-intel/compcov feature works correctly" @@ -346,7 +348,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { } rm -f test-compcov.compcov test.out echo foobar.c > whitelist.txt - AFL_LLVM_WHITELIST=whitelist.txt ../afl-clang-fast -o test-compcov test-compcov.c > test.out 2>&1 + AFL_DEBUG=1 AFL_LLVM_WHITELIST=whitelist.txt ../afl-clang-fast -o test-compcov test-compcov.c > test.out 2>&1 test -e test-compcov && { grep -q "No instrumentation targets found" test.out && { $ECHO "$GREEN[+] llvm_mode whitelist feature works correctly" |