try enhanced asan support

This commit is contained in:
vanhauser-thc
2024-04-30 11:59:42 +02:00
parent 69e554b941
commit 5d623a27ed
2 changed files with 11 additions and 4 deletions

View File

@ -1911,7 +1911,13 @@ void add_sanitizers(aflcc_state_t *aflcc, char **envp) {
} }
add_defs_fortify(aflcc, 0); add_defs_fortify(aflcc, 0);
if (!aflcc->have_asan) { insert_param(aflcc, "-fsanitize=address"); } if (!aflcc->have_asan) {
insert_param(aflcc, "-fsanitize=address");
insert_param(aflcc, "-fno-common");
}
aflcc->have_asan = 1; aflcc->have_asan = 1;
} else if (getenv("AFL_USE_MSAN") || aflcc->have_msan) { } else if (getenv("AFL_USE_MSAN") || aflcc->have_msan) {

View File

@ -108,9 +108,10 @@ void set_sanitizer_defaults() {
u8 *have_lsan_options = getenv("LSAN_OPTIONS"); u8 *have_lsan_options = getenv("LSAN_OPTIONS");
u8 have_san_options = 0; u8 have_san_options = 0;
u8 default_options[1024] = u8 default_options[1024] =
"detect_odr_violation=0:abort_on_error=1:symbolize=0:allocator_may_" "detect_odr_violation=0:abort_on_error=1:symbolize=0:"
"return_null=1:handle_segv=0:handle_sigbus=0:handle_abort=0:handle_" "allocator_may_return_null=1:handle_segv=0:handle_sigbus=0:"
"sigfpe=0:handle_sigill=0:"; "handle_abort=0:handle_sigfpe=0:handle_sigill=0:"
"detect_stack_use_after_return=0:check_initialization_order=0:";
if (have_asan_options || have_ubsan_options || have_msan_options || if (have_asan_options || have_ubsan_options || have_msan_options ||
have_lsan_options) { have_lsan_options) {