Fix typos,
Use symbolize=0 for LSAN,
Remove syntactic sugar.
MODIFY
README.md
README.md
@@ -601,7 +601,7 @@ Every -M/-S entry needs a unique name (that can be whatever), however the same
For every secondary fuzzer there should be a variation, e.g.:
* one should fuzz the target that was compiled differently: with sanitizers
activated (`export AFL_USE_ASAN=1 ; export AFL_USE_UBSAN=1 ;
- export AFL_USE_CFISAN=1 ; export AFL_USE_LSAN`)
+ export AFL_USE_CFISAN=1 ; export AFL_USE_LSAN=1`)
* one should fuzz the target with CMPLOG/redqueen (see above)
* one to three fuzzers should fuzz a target compiled with laf-intel/COMPCOV
(see above). Important note: If you run more than one laf-intel/COMPCOV

MODIFY
docs/env_variables.md
docs/env_variables.md
@@ -639,7 +639,8 @@ optimal values if not already present in the environment:
```
exit_code=23
fast_unwind_on_malloc=0
-````
+ symbolize=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
error, and we need a way to detect faults.

MODIFY
src/afl-analyze.c
src/afl-analyze.c
@@ -785,10 +785,9 @@ static void set_up_environment(void) {
if (x) {
- if (!strstr(x, "exit_code=" STRINGIFY(LSAN_ERROR))) {
+ if (!strstr(x, "symbolize=0")) {
- FATAL("Custom LSAN_OPTIONS set without exit_code=" STRINGIFY(
- LSAN_ERROR) " - please fix!");
+ FATAL("Custom LSAN_OPTIONS set without symbolize=0 - please fix!");
}
@@ -833,7 +832,8 @@ static void set_up_environment(void) {
setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":"
- "fast_unwind_on_malloc=0",
+ "fast_unwind_on_malloc=0:"
+ "symbolize=0",
0);

MODIFY
src/afl-cc.c
src/afl-cc.c
@@ -758,7 +758,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (!strncmp(cur, "-fsanitize-coverage-", 20) && strstr(cur, "list="))
have_instr_list = 1;
- if (!(strcmp(cur, "-fsanitize=address") && strcmp(cur, "-fsanitize=memory")))
+ if (!strcmp(cur, "-fsanitize=address") || !strcmp(cur, "-fsanitize=memory"))
asan_set = 1;
if (strstr(cur, "FORTIFY_SOURCE")) fortify_set = 1;

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

MODIFY
src/afl-fuzz-init.c
src/afl-fuzz-init.c
@@ -2470,10 +2470,9 @@ void check_asan_opts(afl_state_t *afl) {
if (x) {
- if (!strstr(x, "exit_code=" STRINGIFY(LSAN_ERROR))) {
+ if (!strstr(x, "symbolize=0")) {
- FATAL("Custom LSAN_OPTIONS set without exit_code=" STRINGIFY(
- LSAN_ERROR) " - please fix!");
+ FATAL("Custom LSAN_OPTIONS set without symbolize=0 - please fix!");
}

MODIFY
src/afl-showmap.c
src/afl-showmap.c
@@ -570,9 +570,11 @@ static void set_up_environment(afl_forkserver_t *fsrv) {
"handle_sigfpe=0:"
"handle_sigill=0",
0);
+
setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(LSAN_ERROR) ":"
- "fast_unwind_on_malloc=0",
+ "fast_unwind_on_malloc=0:"
+ "symbolize=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",
+ "fast_unwind_on_malloc=0:"
+ "symbolize=0",
0);
if (get_afl_env("AFL_PRELOAD")) {

Fix typos,
Use symbolize=0 for LSAN,
Remove syntactic sugar.