From 72330dddacfc0cdde0854fc686fadec05f589f80 Mon Sep 17 00:00:00 2001 From: Addison Crump Date: Mon, 12 Aug 2024 13:58:39 +0200 Subject: [PATCH] drop support for prototype aflrustrust --- fuzzers/aflrustrust/builder.Dockerfile | 53 -------------------- fuzzers/aflrustrust/description.md | 13 ----- fuzzers/aflrustrust/fuzzer.py | 67 -------------------------- fuzzers/aflrustrust/runner.Dockerfile | 23 --------- 4 files changed, 156 deletions(-) delete mode 100644 fuzzers/aflrustrust/builder.Dockerfile delete mode 100644 fuzzers/aflrustrust/description.md delete mode 100755 fuzzers/aflrustrust/fuzzer.py delete mode 100644 fuzzers/aflrustrust/runner.Dockerfile diff --git a/fuzzers/aflrustrust/builder.Dockerfile b/fuzzers/aflrustrust/builder.Dockerfile deleted file mode 100644 index 275e51002..000000000 --- a/fuzzers/aflrustrust/builder.Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -# 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 - -# Install dependencies. -RUN apt-get update && \ - apt-get install -y build-essential libstdc++5 libtool-bin automake flex \ - bison libglib2.0-dev python3-setuptools unzip python3-dev joe curl \ - cmake git apt-utils apt-transport-https ca-certificates libdbus-1-dev - -# Uninstall old Rust & Install the latest one. -RUN if which rustup; then rustup self uninstall -y; fi && \ - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustup.sh && \ - sh /rustup.sh --default-toolchain nightly-2024-08-12 -y && \ - rm /rustup.sh - -# Download afl++. -RUN git clone --branch stable https://github.com/AFLplusplus/AFLplusplus /afl - -# 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 && \ - cp utils/aflpp_driver/libAFLDriver.a / - -# Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl - -# Checkout a current commit -RUN cd /libafl && git checkout 799c634fef047d3e98355fe1ad17c5226c901a57 - -# Compile libafl. -RUN cd /libafl && \ - unset CFLAGS CXXFLAGS && \ - cd ./fuzzers/fuzzbench/fuzzbench_forkserver && \ - PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench - diff --git a/fuzzers/aflrustrust/description.md b/fuzzers/aflrustrust/description.md deleted file mode 100644 index 445a27663..000000000 --- a/fuzzers/aflrustrust/description.md +++ /dev/null @@ -1,13 +0,0 @@ -# aflplusplus - -AFL++ fuzzer instance that has the following config active for all benchmarks: - - PCGUARD instrumentation - - cmplog 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) diff --git a/fuzzers/aflrustrust/fuzzer.py b/fuzzers/aflrustrust/fuzzer.py deleted file mode 100755 index 4cd927102..000000000 --- a/fuzzers/aflrustrust/fuzzer.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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. -"""Integration code for a LibAFL fuzzer with an AFL++ forkserver.""" - -import os -import shutil -import subprocess - -from fuzzers import utils -from fuzzers.aflplusplus import fuzzer as aflplusplus_fuzzer -from fuzzers.libafl import fuzzer as libafl_fuzzer - - -def build(): - """Build benchmark.""" - # Build the target with AFL++ - aflplusplus_fuzzer.build('tracepc', 'cmplog', 'dict2file') - - # Copy to fuzzer to OUT - build_directory = os.environ['OUT'] - fuzzer = '/libafl/fuzzers/fuzzbench/fuzzbench_forkserver/' \ - 'target/release-fuzzbench/fuzzbench_forkserver' - shutil.copy(fuzzer, build_directory) - - -def fuzz(input_corpus, output_corpus, target_binary): - """Run fuzzer.""" - # Calculate CmpLog binary path from the instrumented target binary. - target_binary_directory = os.path.dirname(target_binary) - cmplog_target_binary_directory = \ - aflplusplus_fuzzer.get_cmplog_build_directory(target_binary_directory) - target_binary_name = os.path.basename(target_binary) - cmplog_target_binary = os.path.join(cmplog_target_binary_directory, - target_binary_name) - - # Setup env vars - libafl_fuzzer.prepare_fuzz_environment(input_corpus) - - # Merge dictionaries - dictionary_path = utils.get_dictionary_path(target_binary) - if os.path.exists('./afl++.dict'): - if dictionary_path: - with open('./afl++.dict', encoding='utf-8') as dictfile: - autodict = dictfile.read() - with open(dictionary_path, 'a', encoding='utf-8') as dictfile: - dictfile.write(autodict) - else: - dictionary_path = './afl++.dict' - - # Run the fuzzer - command = ['./fuzzbench_forkserver', '-c', cmplog_target_binary] - if dictionary_path: - command += (['-x', dictionary_path]) - command += (['-o', output_corpus, '-i', input_corpus, target_binary]) - print(command) - subprocess.check_call(command) diff --git a/fuzzers/aflrustrust/runner.Dockerfile b/fuzzers/aflrustrust/runner.Dockerfile deleted file mode 100644 index 7aa1da8e4..000000000 --- a/fuzzers/aflrustrust/runner.Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# 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. - -FROM gcr.io/fuzzbench/base-image - -# This makes interactive docker runs painless: -ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/out" -#ENV AFL_MAP_SIZE=2621440 -ENV PATH="$PATH:/out" -ENV AFL_SKIP_CPUFREQ=1 -ENV AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 -ENV AFL_TESTCACHE_SIZE=2