Skip to content

Commit

Permalink
new aflpp regression test (google#1824)
Browse files Browse the repository at this point in the history
minimized the test case to 3 targets
  • Loading branch information
vanhauser-thc authored Apr 19, 2023
1 parent 98e76e3 commit 1c9e7b8
Show file tree
Hide file tree
Showing 35 changed files with 1,522 additions and 557 deletions.
2 changes: 1 addition & 1 deletion fuzzers/aflplusplus/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN apt-get update && \
# Download afl++.
RUN git clone -b dev https://github.com/AFLplusplus/AFLplusplus /afl && \
cd /afl && \
git checkout 0782ed38414bed37168feafc971fd102b8294510 || \
git checkout 97644836935020b9f42688bb6530f08f536644a9 || \
true

# Build without Python support as we don't need it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN apt-get update && \
# Download afl++.
RUN git clone https://github.com/AFLplusplus/AFLplusplus /afl && \
cd /afl && \
git checkout a321d4102b6c3bec3471c4351692d1ad2a410e70 || \
git checkout 6e704e8a10d0e0033b0f8f03ee2a5bdee06e2c65 || \
true

RUN apt install -y lsb-release wget software-properties-common gnupg
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,22 @@ RUN apt-get update && \
libstdc++-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-dev

# Download afl++.
RUN git clone -b dev https://github.com/AFLplusplus/AFLplusplus /afl && \
RUN git clone https://github.com/AFLplusplus/AFLplusplus /afl && \
cd /afl && \
git checkout 0782ed38414bed37168feafc971fd102b8294510 || \
git checkout 21215ac21cfca26f18c5b59ceb71a3b5a2920244 || \
true

RUN apt install -y lsb-release wget software-properties-common gnupg

RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 13

ENV LLVM_CONFIG llvm-config-13

# Build without Python support as we don't need it.
# Set AFL_NO_X86 to skip flaky tests.
RUN cd /afl && \
unset CFLAGS CXXFLAGS && \
export CC=clang AFL_NO_X86=1 && \
PYTHON_INCLUDE=/ make && \
make install && \
make -C utils/aflpp_driver && \
cp utils/aflpp_driver/libAFLDriver.a /
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def build(*args): # pylint: disable=too-many-branches,too-many-statements
# Generate an extra dictionary.
if 'dict2file' in build_modes or 'native' in build_modes:
os.environ['AFL_LLVM_DICT2FILE'] = build_directory + '/afl++.dict'
os.environ['AFL_LLVM_DICT2FILE_NO_MAIN'] = '1'
#os.environ['AFL_LLVM_DICT2FILE_NO_MAIN'] = '1'
# Enable context sentitivity for LLVM mode (non LTO only)
if 'ctx' in build_modes:
os.environ['AFL_LLVM_CTX'] = '1'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,22 @@ RUN apt-get update && \
libstdc++-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-dev

# Download afl++.
RUN git clone -b muttest https://github.com/AFLplusplus/AFLplusplus /afl && \
RUN git clone https://github.com/AFLplusplus/AFLplusplus /afl && \
cd /afl && \
git checkout 3c3fe89bc5e1e949b7381d476fea5f92e7845035
git checkout 1b2637545b6b9f171ea46ed6cf5164e8d05d1776 || \
true

RUN apt install -y lsb-release wget software-properties-common gnupg

RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 13

ENV LLVM_CONFIG llvm-config-13

# Build without Python support as we don't need it.
# Set AFL_NO_X86 to skip flaky tests.
RUN cd /afl && \
unset CFLAGS CXXFLAGS && \
export CC=clang AFL_NO_X86=1 && \
PYTHON_INCLUDE=/ make && \
make install && \
make -C utils/aflpp_driver && \
cp utils/aflpp_driver/libAFLDriver.a /
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def build(*args): # pylint: disable=too-many-branches,too-many-statements
# Generate an extra dictionary.
if 'dict2file' in build_modes or 'native' in build_modes:
os.environ['AFL_LLVM_DICT2FILE'] = build_directory + '/afl++.dict'
os.environ['AFL_LLVM_DICT2FILE_NO_MAIN'] = '1'
#os.environ['AFL_LLVM_DICT2FILE_NO_MAIN'] = '1'
# Enable context sentitivity for LLVM mode (non LTO only)
if 'ctx' in build_modes:
os.environ['AFL_LLVM_CTX'] = '1'
Expand Down Expand Up @@ -261,8 +261,6 @@ def fuzz(input_corpus,
if os.path.exists('./afl++.dict'):
flags += ['-x', './afl++.dict']

flags += ['-z']

# Move the following to skip for upcoming _double tests:
if os.path.exists(cmplog_target_binary) and no_cmplog is False:
flags += ['-c', cmplog_target_binary]
Expand Down
File renamed without changes.
56 changes: 56 additions & 0 deletions fuzzers/aflplusplus_314_3/builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG parent_image
FROM $parent_image

RUN apt-get update && \
apt-get install -y \
build-essential \
python3-dev \
python3-setuptools \
automake \
cmake \
git \
flex \
bison \
libglib2.0-dev \
libpixman-1-dev \
cargo \
libgtk-3-dev \
# for QEMU mode
ninja-build \
gcc-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-plugin-dev \
libstdc++-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-dev

# Download afl++.
RUN git clone https://github.com/AFLplusplus/AFLplusplus /afl && \
cd /afl && \
git checkout f1bcd378a2e55ee1559dde0d46e2bc32882c5b39 || \
true

RUN apt install -y lsb-release wget software-properties-common gnupg

RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 13

ENV LLVM_CONFIG llvm-config-13

# Build without Python support as we don't need it.
# Set AFL_NO_X86 to skip flaky tests.
RUN cd /afl && \
unset CFLAGS CXXFLAGS && \
export CC=clang AFL_NO_X86=1 && \
PYTHON_INCLUDE=/ make && \
make -C utils/aflpp_driver && \
cp utils/aflpp_driver/libAFLDriver.a /
14 changes: 14 additions & 0 deletions fuzzers/aflplusplus_314_3/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# aflplusplus

AFL++ fuzzer instance that has the following config active for all benchmarks:
- PCGUARD instrumentation
- cmplog feature
- dict2file feature
- "fast" power schedule
- persistent mode + shared memory test cases

Repository: [https://github.com/AFLplusplus/AFLplusplus/](https://github.com/AFLplusplus/AFLplusplus/)

[builder.Dockerfile](builder.Dockerfile)
[fuzzer.py](fuzzer.py)
[runner.Dockerfile](runner.Dockerfile)
Loading

0 comments on commit 1c9e7b8

Please sign in to comment.