Skip to content

Update LibAFL, remove old version #1914

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions fuzzers/libafl/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,35 @@
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 \
llvm-11 \
clang-12 \
cargo && \
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 16 && \
wget wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

nono

    wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16
RUN wget https://gist.githubusercontent.com/tokatoka/26f4ba95991c6e33139999976332aa8e/raw/698ac2087d58ce5c7a6ad59adce58dbfdc32bd46/createAliases.sh && chmod u+x ./createAliases.sh && ./createAliases.sh

here

Copy link
Author

Choose a reason for hiding this comment

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

Don't get why it would make a difference, but will try

Copy link
Author

Choose a reason for hiding this comment

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

Still doesn't build everything..

Copy link
Contributor

Choose a reason for hiding this comment

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

/usr/bin/ld: cannot find -lFuzzingEngine

so perhaps you shouldn't delete FUZZER_LIB?


# 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 && \
PATH="/root/.cargo/bin/:$PATH" cargo install cargo-make

# Download libafl.
RUN git clone https://github.com/AFLplusplus/LibAFL /libafl

# Checkout a current commit
RUN cd /libafl && git pull && git checkout b20fda2a4ada2a6462718dc661e139e6c7a29807 || true
RUN cd /libafl && git pull && git checkout 1138e6a341d14a4751aa7889cfde0344cb59da05 || 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 && \
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
PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench
5 changes: 3 additions & 2 deletions fuzzers/libafl/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ def build(): # pylint: disable=too-many-branches,too-many-statements
os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0'

cflags = ['--libafl']
cxxflags = ['--libafl', '--std=c++14']
utils.append_flags('CFLAGS', cflags)
utils.append_flags('CXXFLAGS', cflags)
utils.append_flags('CXXFLAGS', cxxflags)
utils.append_flags('LDFLAGS', cflags)

os.environ['FUZZER_LIB'] = '/stub_rt.a'
os.environ['FUZZER_LIB'] = ''
utils.build_benchmark()


Expand Down
54 changes: 0 additions & 54 deletions fuzzers/libafl_27042023/builder.Dockerfile

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ protobuf==3.20.3

# Needed for development.
pylint==2.15.4
pytype==2022.10.13
pytype==2023.10.31
yapf==0.32.0