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 26b1f82 commit 6d6fc6f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 64 deletions.
38 changes: 16 additions & 22 deletions fuzzers/libafl_ctx_adaptive_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_adaptive/target/release-fuzzbench/libafl_cc"
)
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ctx_adaptive/target/release-fuzzbench/libafl_cxx"
)
os.environ["CC"] = ("/libafl/fuzzers/fuzzbench_ctx_adaptive/ \
target/release-fuzzbench/libafl_cc")
os.environ["CXX"] = ("/libafl/fuzzers/fuzzbench_ctx_adaptive/ \
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_ctx_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_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
38 changes: 16 additions & 22 deletions fuzzers/libafl_ngram_adaptive_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_adaptive/target/release-fuzzbench/libafl_cc"
)
os.environ["CXX"] = (
"/libafl/fuzzers/fuzzbench_ngram_adaptive/target/release-fuzzbench/libafl_cxx"
)
os.environ["CC"] = ("/libafl/fuzzers/fuzzbench_ngram_adaptive/ \
target/release-fuzzbench/libafl_cc")
os.environ["CXX"] = ("/libafl/fuzzers/fuzzbench_ngram_adaptive/ \
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 6d6fc6f

Please sign in to comment.