Skip to content

Commit e72f5bb

Browse files
authored
Update libafl-based fuzzers (from AFL++ fork) (#2027)
Changing forks so @tokatoka can collab with me on this. Supercedes #2021. As requested in #2020.
1 parent b2f87ff commit e72f5bb

File tree

12 files changed

+13
-335
lines changed

12 files changed

+13
-335
lines changed

benchmarks/harfbuzz_hb-shape-fuzzer_17863b/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ python3.8 -m pip install ninja meson==0.56.0
2525

2626
# Disable:
2727
# 1. UBSan vptr since target built with -fno-rtti.
28-
export CFLAGS="$CFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY"
29-
export CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr -DHB_NO_VISIBILITY"
28+
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"
29+
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"
3030

3131
# setup
3232
build=$WORK/build

fuzzers/aflrustrust/builder.Dockerfile

Lines changed: 0 additions & 56 deletions
This file was deleted.

fuzzers/aflrustrust/description.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

fuzzers/aflrustrust/fuzzer.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

fuzzers/aflrustrust/runner.Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

fuzzers/libafl/builder.Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FROM $parent_image
1818
# Uninstall old Rust & Install the latest one.
1919
RUN if which rustup; then rustup self uninstall -y; fi && \
2020
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustup.sh && \
21-
sh /rustup.sh --default-toolchain nightly-2023-09-21 -y && \
21+
sh /rustup.sh --default-toolchain nightly-2024-08-12 -y && \
2222
rm /rustup.sh
2323

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

3535
RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh
3636

37-
# Uninstall old Rust & Install the latest one.
38-
RUN if which rustup; then rustup self uninstall -y; fi && \
39-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustup.sh && \
40-
sh /rustup.sh --default-toolchain nightly-2024-03-12 -y && \
41-
rm /rustup.sh
42-
4337
# Download libafl.
4438
RUN git clone https://github.com/AFLplusplus/LibAFL /libafl
4539

4640
# Checkout a current commit
47-
RUN cd /libafl && git pull && git checkout b4efb6151550a37f61a869acf2957a1b07894a93 || true
41+
RUN cd /libafl && git pull && git checkout f3433767bea0cc3d7ee3b4c08be138e61d20c468 || true
4842
# Note that due a nightly bug it is currently fixed to a known version on top!
4943

5044
# Compile libafl.
5145
RUN cd /libafl && \
5246
unset CFLAGS CXXFLAGS && \
5347
export LIBAFL_EDGES_MAP_SIZE=2621440 && \
54-
cd ./fuzzers/fuzzbench && \
48+
cd ./fuzzers/fuzzbench/fuzzbench && \
5549
PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main
5650

5751
# Auxiliary weak references.
58-
RUN cd /libafl/fuzzers/fuzzbench && \
52+
RUN cd /libafl/fuzzers/fuzzbench/fuzzbench && \
5953
clang -c stub_rt.c && \
6054
ar r /stub_rt.a stub_rt.o

fuzzers/libafl/fuzzer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def prepare_fuzz_environment(input_corpus):
4040

4141
def build(): # pylint: disable=too-many-branches,too-many-statements
4242
"""Build benchmark."""
43-
os.environ[
44-
'CC'] = '/libafl/fuzzers/fuzzbench/target/release-fuzzbench/libafl_cc'
45-
os.environ[
46-
'CXX'] = '/libafl/fuzzers/fuzzbench/target/release-fuzzbench/libafl_cxx'
43+
os.environ['CC'] = ('/libafl/fuzzers/fuzzbench/fuzzbench'
44+
'/target/release-fuzzbench/libafl_cc')
45+
os.environ['CXX'] = ('/libafl/fuzzers/fuzzbench/fuzzbench'
46+
'/target/release-fuzzbench/libafl_cxx')
4747

4848
os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1'
4949
os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0'

fuzzers/libafl_libfuzzer/builder.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ RUN apt-get update && \
2828
# Uninstall old Rust & Install the latest one.
2929
RUN if which rustup; then rustup self uninstall -y; fi && \
3030
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustup.sh && \
31-
sh /rustup.sh --default-toolchain nightly-2023-08-23 -y && \
31+
sh /rustup.sh --default-toolchain nightly-2024-08-12 -y && \
3232
rm /rustup.sh
3333

3434
# Download libafl.
3535
RUN git clone https://github.com/AFLplusplus/libafl /libafl && \
3636
cd /libafl && \
37-
git checkout defe9084aed5a80ac32fe9a1f3ff00baf97738c6 && \
37+
git checkout f3433767bea0cc3d7ee3b4c08be138e61d20c468 && \
3838
unset CFLAGS CXXFLAGS && \
3939
export LIBAFL_EDGES_MAP_SIZE=2621440 && \
40-
cd ./libafl_libfuzzer/libafl_libfuzzer_runtime && \
40+
cd ./libafl_libfuzzer_runtime && \
4141
env -i CXX=$CXX CC=$CC PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench && \
4242
cp ./target/release-fuzzbench/libafl_libfuzzer_runtime.a /usr/lib/libFuzzer.a

fuzzers/libafl_text/builder.Dockerfile

Lines changed: 0 additions & 55 deletions
This file was deleted.

fuzzers/libafl_text/description.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)