Skip to content

Commit

Permalink
i copied it into wrong folder
Browse files Browse the repository at this point in the history
  • Loading branch information
tokatoka committed Sep 21, 2023
1 parent 165760d commit a93b5fe
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 38 deletions.
4 changes: 3 additions & 1 deletion fuzzers/libafl_fuzzbench_composition/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ RUN git clone https://github.com/tokatoka/libafl_fuzzbench /libafl_fuzzbench &&
git checkout 44ecead5c08f27d9db54a93a98c5d5f31d4645cc && \
git submodule update --init

# Compile libafl
# We'll build the fuzzer in fuzzer.py
'''
RUN cd /libafl_fuzzbench/ && unset CFLAGS && unset CXXFLAGS && \
export CC=clang && export CXX=clang++ && \
export LIBAFL_EDGES_MAP_SIZE=2621440 && \
PATH="/root/.cargo/bin/:$PATH" cargo build --release --features no_link_main
'''

# Auxiliary weak references.
RUN cd /libafl_fuzzbench && \
Expand Down
36 changes: 34 additions & 2 deletions fuzzers/libafl_fuzzbench_composition/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,43 @@ def prepare_fuzz_environment(input_corpus):
# Create at least one non-empty seed to start.
utils.create_seed_file_for_empty_corpus(input_corpus)

def build_libafl():
os.environ['CC'] = 'clang'
os.environ['CXX'] = 'clang++'
os.environ['LIBAFL_EDGES_MAP_SIZE'] = 2621440
os.environ['PATH'] = "/root/.cargo/bin/:$PATH"

benchmark_name = os.environ['BENCHMARK']
if benchmark_name == "assimp_assimp_fuzzer":
feature_flags = ["fast", "naive_feedback", "grimoire"]
elif benchmark_name == "brotli_decode_fuzzer":
feature_flags = ["fast", "value_profile", "mopt"]
elif benchmark_name == "draco_draco_pc_decoder_fuzzer":
feature_flags = ["fast", "naive_feedback", "grimoire"]
elif benchmark_name == "guetzli_guetzli_fuzzer":
feature_flags = ["fast", "value_profile", "grimoire"]
elif benchmark_name == "libaom_av1_dec_fuzzer":
feature_flags = ["explore", "value_profile", "grimoire"]
elif benchmark_name == "libcoap_pdu_parse_fuzzer":
feature_flags = ["fast", "value_profile", "grimoire"]
else:
print("Unavailable benchmark")
exit(1)

command = ["cargo", "build", "--release", "--package", "composition", "--features"]
command += ["no_link_main"]
command += feature_flags

subprocess.check_call(command, cwd='/libafl_fuzzbench')


def build(): # pylint: disable=too-many-branches,too-many-statements
"""Build benchmark."""
os.environ['CC'] = '/libafl_fuzzbench/target/release/composition_cc'
os.environ['CXX'] = '/libafl_fuzzbench/target/release/composition_cxx'

build_libafl()

os.environ['CC'] = '/libafl_fuzzbench/target/release/cov_accounting_cc'
os.environ['CXX'] = '/libafl_fuzzbench/target/release/cov_accounting_cxx'

os.environ['ASAN_OPTIONS'] = 'abort_on_error=0:allocator_may_return_null=1'
os.environ['UBSAN_OPTIONS'] = 'abort_on_error=0'
Expand Down
3 changes: 0 additions & 3 deletions fuzzers/libafl_fuzzbench_cov_accounting/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,11 @@ RUN git clone https://github.com/AFLplusplus/libafl_fuzzbench /libafl_fuzzbench
git checkout 310fe4048bb90def1619f65714ab285a4e7d2e75 && \
git submodule update --init

# We'll build the fuzzer in fuzzer.py
'''
# Compile libafl
RUN cd /libafl_fuzzbench/ && unset CFLAGS && unset CXXFLAGS && \
export CC=clang && export CXX=clang++ && \
export LIBAFL_EDGES_MAP_SIZE=2621440 && \
PATH="/root/.cargo/bin/:$PATH" cargo build --release --features no_link_main
'''

# Auxiliary weak references.
RUN cd /libafl_fuzzbench && \
Expand Down
32 changes: 0 additions & 32 deletions fuzzers/libafl_fuzzbench_cov_accounting/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,9 @@ def prepare_fuzz_environment(input_corpus):
# Create at least one non-empty seed to start.
utils.create_seed_file_for_empty_corpus(input_corpus)

def build_libafl():
os.environ['CC'] = 'clang'
os.environ['CXX'] = 'clang++'
os.environ['LIBAFL_EDGES_MAP_SIZE'] = 2621440
os.environ['PATH'] = "/root/.cargo/bin/:$PATH"

benchmark_name = os.environ['BENCHMARK']
if benchmark_name == "assimp_assimp_fuzzer":
feature_flags = ["fast", "naive_feedback", "grimoire"]
elif benchmark_name == "brotli_decode_fuzzer":
feature_flags = ["fast", "value_profile", "mopt"]
elif benchmark_name == "draco_draco_pc_decoder_fuzzer":
feature_flags = ["fast", "naive_feedback", "grimoire"]
elif benchmark_name == "guetzli_guetzli_fuzzer":
feature_flags = ["fast", "value_profile", "grimoire"]
elif benchmark_name == "libaom_av1_dec_fuzzer":
feature_flags = ["explore", "value_profile", "grimoire"]
elif benchmark_name == "libcoap_pdu_parse_fuzzer":
feature_flags = ["fast", "value_profile", "grimoire"]
else:
print("Unavailable benchmark")
exit(1)

command = ["cargo", "build", "--release", "--features"]
command += ["no_link_main"]
command += feature_flags

subprocess.check_call(command, cwd='/libafl_fuzzbench')


def build(): # pylint: disable=too-many-branches,too-many-statements
"""Build benchmark."""

build_libafl()

os.environ['CC'] = '/libafl_fuzzbench/target/release/cov_accounting_cc'
os.environ['CXX'] = '/libafl_fuzzbench/target/release/cov_accounting_cxx'

Expand Down

0 comments on commit a93b5fe

Please sign in to comment.