Move definition of __AFL_LEAK_CHECK inside ifguards,

use LSAN_OPTIONS=print_suppressions=0
This commit is contained in:
Joshua Rogers
2021-04-04 12:45:52 +00:00
parent fee7470083
commit 99819cf5d1
6 changed files with 12 additions and 11 deletions

View File

@ -640,6 +640,7 @@ optimal values if not already present in the environment:
exit_code=23 exit_code=23
fast_unwind_on_malloc=0 fast_unwind_on_malloc=0
symbolize=0 symbolize=0
print_suppressions=0
``` ```
Be sure to include the first ones for LSAN and MSAN when customizing Be sure to include the first ones for LSAN and MSAN when customizing
anything, since some MSAN and LSAN versions don't call `abort()` on anything, since some MSAN and LSAN versions don't call `abort()` on

View File

@ -833,7 +833,8 @@ static void set_up_environment(void) {
setenv("LSAN_OPTIONS", setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":" "exitcode=" STRINGIFY(LSAN_ERROR) ":"
"fast_unwind_on_malloc=0:" "fast_unwind_on_malloc=0:"
"symbolize=0", "symbolize=0:"
"print_suppressions=0",
0); 0);

View File

@ -819,6 +819,9 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (getenv("AFL_USE_LSAN")) { if (getenv("AFL_USE_LSAN")) {
cc_params[cc_par_cnt++] = "-fsanitize=leak"; cc_params[cc_par_cnt++] = "-fsanitize=leak";
cc_params[cc_par_cnt++] = "-includesanitizer/lsan_interface.h";
cc_params[cc_par_cnt++] =
"-D__AFL_LEAK_CHECK()=__lsan_do_leak_check()";
} }
if (getenv("AFL_USE_CFISAN")) { if (getenv("AFL_USE_CFISAN")) {
@ -918,13 +921,6 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} }
if (getenv("AFL_USE_LSAN")) {
cc_params[cc_par_cnt++] = "-includesanitizer/lsan_interface.h";
}
cc_params[cc_par_cnt++] =
"-D__AFL_LEAK_CHECK()=__lsan_do_leak_check()";
cc_params[cc_par_cnt++] = cc_params[cc_par_cnt++] =
"-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = " "-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = "
"1;"; "1;";

View File

@ -544,7 +544,8 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
setenv("LSAN_OPTIONS", setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":" "exitcode=" STRINGIFY(LSAN_ERROR) ":"
"fast_unwind_on_malloc=0:" "fast_unwind_on_malloc=0:"
"symbolize=0", "symbolize=0:"
"print_suppressions=0",
1); 1);
fsrv->init_child_func(fsrv, argv); fsrv->init_child_func(fsrv, argv);

View File

@ -574,7 +574,8 @@ static void set_up_environment(afl_forkserver_t *fsrv) {
setenv("LSAN_OPTIONS", setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":" "exitcode=" STRINGIFY(LSAN_ERROR) ":"
"fast_unwind_on_malloc=0:" "fast_unwind_on_malloc=0:"
"symbolize=0", "symbolize=0:"
"print_suppressions=0",
0); 0);
setenv("UBSAN_OPTIONS", setenv("UBSAN_OPTIONS",

View File

@ -764,7 +764,8 @@ static void set_up_environment(afl_forkserver_t *fsrv) {
setenv("LSAN_OPTIONS", setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":" "exitcode=" STRINGIFY(LSAN_ERROR) ":"
"fast_unwind_on_malloc=0:" "fast_unwind_on_malloc=0:"
"symbolize=0", "symbolize=0:"
"print_suppressions=0",
0); 0);
if (get_afl_env("AFL_PRELOAD")) { if (get_afl_env("AFL_PRELOAD")) {