From 3e30b700dd6390f5ca77a222633123c390e99e29 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Fri, 9 Sep 2022 10:20:30 +0200 Subject: Dockerfile enhancements --- Dockerfile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index f1b2fc01..71223c1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,18 +9,31 @@ FROM ubuntu:22.04 AS aflplusplus LABEL "maintainer"="afl++ team " LABEL "about"="AFLplusplus container image" +### Comment out to enable these features +# Only available on specific ARM64 boards +ENV NO_CORESIGHT=1 +# Possbile but unlikely in a docker container +ENV NO_NYX=1 +# Unicorn issues on ARM64 +ENV NO_UNICORN_ARM64=1 + +### Only change these if you know what you are doing: +# LLVM 15 does not look good so we stay at 14 to still have LTO +ENV LLVM_VERSION=14 +# GCC 12 is producing compile errors for some targets so we stay at GCC 11 +ENV GCC_VERSION=11 + +### No changes beyond the point unless you know what you are doing :) + ARG DEBIAN_FRONTEND=noninteractive ENV NO_ARCH_OPT=1 ENV IS_DOCKER=1 RUN apt-get update && apt-get full-upgrade -y && \ - apt-get install -y --no-install-recommends wget ca-certificates && \ + apt-get install -y --no-install-recommends wget ca-certificates apt-utils && \ rm -rf /var/lib/apt/lists/* -ENV LLVM_VERSION=14 -ENV GCC_VERSION=11 - RUN echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${LLVM_VERSION} main" > /etc/apt/sources.list.d/llvm.list && \ wget -qO /etc/apt/keyrings/llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key @@ -30,7 +43,7 @@ RUN apt-get update && \ git xz-utils bzip2 wget jupp nano bash-completion less vim joe ssh psmisc \ python3 python3-dev python3-setuptools python-is-python3 \ libtool libtool-bin libglib2.0-dev \ - apt-utils apt-transport-https gnupg dialog \ + apt-transport-https gnupg dialog \ gnuplot-nox libpixman-1-dev \ gcc-${GCC_VERSION} g++-${GCC_VERSION} gcc-${GCC_VERSION}-plugin-dev gdb lcov \ clang-${LLVM_VERSION} clang-tools-${LLVM_VERSION} libc++1-${LLVM_VERSION} \ @@ -64,10 +77,6 @@ ENV AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 RUN git clone --depth=1 https://github.com/vanhauser-thc/afl-cov && \ (cd afl-cov && make install) && rm -rf afl-cov -# Build currently broken -ENV NO_CORESIGHT=1 -ENV NO_UNICORN_ARM64=1 - WORKDIR /AFLplusplus COPY . . -- cgit 1.4.1 From d61082167968ecdfe267b8d787600fadef912a43 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 15 Sep 2022 18:23:07 +0200 Subject: Re-enabled unicorn for aarch64 --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 71223c1a..2ac37370 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,6 @@ LABEL "about"="AFLplusplus container image" ENV NO_CORESIGHT=1 # Possbile but unlikely in a docker container ENV NO_NYX=1 -# Unicorn issues on ARM64 -ENV NO_UNICORN_ARM64=1 ### Only change these if you know what you are doing: # LLVM 15 does not look good so we stay at 14 to still have LTO -- cgit 1.4.1 From 9d9d2cada99b339a25d987de83ca13187a0ab3c2 Mon Sep 17 00:00:00 2001 From: hexcoder Date: Fri, 16 Sep 2022 10:53:53 +0200 Subject: Typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 2ac37370..8a825b36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ LABEL "about"="AFLplusplus container image" ### Comment out to enable these features # Only available on specific ARM64 boards ENV NO_CORESIGHT=1 -# Possbile but unlikely in a docker container +# Possible but unlikely in a docker container ENV NO_NYX=1 ### Only change these if you know what you are doing: -- cgit 1.4.1 From db9fc49ef84c6d60b40b5aa0d2d6a205cf883133 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 5 Jan 2023 07:03:45 +0000 Subject: Add pip to docker --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 8a825b36..fd47a59f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN apt-get update && \ apt-get -y install --no-install-recommends \ make cmake automake meson ninja-build bison flex \ git xz-utils bzip2 wget jupp nano bash-completion less vim joe ssh psmisc \ - python3 python3-dev python3-setuptools python-is-python3 \ + python3 python3-dev python3-pip python-is-python3 \ libtool libtool-bin libglib2.0-dev \ apt-transport-https gnupg dialog \ gnuplot-nox libpixman-1-dev \ -- cgit 1.4.1 From 8a8e350f34fa4fe5eb862d1a71921be9b739e8bb Mon Sep 17 00:00:00 2001 From: lazymio Date: Wed, 22 Feb 2023 22:48:03 +0100 Subject: Also install libclang-rt-dev --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index fd47a59f..59ce8778 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ RUN apt-get update && \ clang-${LLVM_VERSION} clang-tools-${LLVM_VERSION} libc++1-${LLVM_VERSION} \ libc++-${LLVM_VERSION}-dev libc++abi1-${LLVM_VERSION} libc++abi-${LLVM_VERSION}-dev \ libclang1-${LLVM_VERSION} libclang-${LLVM_VERSION}-dev \ - libclang-common-${LLVM_VERSION}-dev libclang-cpp${LLVM_VERSION} \ + libclang-common-${LLVM_VERSION}-dev libclang-rt-${LLVM_VERSION}-dev libclang-cpp${LLVM_VERSION} \ libclang-cpp${LLVM_VERSION}-dev liblld-${LLVM_VERSION} \ liblld-${LLVM_VERSION}-dev liblldb-${LLVM_VERSION} liblldb-${LLVM_VERSION}-dev \ libllvm${LLVM_VERSION} libomp-${LLVM_VERSION}-dev libomp5-${LLVM_VERSION} \ -- cgit 1.4.1 From 01236f47bcdf87e9c59d06f1ca3727711b5251b7 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Tue, 28 Mar 2023 16:50:05 +0200 Subject: nits --- Dockerfile | 7 ++++++- src/afl-fuzz-one.c | 2 +- test/test-basic.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 59ce8778..010d629b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,9 @@ RUN apt-get update && \ # gcc-multilib is only used for -m32 support on x86 # libcapstone-dev is used for coresight_mode on arm64 +RUN apt-get install -y --no-install-recommends \ + wget software-properties-common gnupg + RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 0 && \ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 0 && \ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 0 && \ @@ -67,6 +70,8 @@ RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 0 RUN wget -qO- https://sh.rustup.rs | CARGO_HOME=/etc/cargo sh -s -- -y -q --no-modify-path ENV PATH=$PATH:/etc/cargo/bin +RUN apt clean -y + ENV LLVM_CONFIG=llvm-config-${LLVM_VERSION} ENV AFL_SKIP_CPUFREQ=1 ENV AFL_TRY_AFFINITY=1 @@ -92,4 +97,4 @@ RUN sed -i.bak 's/^ -/ /g' GNUmakefile && \ RUN echo "set encoding=utf-8" > /root/.vimrc && \ echo ". /etc/bash_completion" >> ~/.bashrc && \ echo 'alias joe="joe --wordwrap --joe_state -nobackup"' >> ~/.bashrc && \ - echo "export PS1='"'[afl++ \h] \w$(__git_ps1) \$ '"'" >> ~/.bashrc + echo "export PS1='"'[afl++ \h] \w \$ '"'" >> ~/.bashrc diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c index be526dbd..070669c5 100644 --- a/src/afl-fuzz-one.c +++ b/src/afl-fuzz-one.c @@ -2084,7 +2084,7 @@ havoc_stage: } - if (afl->stage_max < HAVOC_MIN) { afl->stage_max = HAVOC_MIN; } + if (unlikely(afl->stage_max < HAVOC_MIN)) { afl->stage_max = HAVOC_MIN; } temp_len = len; diff --git a/test/test-basic.sh b/test/test-basic.sh index 53de8c64..5bb2ca28 100755 --- a/test/test-basic.sh +++ b/test/test-basic.sh @@ -133,7 +133,7 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc SKIP= test -e ../${AFL_CLANG} -a -e ../afl-showmap -a -e ../afl-fuzz && { ../${AFL_CLANG} -v 2>&1 | grep -qi "clang version" && { - ../${AFL_CLANG} -o test-instr.plain -O0 ../test-instr.c > /dev/null 2>&1 + ../${AFL_CLANG} -O0 -o test-instr.plain ../test-instr.c > /dev/null 2>&1 AFL_HARDEN=1 ../${AFL_CLANG} -o test-compcov.harden test-compcov.c > /dev/null 2>&1 test -e test-instr.plain && { $ECHO "$GREEN[+] ${AFL_CLANG} compilation succeeded" -- cgit 1.4.1 From 214e24fff0e44704007e71dee8384f6382770381 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Tue, 28 Mar 2023 17:23:07 +0200 Subject: fix arm64 build --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 010d629b..4e53de40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,9 +59,6 @@ RUN apt-get update && \ # gcc-multilib is only used for -m32 support on x86 # libcapstone-dev is used for coresight_mode on arm64 -RUN apt-get install -y --no-install-recommends \ - wget software-properties-common gnupg - RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 0 && \ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 0 && \ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 0 && \ -- cgit 1.4.1