aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--infra/base-images/base-builder/Dockerfile2
-rw-r--r--infra/base-images/base-builder/compile_afl3
-rwxr-xr-xinfra/base-images/base-builder/debug_afl12
3 files changed, 11 insertions, 6 deletions
diff --git a/infra/base-images/base-builder/Dockerfile b/infra/base-images/base-builder/Dockerfile
index 373b4769a..66253c5c9 100644
--- a/infra/base-images/base-builder/Dockerfile
+++ b/infra/base-images/base-builder/Dockerfile
@@ -180,7 +180,7 @@ WORKDIR $SRC
# TODO: switch to -b stable once we can.
RUN git clone https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \
cd aflplusplus && \
- git checkout 74a6044b3fba496c1255f9aedbf5b7253ae29f0e
+ git checkout 7c2436c7114e21f029b06346421a73910deac578
RUN cd $SRC && \
curl -L -O https://github.com/google/honggfuzz/archive/oss-fuzz.tar.gz && \
diff --git a/infra/base-images/base-builder/compile_afl b/infra/base-images/base-builder/compile_afl
index b832fd8c3..fa2cb5e89 100644
--- a/infra/base-images/base-builder/compile_afl
+++ b/infra/base-images/base-builder/compile_afl
@@ -41,7 +41,7 @@ export CXX="$SRC/aflplusplus/afl-clang-fast++"
# Be quiet, otherwise this can break some builds.
export AFL_QUIET=1
# Several targets run their own tools, so ensure its working.
-export AFL_MAP_SIZE=4194304
+export AFL_MAP_SIZE=8000000
# No leak errors during builds.
export ASAN_OPTIONS="detect_leaks=0:symbolize=0:detect_odr_violation=0:abort_on_error=1"
@@ -51,7 +51,6 @@ export ASAN_OPTIONS="detect_leaks=0:symbolize=0:detect_odr_violation=0:abort_on_
rm -f "$OUT/afl_cmplog.txt"
test $(($RANDOM % 10)) -lt 4 && {
export AFL_LLVM_CMPLOG=1
- # We need to notify afl-fuzz to activate CMPLOG
touch "$OUT/afl_cmplog.txt"
}
diff --git a/infra/base-images/base-builder/debug_afl b/infra/base-images/base-builder/debug_afl
index e3a761c5e..1f79746e5 100755
--- a/infra/base-images/base-builder/debug_afl
+++ b/infra/base-images/base-builder/debug_afl
@@ -17,19 +17,25 @@
# Source this file for afl++ debug sessions.
apt-get update
-apt-get install -y strace gdb vim joe
+apt-get install -y strace gdb vim joe psmisc
pushd $SRC/aflplusplus > /dev/null
git checkout dev
git pull
+test -n "$1" && { git checkout "$1" ; git pull ; }
+CFLAGS_SAVE="$CFLAGS"
+CXXFLAGS_SAVE="$CXXFLAGS"
unset CFLAGS
unset CXXFLAGS
make
+export CFLAGS="$CFLAGS_SAVE"
+export CXXFLAGS="$CXXFLAGS_SAVE"
popd > /dev/null
export ASAN_OPTIONS="detect_leaks=0:symbolize=0:detect_odr_violation=0:abort_on_error=1"
-export AFL_MAP_SIZE=4194304
+export AFL_MAP_SIZE=8000000
export AFL_LLVM_LAF_ALL=1
export AFL_LLVM_CMPLOG=1
+touch "$OUT/afl_cmplog.txt"
export AFL_LLVM_DICT2FILE=$OUT/afl++.dict
-ulimit -c unlimited
+ulimit -c unlimited