Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libafl-based fuzzers (from AFL++ fork) #2027

Merged
merged 11 commits into from
Aug 16, 2024
4 changes: 2 additions & 2 deletions benchmarks/harfbuzz_hb-shape-fuzzer_17863b/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ python3.8 -m pip install ninja meson==0.56.0

# Disable:
# 1. UBSan vptr since target built with -fno-rtti.
export CFLAGS="$CFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY"
export CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY"
export CFLAGS="$CFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY -DHB_NO_PRAGMA_GCC_DIAGNOSTIC -Wno-cast-function-type-strict -Wno-incompatible-function-pointer-types-strict"
export CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY -DHB_NO_PRAGMA_GCC_DIAGNOSTIC -Wno-cast-function-type-strict -Wno-incompatible-function-pointer-types-strict"
Comment on lines -28 to +29
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should now work for all clang-based fuzzers.


# setup
build=$WORK/build
Expand Down
56 changes: 0 additions & 56 deletions fuzzers/aflrustrust/builder.Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions fuzzers/aflrustrust/description.md

This file was deleted.

67 changes: 0 additions & 67 deletions fuzzers/aflrustrust/fuzzer.py

This file was deleted.

23 changes: 0 additions & 23 deletions fuzzers/aflrustrust/runner.Dockerfile

This file was deleted.

14 changes: 4 additions & 10 deletions fuzzers/libafl/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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 && \
sh /rustup.sh --default-toolchain nightly-2024-08-12 -y && \
rm /rustup.sh

# Install dependencies.
Expand All @@ -34,27 +34,21 @@ RUN apt-get update && \

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 b4efb6151550a37f61a869acf2957a1b07894a93 || true
RUN cd /libafl && git pull && git checkout f3433767bea0cc3d7ee3b4c08be138e61d20c468 || 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
8 changes: 4 additions & 4 deletions fuzzers/libafl/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ 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'
os.environ[
'CXX'] = '/libafl/fuzzers/fuzzbench/target/release-fuzzbench/libafl_cxx'
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'
Expand Down
6 changes: 3 additions & 3 deletions fuzzers/libafl_libfuzzer/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ RUN apt-get update && \
# 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-08-23 -y && \
sh /rustup.sh --default-toolchain nightly-2024-08-12 -y && \
rm /rustup.sh

# Download libafl.
RUN git clone https://github.com/AFLplusplus/libafl /libafl && \
cd /libafl && \
git checkout defe9084aed5a80ac32fe9a1f3ff00baf97738c6 && \
git checkout f3433767bea0cc3d7ee3b4c08be138e61d20c468 && \
unset CFLAGS CXXFLAGS && \
export LIBAFL_EDGES_MAP_SIZE=2621440 && \
cd ./libafl_libfuzzer/libafl_libfuzzer_runtime && \
cd ./libafl_libfuzzer_runtime && \
env -i CXX=$CXX CC=$CC PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench && \
cp ./target/release-fuzzbench/libafl_libfuzzer_runtime.a /usr/lib/libFuzzer.a
55 changes: 0 additions & 55 deletions fuzzers/libafl_text/builder.Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions fuzzers/libafl_text/description.md

This file was deleted.

68 changes: 0 additions & 68 deletions fuzzers/libafl_text/fuzzer.py

This file was deleted.

Loading
Loading