Skip to content

Commit

Permalink
add adaptive
Browse files Browse the repository at this point in the history
  • Loading branch information
tokatoka committed Feb 22, 2024
1 parent 324c1b6 commit 26b1f82
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ RUN cd /libafl && git pull && git checkout 47e38899df71c3ca45bb2667f7d7ee99a855c
# Compile libafl.
RUN cd /libafl && \
unset CFLAGS CXXFLAGS && \
export LIBAFL_EDGES_MAP_SIZE=65536 && \
cd ./fuzzers/fuzzbench_ctx && \
cd ./fuzzers/fuzzbench_ctx_adaptive && \
PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main

# Auxiliary weak references.
RUN cd /libafl/fuzzers/fuzzbench_ctx && \
RUN cd /libafl/fuzzers/fuzzbench_ctx_adaptive && \
clang -c stub_rt.c && \
ar r /stub_rt.a stub_rt.o
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,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_ctx/target/release-fuzzbench/libafl_cc"
"/libafl/fuzzers/fuzzbench_ctx_adaptive/target/release-fuzzbench/libafl_cc"
)
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ctx/target/release-fuzzbench/libafl_cxx"
"/libafl/fuzzers/fuzzbench_ctx_adaptive/target/release-fuzzbench/libafl_cxx"
)

os.environ["ASAN_OPTIONS"] = "abort_on_error=0:allocator_may_return_null=1"
Expand Down
34 changes: 14 additions & 20 deletions fuzzers/libafl_ctx_large_map/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,28 @@

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"
)
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_ctx/target/release-fuzzbench/libafl_cc"
)
"/libafl/fuzzers/fuzzbench_ctx/target/release-fuzzbench/libafl_cc")
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ctx/target/release-fuzzbench/libafl_cxx"
)
"/libafl/fuzzers/fuzzbench_ctx/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
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ RUN cd /libafl && git pull && git checkout 47e38899df71c3ca45bb2667f7d7ee99a855c
# Compile libafl.
RUN cd /libafl && \
unset CFLAGS CXXFLAGS && \
export LIBAFL_EDGES_MAP_SIZE=65536 && \
cd ./fuzzers/fuzzbench_ngram && \
cd ./fuzzers/fuzzbench_ngram_adaptive && \
PATH="/root/.cargo/bin/:$PATH" cargo build --profile release-fuzzbench --features no_link_main

# Auxiliary weak references.
RUN cd /libafl/fuzzers/fuzzbench_ngram && \
RUN cd /libafl/fuzzers/fuzzbench_ngram_adaptive && \
clang -c stub_rt.c && \
ar r /stub_rt.a stub_rt.o
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,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_ngram/target/release-fuzzbench/libafl_cc"
"/libafl/fuzzers/fuzzbench_ngram_adaptive/target/release-fuzzbench/libafl_cc"
)
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ngram/target/release-fuzzbench/libafl_cxx"
"/libafl/fuzzers/fuzzbench_ngram_adaptive/target/release-fuzzbench/libafl_cxx"
)

os.environ["ASAN_OPTIONS"] = "abort_on_error=0:allocator_may_return_null=1"
Expand Down
34 changes: 14 additions & 20 deletions fuzzers/libafl_ngram_large_map/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,28 @@

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"
)
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_ngram/target/release-fuzzbench/libafl_cc"
)
"/libafl/fuzzers/fuzzbench_ngram/target/release-fuzzbench/libafl_cc")
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ngram/target/release-fuzzbench/libafl_cxx"
)
"/libafl/fuzzers/fuzzbench_ngram/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
34 changes: 14 additions & 20 deletions fuzzers/libafl_ngram_mid_map/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,28 @@

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"
)
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_ngram/target/release-fuzzbench/libafl_cc"
)
"/libafl/fuzzers/fuzzbench_ngram/target/release-fuzzbench/libafl_cc")
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ngram/target/release-fuzzbench/libafl_cxx"
)
"/libafl/fuzzers/fuzzbench_ngram/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

0 comments on commit 26b1f82

Please sign in to comment.