Move definition of __AFL_LEAK_CHECK inside ifguards,
use LSAN_OPTIONS=print_suppressions=0
MODIFY
docs/env_variables.md
docs/env_variables.md
@@ -640,6 +640,7 @@ optimal values if not already present in the environment:
exit_code=23
fast_unwind_on_malloc=0
symbolize=0
+ print_suppressions=0
```
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

MODIFY
src/afl-analyze.c
src/afl-analyze.c
@@ -833,7 +833,8 @@ static void set_up_environment(void) {
setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":"
"fast_unwind_on_malloc=0:"
- "symbolize=0",
+ "symbolize=0:"
+ "print_suppressions=0",
0);

MODIFY
src/afl-cc.c
src/afl-cc.c
@@ -819,6 +819,9 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (getenv("AFL_USE_LSAN")) {
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")) {
@@ -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++] =
"-D__AFL_COVERAGE_START_OFF()=int __afl_selective_coverage_start_off = "
"1;";

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

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

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

Move definition of __AFL_LEAK_CHECK inside ifguards,
use LSAN_OPTIONS=print_suppressions=0