From 202cd1a2d149925cff7c376c5aa83dcac3f89ea2 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 23 Jul 2024 13:52:11 +0200 Subject: [PATCH 1/8] add --- fuzzers/libafl/builder.Dockerfile | 6 +- fuzzers/libafl/fuzzer.py | 4 +- .../libafl_r120_force_0.1/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r120_force_0.1/description.md | 11 +++ fuzzers/libafl_r120_force_0.1/fuzzer.py | 72 +++++++++++++++++++ .../libafl_r120_force_0.1/runner.Dockerfile | 25 +++++++ .../libafl_r120_force_0.5/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r120_force_0.5/description.md | 11 +++ fuzzers/libafl_r120_force_0.5/fuzzer.py | 72 +++++++++++++++++++ .../libafl_r120_force_0.5/runner.Dockerfile | 25 +++++++ .../libafl_r120_last_0.1/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r120_last_0.1/description.md | 11 +++ fuzzers/libafl_r120_last_0.1/fuzzer.py | 72 +++++++++++++++++++ .../libafl_r120_last_0.1/runner.Dockerfile | 25 +++++++ .../libafl_r120_last_0.5/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r120_last_0.5/description.md | 11 +++ fuzzers/libafl_r120_last_0.5/fuzzer.py | 72 +++++++++++++++++++ .../libafl_r120_last_0.5/runner.Dockerfile | 25 +++++++ .../libafl_r30_force_0.1/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r30_force_0.1/description.md | 11 +++ fuzzers/libafl_r30_force_0.1/fuzzer.py | 72 +++++++++++++++++++ .../libafl_r30_force_0.1/runner.Dockerfile | 25 +++++++ .../libafl_r30_force_0.5/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r30_force_0.5/description.md | 11 +++ fuzzers/libafl_r30_force_0.5/fuzzer.py | 72 +++++++++++++++++++ .../libafl_r30_force_0.5/runner.Dockerfile | 25 +++++++ .../libafl_r30_last_0.1/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r30_last_0.1/description.md | 11 +++ fuzzers/libafl_r30_last_0.1/fuzzer.py | 72 +++++++++++++++++++ fuzzers/libafl_r30_last_0.1/runner.Dockerfile | 25 +++++++ .../libafl_r30_last_0.5/builder.Dockerfile | 60 ++++++++++++++++ fuzzers/libafl_r30_last_0.5/description.md | 11 +++ fuzzers/libafl_r30_last_0.5/fuzzer.py | 72 +++++++++++++++++++ fuzzers/libafl_r30_last_0.5/runner.Dockerfile | 25 +++++++ 34 files changed, 1349 insertions(+), 5 deletions(-) create mode 100644 fuzzers/libafl_r120_force_0.1/builder.Dockerfile create mode 100644 fuzzers/libafl_r120_force_0.1/description.md create mode 100755 fuzzers/libafl_r120_force_0.1/fuzzer.py create mode 100644 fuzzers/libafl_r120_force_0.1/runner.Dockerfile create mode 100644 fuzzers/libafl_r120_force_0.5/builder.Dockerfile create mode 100644 fuzzers/libafl_r120_force_0.5/description.md create mode 100755 fuzzers/libafl_r120_force_0.5/fuzzer.py create mode 100644 fuzzers/libafl_r120_force_0.5/runner.Dockerfile create mode 100644 fuzzers/libafl_r120_last_0.1/builder.Dockerfile create mode 100644 fuzzers/libafl_r120_last_0.1/description.md create mode 100755 fuzzers/libafl_r120_last_0.1/fuzzer.py create mode 100644 fuzzers/libafl_r120_last_0.1/runner.Dockerfile create mode 100644 fuzzers/libafl_r120_last_0.5/builder.Dockerfile create mode 100644 fuzzers/libafl_r120_last_0.5/description.md create mode 100755 fuzzers/libafl_r120_last_0.5/fuzzer.py create mode 100644 fuzzers/libafl_r120_last_0.5/runner.Dockerfile create mode 100644 fuzzers/libafl_r30_force_0.1/builder.Dockerfile create mode 100644 fuzzers/libafl_r30_force_0.1/description.md create mode 100755 fuzzers/libafl_r30_force_0.1/fuzzer.py create mode 100644 fuzzers/libafl_r30_force_0.1/runner.Dockerfile create mode 100644 fuzzers/libafl_r30_force_0.5/builder.Dockerfile create mode 100644 fuzzers/libafl_r30_force_0.5/description.md create mode 100755 fuzzers/libafl_r30_force_0.5/fuzzer.py create mode 100644 fuzzers/libafl_r30_force_0.5/runner.Dockerfile create mode 100644 fuzzers/libafl_r30_last_0.1/builder.Dockerfile create mode 100644 fuzzers/libafl_r30_last_0.1/description.md create mode 100755 fuzzers/libafl_r30_last_0.1/fuzzer.py create mode 100644 fuzzers/libafl_r30_last_0.1/runner.Dockerfile create mode 100644 fuzzers/libafl_r30_last_0.5/builder.Dockerfile create mode 100644 fuzzers/libafl_r30_last_0.5/description.md create mode 100755 fuzzers/libafl_r30_last_0.5/fuzzer.py create mode 100644 fuzzers/libafl_r30_last_0.5/runner.Dockerfile diff --git a/fuzzers/libafl/builder.Dockerfile b/fuzzers/libafl/builder.Dockerfile index 3f726cfec..bfd0a3a73 100644 --- a/fuzzers/libafl/builder.Dockerfile +++ b/fuzzers/libafl/builder.Dockerfile @@ -44,17 +44,17 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ RUN git clone https://github.com/AFLplusplus/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout b4efb6151550a37f61a869acf2957a1b07894a93 || true +RUN cd /libafl && git pull && git checkout f6151f450707be7a29d8ce95807c59be71b93c84 || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench && \ + cd ./fuzzers/fuzzbench/fuzzbench && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl/fuzzer.py b/fuzzers/libafl/fuzzer.py index 0f191a744..2a4d50d90 100755 --- a/fuzzers/libafl/fuzzer.py +++ b/fuzzers/libafl/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r120_force_0.1/builder.Dockerfile b/fuzzers/libafl_r120_force_0.1/builder.Dockerfile new file mode 100644 index 000000000..f374e73da --- /dev/null +++ b/fuzzers/libafl_r120_force_0.1/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_force_0.1 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.1 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_force_0.1/description.md b/fuzzers/libafl_r120_force_0.1/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r120_force_0.1/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r120_force_0.1/fuzzer.py b/fuzzers/libafl_r120_force_0.1/fuzzer.py new file mode 100755 index 000000000..f4e272ea3 --- /dev/null +++ b/fuzzers/libafl_r120_force_0.1/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.1/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.1/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r120_force_0.1/runner.Dockerfile b/fuzzers/libafl_r120_force_0.1/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r120_force_0.1/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r120_force_0.5/builder.Dockerfile b/fuzzers/libafl_r120_force_0.5/builder.Dockerfile new file mode 100644 index 000000000..af7d819b4 --- /dev/null +++ b/fuzzers/libafl_r120_force_0.5/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_force_0.5 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.5 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_force_0.5/description.md b/fuzzers/libafl_r120_force_0.5/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r120_force_0.5/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r120_force_0.5/fuzzer.py b/fuzzers/libafl_r120_force_0.5/fuzzer.py new file mode 100755 index 000000000..4c1449653 --- /dev/null +++ b/fuzzers/libafl_r120_force_0.5/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.5/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.5/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r120_force_0.5/runner.Dockerfile b/fuzzers/libafl_r120_force_0.5/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r120_force_0.5/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r120_last_0.1/builder.Dockerfile b/fuzzers/libafl_r120_last_0.1/builder.Dockerfile new file mode 100644 index 000000000..c434f0379 --- /dev/null +++ b/fuzzers/libafl_r120_last_0.1/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_last_0.1 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_last_0.1/description.md b/fuzzers/libafl_r120_last_0.1/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r120_last_0.1/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r120_last_0.1/fuzzer.py b/fuzzers/libafl_r120_last_0.1/fuzzer.py new file mode 100755 index 000000000..20b988009 --- /dev/null +++ b/fuzzers/libafl_r120_last_0.1/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.1/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.1/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r120_last_0.1/runner.Dockerfile b/fuzzers/libafl_r120_last_0.1/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r120_last_0.1/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r120_last_0.5/builder.Dockerfile b/fuzzers/libafl_r120_last_0.5/builder.Dockerfile new file mode 100644 index 000000000..b5d4d53e2 --- /dev/null +++ b/fuzzers/libafl_r120_last_0.5/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_last_0.5 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.5 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_last_0.5/description.md b/fuzzers/libafl_r120_last_0.5/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r120_last_0.5/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r120_last_0.5/fuzzer.py b/fuzzers/libafl_r120_last_0.5/fuzzer.py new file mode 100755 index 000000000..b5aa005df --- /dev/null +++ b/fuzzers/libafl_r120_last_0.5/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.5/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.5/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r120_last_0.5/runner.Dockerfile b/fuzzers/libafl_r120_last_0.5/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r120_last_0.5/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r30_force_0.1/builder.Dockerfile b/fuzzers/libafl_r30_force_0.1/builder.Dockerfile new file mode 100644 index 000000000..257e2073e --- /dev/null +++ b/fuzzers/libafl_r30_force_0.1/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_force_0.1 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.1 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_force_0.1/description.md b/fuzzers/libafl_r30_force_0.1/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r30_force_0.1/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r30_force_0.1/fuzzer.py b/fuzzers/libafl_r30_force_0.1/fuzzer.py new file mode 100755 index 000000000..fbc67f3c4 --- /dev/null +++ b/fuzzers/libafl_r30_force_0.1/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.1/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.1/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r30_force_0.1/runner.Dockerfile b/fuzzers/libafl_r30_force_0.1/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r30_force_0.1/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r30_force_0.5/builder.Dockerfile b/fuzzers/libafl_r30_force_0.5/builder.Dockerfile new file mode 100644 index 000000000..252fed510 --- /dev/null +++ b/fuzzers/libafl_r30_force_0.5/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_force_0.5 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.5 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_force_0.5/description.md b/fuzzers/libafl_r30_force_0.5/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r30_force_0.5/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r30_force_0.5/fuzzer.py b/fuzzers/libafl_r30_force_0.5/fuzzer.py new file mode 100755 index 000000000..72478eee0 --- /dev/null +++ b/fuzzers/libafl_r30_force_0.5/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.5/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.5/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r30_force_0.5/runner.Dockerfile b/fuzzers/libafl_r30_force_0.5/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r30_force_0.5/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r30_last_0.1/builder.Dockerfile b/fuzzers/libafl_r30_last_0.1/builder.Dockerfile new file mode 100644 index 000000000..8ac975cf6 --- /dev/null +++ b/fuzzers/libafl_r30_last_0.1/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_last_0.1 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.1 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_last_0.1/description.md b/fuzzers/libafl_r30_last_0.1/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r30_last_0.1/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r30_last_0.1/fuzzer.py b/fuzzers/libafl_r30_last_0.1/fuzzer.py new file mode 100755 index 000000000..7a82f471f --- /dev/null +++ b/fuzzers/libafl_r30_last_0.1/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.1/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.1/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r30_last_0.1/runner.Dockerfile b/fuzzers/libafl_r30_last_0.1/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r30_last_0.1/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 diff --git a/fuzzers/libafl_r30_last_0.5/builder.Dockerfile b/fuzzers/libafl_r30_last_0.5/builder.Dockerfile new file mode 100644 index 000000000..8d1060547 --- /dev/null +++ b/fuzzers/libafl_r30_last_0.5/builder.Dockerfile @@ -0,0 +1,60 @@ +# 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 + +# 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-2023-09-21 -y && \ + rm /rustup.sh + +# Install dependencies. +RUN apt-get update && \ + apt-get remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh + +# 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-03-12 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_last_0.5 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.5 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_last_0.5/description.md b/fuzzers/libafl_r30_last_0.5/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_r30_last_0.5/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_r30_last_0.5/fuzzer.py b/fuzzers/libafl_r30_last_0.5/fuzzer.py new file mode 100755 index 000000000..6dc1e2240 --- /dev/null +++ b/fuzzers/libafl_r30_last_0.5/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.5/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.5/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_r30_last_0.5/runner.Dockerfile b/fuzzers/libafl_r30_last_0.5/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_r30_last_0.5/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 From e4c9a3f737fa2389957a9bc4321e6d26012ac3a5 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 30 Jul 2024 10:36:24 +0200 Subject: [PATCH 2/8] change name --- .../builder.Dockerfile | 0 .../description.md | 0 fuzzers/{libafl_r120_force_0.1 => libafl_r120_force_10}/fuzzer.py | 0 .../runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../description.md | 0 fuzzers/{libafl_r120_force_0.5 => libafl_r120_force_50}/fuzzer.py | 0 .../runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../{libafl_r120_last_0.1 => libafl_r120_last_10}/description.md | 0 fuzzers/{libafl_r120_last_0.1 => libafl_r120_last_10}/fuzzer.py | 0 .../runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../{libafl_r120_last_0.5 => libafl_r120_last_50}/description.md | 0 fuzzers/{libafl_r120_last_0.5 => libafl_r120_last_50}/fuzzer.py | 0 .../runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../{libafl_r30_force_0.1 => libafl_r30_force_10}/description.md | 0 fuzzers/{libafl_r30_force_0.1 => libafl_r30_force_10}/fuzzer.py | 0 .../runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../{libafl_r30_force_0.5 => libafl_r30_force_50}/description.md | 0 fuzzers/{libafl_r30_force_0.5 => libafl_r30_force_50}/fuzzer.py | 0 .../runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../{libafl_r30_last_0.1 => libafl_r30_last_10}/description.md | 0 fuzzers/{libafl_r30_last_0.1 => libafl_r30_last_10}/fuzzer.py | 0 .../{libafl_r30_last_0.1 => libafl_r30_last_10}/runner.Dockerfile | 0 .../builder.Dockerfile | 0 .../{libafl_r30_last_0.5 => libafl_r30_last_50}/description.md | 0 fuzzers/{libafl_r30_last_0.5 => libafl_r30_last_50}/fuzzer.py | 0 .../{libafl_r30_last_0.5 => libafl_r30_last_50}/runner.Dockerfile | 0 32 files changed, 0 insertions(+), 0 deletions(-) rename fuzzers/{libafl_r120_force_0.1 => libafl_r120_force_10}/builder.Dockerfile (100%) rename fuzzers/{libafl_r120_force_0.1 => libafl_r120_force_10}/description.md (100%) rename fuzzers/{libafl_r120_force_0.1 => libafl_r120_force_10}/fuzzer.py (100%) rename fuzzers/{libafl_r120_force_0.1 => libafl_r120_force_10}/runner.Dockerfile (100%) rename fuzzers/{libafl_r120_force_0.5 => libafl_r120_force_50}/builder.Dockerfile (100%) rename fuzzers/{libafl_r120_force_0.5 => libafl_r120_force_50}/description.md (100%) rename fuzzers/{libafl_r120_force_0.5 => libafl_r120_force_50}/fuzzer.py (100%) rename fuzzers/{libafl_r120_force_0.5 => libafl_r120_force_50}/runner.Dockerfile (100%) rename fuzzers/{libafl_r120_last_0.1 => libafl_r120_last_10}/builder.Dockerfile (100%) rename fuzzers/{libafl_r120_last_0.1 => libafl_r120_last_10}/description.md (100%) rename fuzzers/{libafl_r120_last_0.1 => libafl_r120_last_10}/fuzzer.py (100%) rename fuzzers/{libafl_r120_last_0.1 => libafl_r120_last_10}/runner.Dockerfile (100%) rename fuzzers/{libafl_r120_last_0.5 => libafl_r120_last_50}/builder.Dockerfile (100%) rename fuzzers/{libafl_r120_last_0.5 => libafl_r120_last_50}/description.md (100%) rename fuzzers/{libafl_r120_last_0.5 => libafl_r120_last_50}/fuzzer.py (100%) rename fuzzers/{libafl_r120_last_0.5 => libafl_r120_last_50}/runner.Dockerfile (100%) rename fuzzers/{libafl_r30_force_0.1 => libafl_r30_force_10}/builder.Dockerfile (100%) rename fuzzers/{libafl_r30_force_0.1 => libafl_r30_force_10}/description.md (100%) rename fuzzers/{libafl_r30_force_0.1 => libafl_r30_force_10}/fuzzer.py (100%) rename fuzzers/{libafl_r30_force_0.1 => libafl_r30_force_10}/runner.Dockerfile (100%) rename fuzzers/{libafl_r30_force_0.5 => libafl_r30_force_50}/builder.Dockerfile (100%) rename fuzzers/{libafl_r30_force_0.5 => libafl_r30_force_50}/description.md (100%) rename fuzzers/{libafl_r30_force_0.5 => libafl_r30_force_50}/fuzzer.py (100%) rename fuzzers/{libafl_r30_force_0.5 => libafl_r30_force_50}/runner.Dockerfile (100%) rename fuzzers/{libafl_r30_last_0.1 => libafl_r30_last_10}/builder.Dockerfile (100%) rename fuzzers/{libafl_r30_last_0.1 => libafl_r30_last_10}/description.md (100%) rename fuzzers/{libafl_r30_last_0.1 => libafl_r30_last_10}/fuzzer.py (100%) rename fuzzers/{libafl_r30_last_0.1 => libafl_r30_last_10}/runner.Dockerfile (100%) rename fuzzers/{libafl_r30_last_0.5 => libafl_r30_last_50}/builder.Dockerfile (100%) rename fuzzers/{libafl_r30_last_0.5 => libafl_r30_last_50}/description.md (100%) rename fuzzers/{libafl_r30_last_0.5 => libafl_r30_last_50}/fuzzer.py (100%) rename fuzzers/{libafl_r30_last_0.5 => libafl_r30_last_50}/runner.Dockerfile (100%) diff --git a/fuzzers/libafl_r120_force_0.1/builder.Dockerfile b/fuzzers/libafl_r120_force_10/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_force_0.1/builder.Dockerfile rename to fuzzers/libafl_r120_force_10/builder.Dockerfile diff --git a/fuzzers/libafl_r120_force_0.1/description.md b/fuzzers/libafl_r120_force_10/description.md similarity index 100% rename from fuzzers/libafl_r120_force_0.1/description.md rename to fuzzers/libafl_r120_force_10/description.md diff --git a/fuzzers/libafl_r120_force_0.1/fuzzer.py b/fuzzers/libafl_r120_force_10/fuzzer.py similarity index 100% rename from fuzzers/libafl_r120_force_0.1/fuzzer.py rename to fuzzers/libafl_r120_force_10/fuzzer.py diff --git a/fuzzers/libafl_r120_force_0.1/runner.Dockerfile b/fuzzers/libafl_r120_force_10/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_force_0.1/runner.Dockerfile rename to fuzzers/libafl_r120_force_10/runner.Dockerfile diff --git a/fuzzers/libafl_r120_force_0.5/builder.Dockerfile b/fuzzers/libafl_r120_force_50/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_force_0.5/builder.Dockerfile rename to fuzzers/libafl_r120_force_50/builder.Dockerfile diff --git a/fuzzers/libafl_r120_force_0.5/description.md b/fuzzers/libafl_r120_force_50/description.md similarity index 100% rename from fuzzers/libafl_r120_force_0.5/description.md rename to fuzzers/libafl_r120_force_50/description.md diff --git a/fuzzers/libafl_r120_force_0.5/fuzzer.py b/fuzzers/libafl_r120_force_50/fuzzer.py similarity index 100% rename from fuzzers/libafl_r120_force_0.5/fuzzer.py rename to fuzzers/libafl_r120_force_50/fuzzer.py diff --git a/fuzzers/libafl_r120_force_0.5/runner.Dockerfile b/fuzzers/libafl_r120_force_50/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_force_0.5/runner.Dockerfile rename to fuzzers/libafl_r120_force_50/runner.Dockerfile diff --git a/fuzzers/libafl_r120_last_0.1/builder.Dockerfile b/fuzzers/libafl_r120_last_10/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_last_0.1/builder.Dockerfile rename to fuzzers/libafl_r120_last_10/builder.Dockerfile diff --git a/fuzzers/libafl_r120_last_0.1/description.md b/fuzzers/libafl_r120_last_10/description.md similarity index 100% rename from fuzzers/libafl_r120_last_0.1/description.md rename to fuzzers/libafl_r120_last_10/description.md diff --git a/fuzzers/libafl_r120_last_0.1/fuzzer.py b/fuzzers/libafl_r120_last_10/fuzzer.py similarity index 100% rename from fuzzers/libafl_r120_last_0.1/fuzzer.py rename to fuzzers/libafl_r120_last_10/fuzzer.py diff --git a/fuzzers/libafl_r120_last_0.1/runner.Dockerfile b/fuzzers/libafl_r120_last_10/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_last_0.1/runner.Dockerfile rename to fuzzers/libafl_r120_last_10/runner.Dockerfile diff --git a/fuzzers/libafl_r120_last_0.5/builder.Dockerfile b/fuzzers/libafl_r120_last_50/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_last_0.5/builder.Dockerfile rename to fuzzers/libafl_r120_last_50/builder.Dockerfile diff --git a/fuzzers/libafl_r120_last_0.5/description.md b/fuzzers/libafl_r120_last_50/description.md similarity index 100% rename from fuzzers/libafl_r120_last_0.5/description.md rename to fuzzers/libafl_r120_last_50/description.md diff --git a/fuzzers/libafl_r120_last_0.5/fuzzer.py b/fuzzers/libafl_r120_last_50/fuzzer.py similarity index 100% rename from fuzzers/libafl_r120_last_0.5/fuzzer.py rename to fuzzers/libafl_r120_last_50/fuzzer.py diff --git a/fuzzers/libafl_r120_last_0.5/runner.Dockerfile b/fuzzers/libafl_r120_last_50/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r120_last_0.5/runner.Dockerfile rename to fuzzers/libafl_r120_last_50/runner.Dockerfile diff --git a/fuzzers/libafl_r30_force_0.1/builder.Dockerfile b/fuzzers/libafl_r30_force_10/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_force_0.1/builder.Dockerfile rename to fuzzers/libafl_r30_force_10/builder.Dockerfile diff --git a/fuzzers/libafl_r30_force_0.1/description.md b/fuzzers/libafl_r30_force_10/description.md similarity index 100% rename from fuzzers/libafl_r30_force_0.1/description.md rename to fuzzers/libafl_r30_force_10/description.md diff --git a/fuzzers/libafl_r30_force_0.1/fuzzer.py b/fuzzers/libafl_r30_force_10/fuzzer.py similarity index 100% rename from fuzzers/libafl_r30_force_0.1/fuzzer.py rename to fuzzers/libafl_r30_force_10/fuzzer.py diff --git a/fuzzers/libafl_r30_force_0.1/runner.Dockerfile b/fuzzers/libafl_r30_force_10/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_force_0.1/runner.Dockerfile rename to fuzzers/libafl_r30_force_10/runner.Dockerfile diff --git a/fuzzers/libafl_r30_force_0.5/builder.Dockerfile b/fuzzers/libafl_r30_force_50/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_force_0.5/builder.Dockerfile rename to fuzzers/libafl_r30_force_50/builder.Dockerfile diff --git a/fuzzers/libafl_r30_force_0.5/description.md b/fuzzers/libafl_r30_force_50/description.md similarity index 100% rename from fuzzers/libafl_r30_force_0.5/description.md rename to fuzzers/libafl_r30_force_50/description.md diff --git a/fuzzers/libafl_r30_force_0.5/fuzzer.py b/fuzzers/libafl_r30_force_50/fuzzer.py similarity index 100% rename from fuzzers/libafl_r30_force_0.5/fuzzer.py rename to fuzzers/libafl_r30_force_50/fuzzer.py diff --git a/fuzzers/libafl_r30_force_0.5/runner.Dockerfile b/fuzzers/libafl_r30_force_50/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_force_0.5/runner.Dockerfile rename to fuzzers/libafl_r30_force_50/runner.Dockerfile diff --git a/fuzzers/libafl_r30_last_0.1/builder.Dockerfile b/fuzzers/libafl_r30_last_10/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_last_0.1/builder.Dockerfile rename to fuzzers/libafl_r30_last_10/builder.Dockerfile diff --git a/fuzzers/libafl_r30_last_0.1/description.md b/fuzzers/libafl_r30_last_10/description.md similarity index 100% rename from fuzzers/libafl_r30_last_0.1/description.md rename to fuzzers/libafl_r30_last_10/description.md diff --git a/fuzzers/libafl_r30_last_0.1/fuzzer.py b/fuzzers/libafl_r30_last_10/fuzzer.py similarity index 100% rename from fuzzers/libafl_r30_last_0.1/fuzzer.py rename to fuzzers/libafl_r30_last_10/fuzzer.py diff --git a/fuzzers/libafl_r30_last_0.1/runner.Dockerfile b/fuzzers/libafl_r30_last_10/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_last_0.1/runner.Dockerfile rename to fuzzers/libafl_r30_last_10/runner.Dockerfile diff --git a/fuzzers/libafl_r30_last_0.5/builder.Dockerfile b/fuzzers/libafl_r30_last_50/builder.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_last_0.5/builder.Dockerfile rename to fuzzers/libafl_r30_last_50/builder.Dockerfile diff --git a/fuzzers/libafl_r30_last_0.5/description.md b/fuzzers/libafl_r30_last_50/description.md similarity index 100% rename from fuzzers/libafl_r30_last_0.5/description.md rename to fuzzers/libafl_r30_last_50/description.md diff --git a/fuzzers/libafl_r30_last_0.5/fuzzer.py b/fuzzers/libafl_r30_last_50/fuzzer.py similarity index 100% rename from fuzzers/libafl_r30_last_0.5/fuzzer.py rename to fuzzers/libafl_r30_last_50/fuzzer.py diff --git a/fuzzers/libafl_r30_last_0.5/runner.Dockerfile b/fuzzers/libafl_r30_last_50/runner.Dockerfile similarity index 100% rename from fuzzers/libafl_r30_last_0.5/runner.Dockerfile rename to fuzzers/libafl_r30_last_50/runner.Dockerfile From 4e4e5e9d06da62d8898245714fed3adaef625f51 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 30 Jul 2024 11:04:38 +0200 Subject: [PATCH 3/8] change names, too --- fuzzers/libafl_r120_force_10/builder.Dockerfile | 4 ++-- fuzzers/libafl_r120_force_10/fuzzer.py | 4 ++-- fuzzers/libafl_r120_force_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r120_force_50/fuzzer.py | 4 ++-- fuzzers/libafl_r120_last_10/builder.Dockerfile | 2 +- fuzzers/libafl_r120_last_10/fuzzer.py | 4 ++-- fuzzers/libafl_r120_last_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r120_last_50/fuzzer.py | 4 ++-- fuzzers/libafl_r30_force_10/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_force_10/fuzzer.py | 4 ++-- fuzzers/libafl_r30_force_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_force_50/fuzzer.py | 4 ++-- fuzzers/libafl_r30_last_10/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_last_10/fuzzer.py | 4 ++-- fuzzers/libafl_r30_last_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_last_50/fuzzer.py | 4 ++-- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/fuzzers/libafl_r120_force_10/builder.Dockerfile b/fuzzers/libafl_r120_force_10/builder.Dockerfile index f374e73da..9dcd5ff65 100644 --- a/fuzzers/libafl_r120_force_10/builder.Dockerfile +++ b/fuzzers/libafl_r120_force_10/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r120_force_0.1 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_force_10 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.1 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_force_10 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_force_10/fuzzer.py b/fuzzers/libafl_r120_force_10/fuzzer.py index f4e272ea3..221e70e3d 100755 --- a/fuzzers/libafl_r120_force_10/fuzzer.py +++ b/fuzzers/libafl_r120_force_10/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.1/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_10/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.1/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_10/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r120_force_50/builder.Dockerfile b/fuzzers/libafl_r120_force_50/builder.Dockerfile index af7d819b4..7e60aaf7a 100644 --- a/fuzzers/libafl_r120_force_50/builder.Dockerfile +++ b/fuzzers/libafl_r120_force_50/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r120_force_0.5 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_force_50 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.5 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_force_50 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_force_50/fuzzer.py b/fuzzers/libafl_r120_force_50/fuzzer.py index 4c1449653..64b7d81f0 100755 --- a/fuzzers/libafl_r120_force_50/fuzzer.py +++ b/fuzzers/libafl_r120_force_50/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.5/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_50/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_0.5/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_force_50/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r120_last_10/builder.Dockerfile b/fuzzers/libafl_r120_last_10/builder.Dockerfile index c434f0379..4589f27d5 100644 --- a/fuzzers/libafl_r120_last_10/builder.Dockerfile +++ b/fuzzers/libafl_r120_last_10/builder.Dockerfile @@ -51,7 +51,7 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r120_last_0.1 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_last_10 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. diff --git a/fuzzers/libafl_r120_last_10/fuzzer.py b/fuzzers/libafl_r120_last_10/fuzzer.py index 20b988009..9c3601536 100755 --- a/fuzzers/libafl_r120_last_10/fuzzer.py +++ b/fuzzers/libafl_r120_last_10/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.1/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_10/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.1/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_10/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r120_last_50/builder.Dockerfile b/fuzzers/libafl_r120_last_50/builder.Dockerfile index b5d4d53e2..0e88a583b 100644 --- a/fuzzers/libafl_r120_last_50/builder.Dockerfile +++ b/fuzzers/libafl_r120_last_50/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r120_last_0.5 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r120_last_50 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.5 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_last_50 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_last_50/fuzzer.py b/fuzzers/libafl_r120_last_50/fuzzer.py index b5aa005df..de77f963e 100755 --- a/fuzzers/libafl_r120_last_50/fuzzer.py +++ b/fuzzers/libafl_r120_last_50/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.5/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_50/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_0.5/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r120_last_50/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r30_force_10/builder.Dockerfile b/fuzzers/libafl_r30_force_10/builder.Dockerfile index 257e2073e..238d854fb 100644 --- a/fuzzers/libafl_r30_force_10/builder.Dockerfile +++ b/fuzzers/libafl_r30_force_10/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r30_force_0.1 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_force_10 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.1 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_force_10 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_force_10/fuzzer.py b/fuzzers/libafl_r30_force_10/fuzzer.py index fbc67f3c4..77d13b161 100755 --- a/fuzzers/libafl_r30_force_10/fuzzer.py +++ b/fuzzers/libafl_r30_force_10/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.1/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_10/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.1/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_10/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r30_force_50/builder.Dockerfile b/fuzzers/libafl_r30_force_50/builder.Dockerfile index 252fed510..98a441298 100644 --- a/fuzzers/libafl_r30_force_50/builder.Dockerfile +++ b/fuzzers/libafl_r30_force_50/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r30_force_0.5 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_force_50 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.5 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_force_50 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_force_50/fuzzer.py b/fuzzers/libafl_r30_force_50/fuzzer.py index 72478eee0..0b6e07c29 100755 --- a/fuzzers/libafl_r30_force_50/fuzzer.py +++ b/fuzzers/libafl_r30_force_50/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.5/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_50/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_0.5/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_force_50/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r30_last_10/builder.Dockerfile b/fuzzers/libafl_r30_last_10/builder.Dockerfile index 8ac975cf6..015ac9730 100644 --- a/fuzzers/libafl_r30_last_10/builder.Dockerfile +++ b/fuzzers/libafl_r30_last_10/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r30_last_0.1 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.1 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_last_10/fuzzer.py b/fuzzers/libafl_r30_last_10/fuzzer.py index 7a82f471f..18b466c95 100755 --- a/fuzzers/libafl_r30_last_10/fuzzer.py +++ b/fuzzers/libafl_r30_last_10/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.1/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.1/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' diff --git a/fuzzers/libafl_r30_last_50/builder.Dockerfile b/fuzzers/libafl_r30_last_50/builder.Dockerfile index 8d1060547..a5f1caff5 100644 --- a/fuzzers/libafl_r30_last_50/builder.Dockerfile +++ b/fuzzers/libafl_r30_last_50/builder.Dockerfile @@ -51,10 +51,10 @@ RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df59 RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r30_last_0.5 && \ + cd ./fuzzers/fuzzbench/fuzzbench_r30_last_50 && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.5 && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_50 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_last_50/fuzzer.py b/fuzzers/libafl_r30_last_50/fuzzer.py index 6dc1e2240..cce0efbf2 100755 --- a/fuzzers/libafl_r30_last_50/fuzzer.py +++ b/fuzzers/libafl_r30_last_50/fuzzer.py @@ -41,9 +41,9 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" os.environ[ - 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.5/target/release-fuzzbench/libafl_cc' + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_50/target/release-fuzzbench/libafl_cc' os.environ[ - 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_0.5/target/release-fuzzbench/libafl_cxx' + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench_r30_last_50/target/release-fuzzbench/libafl_cxx' os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' From 7b5e54fa382ba96af9469f70dd964614c0e8a607 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 30 Jul 2024 12:21:14 +0200 Subject: [PATCH 4/8] aa --- fuzzers/libafl_r120_force_10/builder.Dockerfile | 4 ++-- fuzzers/libafl_r120_force_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r120_last_10/builder.Dockerfile | 4 ++-- fuzzers/libafl_r120_last_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_force_10/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_force_50/builder.Dockerfile | 4 ++-- fuzzers/libafl_r30_last_10/builder.Dockerfile | 16 +++++++++------- fuzzers/libafl_r30_last_50/builder.Dockerfile | 4 ++-- 8 files changed, 23 insertions(+), 21 deletions(-) diff --git a/fuzzers/libafl_r120_force_10/builder.Dockerfile b/fuzzers/libafl_r120_force_10/builder.Dockerfile index 9dcd5ff65..13ff3faf7 100644 --- a/fuzzers/libafl_r120_force_10/builder.Dockerfile +++ b/fuzzers/libafl_r120_force_10/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r120_force_50/builder.Dockerfile b/fuzzers/libafl_r120_force_50/builder.Dockerfile index 7e60aaf7a..7ff75f4f1 100644 --- a/fuzzers/libafl_r120_force_50/builder.Dockerfile +++ b/fuzzers/libafl_r120_force_50/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r120_last_10/builder.Dockerfile b/fuzzers/libafl_r120_last_10/builder.Dockerfile index 4589f27d5..8e15af3cd 100644 --- a/fuzzers/libafl_r120_last_10/builder.Dockerfile +++ b/fuzzers/libafl_r120_last_10/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r120_last_50/builder.Dockerfile b/fuzzers/libafl_r120_last_50/builder.Dockerfile index 0e88a583b..6f2cda385 100644 --- a/fuzzers/libafl_r120_last_50/builder.Dockerfile +++ b/fuzzers/libafl_r120_last_50/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r30_force_10/builder.Dockerfile b/fuzzers/libafl_r30_force_10/builder.Dockerfile index 238d854fb..835c81802 100644 --- a/fuzzers/libafl_r30_force_10/builder.Dockerfile +++ b/fuzzers/libafl_r30_force_10/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r30_force_50/builder.Dockerfile b/fuzzers/libafl_r30_force_50/builder.Dockerfile index 98a441298..f0d61419b 100644 --- a/fuzzers/libafl_r30_force_50/builder.Dockerfile +++ b/fuzzers/libafl_r30_force_50/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r30_last_10/builder.Dockerfile b/fuzzers/libafl_r30_last_10/builder.Dockerfile index 015ac9730..3626f96d9 100644 --- a/fuzzers/libafl_r30_last_10/builder.Dockerfile +++ b/fuzzers/libafl_r30_last_10/builder.Dockerfile @@ -41,20 +41,22 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull origin main && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - cd ./fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ - PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + ls fuzzers/fuzzbench + #git status && \ + #cd ./fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ + #PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ - clang -c stub_rt.c && \ - ar r /stub_rt.a stub_rt.o +# RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ +# clang -c stub_rt.c && \ +# ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_last_50/builder.Dockerfile b/fuzzers/libafl_r30_last_50/builder.Dockerfile index a5f1caff5..b453d0194 100644 --- a/fuzzers/libafl_r30_last_50/builder.Dockerfile +++ b/fuzzers/libafl_r30_last_50/builder.Dockerfile @@ -41,10 +41,10 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ rm /rustup.sh # Download libafl. -RUN git clone https://github.com/AFLplusplus/LibAFL /libafl +RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 512d1bc7ba8f78ee7e9f2f40ab6450a75df591ab || true +RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. From fb1981bfba0faa33f57880c2846b261557af9d42 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 30 Jul 2024 13:28:13 +0200 Subject: [PATCH 5/8] enable stdout/err --- fuzzers/libafl/builder.Dockerfile | 8 +------ .../libafl_r120_force_10/builder.Dockerfile | 10 ++------- .../libafl_r120_force_50/builder.Dockerfile | 10 ++------- .../libafl_r120_last_10/builder.Dockerfile | 12 +++------- .../libafl_r120_last_50/builder.Dockerfile | 10 ++------- .../libafl_r30_force_10/builder.Dockerfile | 10 ++------- .../libafl_r30_force_50/builder.Dockerfile | 10 ++------- fuzzers/libafl_r30_last_10/builder.Dockerfile | 22 ++++++------------- fuzzers/libafl_r30_last_50/builder.Dockerfile | 10 ++------- 9 files changed, 23 insertions(+), 79 deletions(-) diff --git a/fuzzers/libafl/builder.Dockerfile b/fuzzers/libafl/builder.Dockerfile index bfd0a3a73..db7938cfa 100644 --- a/fuzzers/libafl/builder.Dockerfile +++ b/fuzzers/libafl/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,11 +28,10 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. diff --git a/fuzzers/libafl_r120_force_10/builder.Dockerfile b/fuzzers/libafl_r120_force_10/builder.Dockerfile index 13ff3faf7..1f5b6464e 100644 --- a/fuzzers/libafl_r120_force_10/builder.Dockerfile +++ b/fuzzers/libafl_r120_force_10/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r120_force_50/builder.Dockerfile b/fuzzers/libafl_r120_force_50/builder.Dockerfile index 7ff75f4f1..60ad1cbaa 100644 --- a/fuzzers/libafl_r120_force_50/builder.Dockerfile +++ b/fuzzers/libafl_r120_force_50/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r120_last_10/builder.Dockerfile b/fuzzers/libafl_r120_last_10/builder.Dockerfile index 8e15af3cd..36b611bfe 100644 --- a/fuzzers/libafl_r120_last_10/builder.Dockerfile +++ b/fuzzers/libafl_r120_last_10/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. @@ -55,6 +49,6 @@ RUN cd /libafl && \ PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -RUN cd /libafl/fuzzers/fuzzbench && \ +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r120_last_10 && \ clang -c stub_rt.c && \ ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r120_last_50/builder.Dockerfile b/fuzzers/libafl_r120_last_50/builder.Dockerfile index 6f2cda385..53b34f60c 100644 --- a/fuzzers/libafl_r120_last_50/builder.Dockerfile +++ b/fuzzers/libafl_r120_last_50/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r30_force_10/builder.Dockerfile b/fuzzers/libafl_r30_force_10/builder.Dockerfile index 835c81802..8d5b52a72 100644 --- a/fuzzers/libafl_r30_force_10/builder.Dockerfile +++ b/fuzzers/libafl_r30_force_10/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r30_force_50/builder.Dockerfile b/fuzzers/libafl_r30_force_50/builder.Dockerfile index f0d61419b..f5e332874 100644 --- a/fuzzers/libafl_r30_force_50/builder.Dockerfile +++ b/fuzzers/libafl_r30_force_50/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. diff --git a/fuzzers/libafl_r30_last_10/builder.Dockerfile b/fuzzers/libafl_r30_last_10/builder.Dockerfile index 3626f96d9..818450ad0 100644 --- a/fuzzers/libafl_r30_last_10/builder.Dockerfile +++ b/fuzzers/libafl_r30_last_10/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,30 +28,27 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull origin main && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull origin main && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. RUN cd /libafl && \ unset CFLAGS CXXFLAGS && \ export LIBAFL_EDGES_MAP_SIZE=2621440 && \ - ls fuzzers/fuzzbench - #git status && \ - #cd ./fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ - #PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + cd ./fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main # Auxiliary weak references. -# RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ -# clang -c stub_rt.c && \ -# ar r /stub_rt.a stub_rt.o +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench_r30_last_10 && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_r30_last_50/builder.Dockerfile b/fuzzers/libafl_r30_last_50/builder.Dockerfile index b453d0194..0365bc409 100644 --- a/fuzzers/libafl_r30_last_50/builder.Dockerfile +++ b/fuzzers/libafl_r30_last_50/builder.Dockerfile @@ -15,11 +15,6 @@ ARG parent_image FROM $parent_image -# 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-2023-09-21 -y && \ - rm /rustup.sh # Install dependencies. RUN apt-get update && \ @@ -33,18 +28,17 @@ RUN apt-get update && \ wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh - # 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-03-12 -y && \ + sh /rustup.sh --default-toolchain nightly-2024-07-01 -y && \ rm /rustup.sh # Download libafl. RUN git clone https://github.com/tokatoka/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout 9451db09bbf590bfc37ffb5a5bcf7169692d8add || true +RUN cd /libafl && git pull && git checkout b481081007365ef74e12e503b98844105772d9cb || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. From f300c18e53a3502b62fbae17071a6e2ced634a53 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 30 Jul 2024 15:41:23 +0200 Subject: [PATCH 6/8] compare past build --- fuzzers/libafl/builder.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/libafl/builder.Dockerfile b/fuzzers/libafl/builder.Dockerfile index db7938cfa..5db720dde 100644 --- a/fuzzers/libafl/builder.Dockerfile +++ b/fuzzers/libafl/builder.Dockerfile @@ -38,7 +38,7 @@ RUN if which rustup; then rustup self uninstall -y; fi && \ RUN git clone https://github.com/AFLplusplus/LibAFL /libafl # Checkout a current commit -RUN cd /libafl && git pull && git checkout f6151f450707be7a29d8ce95807c59be71b93c84 || true +RUN cd /libafl && git pull && git checkout b4efb6151550a37f61a869acf2957a1b07894a93 || true # Note that due a nightly bug it is currently fixed to a known version on top! # Compile libafl. From 986207f466a08f90a702aecd9a2c64236ffb4636 Mon Sep 17 00:00:00 2001 From: Toka Date: Tue, 30 Jul 2024 15:41:32 +0200 Subject: [PATCH 7/8] pruning_exp --- fuzzers/libafl_latest/builder.Dockerfile | 54 ++++++++++++++++++ fuzzers/libafl_latest/description.md | 11 ++++ fuzzers/libafl_latest/fuzzer.py | 72 ++++++++++++++++++++++++ fuzzers/libafl_latest/runner.Dockerfile | 25 ++++++++ 4 files changed, 162 insertions(+) create mode 100644 fuzzers/libafl_latest/builder.Dockerfile create mode 100644 fuzzers/libafl_latest/description.md create mode 100755 fuzzers/libafl_latest/fuzzer.py create mode 100644 fuzzers/libafl_latest/runner.Dockerfile diff --git a/fuzzers/libafl_latest/builder.Dockerfile b/fuzzers/libafl_latest/builder.Dockerfile new file mode 100644 index 000000000..db7938cfa --- /dev/null +++ b/fuzzers/libafl_latest/builder.Dockerfile @@ -0,0 +1,54 @@ +# 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 remove -y llvm-10 && \ + apt-get install -y \ + build-essential \ + lsb-release wget software-properties-common gnupg && \ + apt-get install -y wget libstdc++5 libtool-bin automake flex bison \ + libglib2.0-dev libpixman-1-dev python3-setuptools unzip \ + apt-utils apt-transport-https ca-certificates joe curl && \ + wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 + +RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh +# 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-07-01 -y && \ + rm /rustup.sh + +# Download libafl. +RUN git clone https://github.com/AFLplusplus/LibAFL /libafl + +# Checkout a current commit +RUN cd /libafl && git pull && git checkout f6151f450707be7a29d8ce95807c59be71b93c84 || true +# Note that due a nightly bug it is currently fixed to a known version on top! + +# Compile libafl. +RUN cd /libafl && \ + unset CFLAGS CXXFLAGS && \ + export LIBAFL_EDGES_MAP_SIZE=2621440 && \ + cd ./fuzzers/fuzzbench/fuzzbench && \ + PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main + +# Auxiliary weak references. +RUN cd /libafl/fuzzers/fuzzbench/fuzzbench && \ + clang -c stub_rt.c && \ + ar r /stub_rt.a stub_rt.o diff --git a/fuzzers/libafl_latest/description.md b/fuzzers/libafl_latest/description.md new file mode 100644 index 000000000..ea9b947d6 --- /dev/null +++ b/fuzzers/libafl_latest/description.md @@ -0,0 +1,11 @@ +# libafl + +libafl fuzzer instance + - cmplog feature + - persistent mode + +Repository: [https://github.com/AFLplusplus/libafl/](https://github.com/AFLplusplus/libafl/) + +[builder.Dockerfile](builder.Dockerfile) +[fuzzer.py](fuzzer.py) +[runner.Dockerfile](runner.Dockerfile) diff --git a/fuzzers/libafl_latest/fuzzer.py b/fuzzers/libafl_latest/fuzzer.py new file mode 100755 index 000000000..2a4d50d90 --- /dev/null +++ b/fuzzers/libafl_latest/fuzzer.py @@ -0,0 +1,72 @@ +# 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-based fuzzer.""" + +import os +import subprocess + +from fuzzers import utils + + +def prepare_fuzz_environment(input_corpus): + """Prepare to fuzz with a LibAFL-based fuzzer.""" + os.environ['ASAN_OPTIONS'] = 'abort_on_error=1:detect_leaks=0:'\ + 'malloc_context_size=0:symbolize=0:'\ + 'allocator_may_return_null=1:'\ + 'detect_odr_violation=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_abort=0:'\ + 'handle_sigfpe=0:handle_sigill=0' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=1:'\ + 'allocator_release_to_os_interval_ms=500:'\ + 'handle_abort=0:handle_segv=0:'\ + 'handle_sigbus=0:handle_sigfpe=0:'\ + 'handle_sigill=0:print_stacktrace=0:'\ + 'symbolize=0:symbolize_inline_frames=0' + # Create at least one non-empty seed to start. + utils.create_seed_file_for_empty_corpus(input_corpus) + + +def build(): # pylint: disable=too-many-branches,too-many-statements + """Build benchmark.""" + os.environ[ + 'CC'] = '/libafl/fuzzers/fuzzbench/fuzzbench/target/release-fuzzbench/libafl_cc' + os.environ[ + 'CXX'] = '/libafl/fuzzers/fuzzbench/fuzzbench/target/release-fuzzbench/libafl_cxx' + + os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1' + os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0' + + cflags = ['--libafl'] + cxxflags = ['--libafl', '--std=c++14'] + utils.append_flags('CFLAGS', cflags) + utils.append_flags('CXXFLAGS', cxxflags) + utils.append_flags('LDFLAGS', cflags) + + os.environ['FUZZER_LIB'] = '/stub_rt.a' + utils.build_benchmark() + + +def fuzz(input_corpus, output_corpus, target_binary): + """Run fuzzer.""" + prepare_fuzz_environment(input_corpus) + dictionary_path = utils.get_dictionary_path(target_binary) + command = [target_binary] + if dictionary_path: + command += (['-x', dictionary_path]) + command += (['-o', output_corpus, '-i', input_corpus]) + fuzzer_env = os.environ.copy() + fuzzer_env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/libjemalloc.so.2' + print(command) + subprocess.check_call(command, cwd=os.environ['OUT'], env=fuzzer_env) diff --git a/fuzzers/libafl_latest/runner.Dockerfile b/fuzzers/libafl_latest/runner.Dockerfile new file mode 100644 index 000000000..f0c5eb6cc --- /dev/null +++ b/fuzzers/libafl_latest/runner.Dockerfile @@ -0,0 +1,25 @@ +# 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 + +RUN apt install libjemalloc2 + +# 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 From e62fb94342e703e186930463211ee613fe85b7ba Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Thu, 1 Aug 2024 00:22:48 +0200 Subject: [PATCH 8/8] dummy --- service/gcbrun_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/gcbrun_experiment.py b/service/gcbrun_experiment.py index f19ab493d..824ee5509 100644 --- a/service/gcbrun_experiment.py +++ b/service/gcbrun_experiment.py @@ -28,7 +28,7 @@ TRIGGER_COMMAND = '/gcbrun' RUN_EXPERIMENT_COMMAND_STR = f'{TRIGGER_COMMAND} run_experiment.py ' SKIP_COMMAND_STR = f'{TRIGGER_COMMAND} skip' -# A DUMMY COMMENT +# ONE DUMMY COMMENT def get_comments(pull_request_number):