Replace __AFL_CHECK_LEAK with __AFL_LEAK_CHECK to be more proper.

Fix spelling mistakes.

Correctly call LSAN_ERROR not MSAN_ERROR.
This commit is contained in:
Joshua Rogers
2021-04-02 22:32:38 +00:00
parent 920e9402a4
commit 6514e33ab6
4 changed files with 7 additions and 7 deletions

View File

@ -55,7 +55,7 @@ make fairly broad use of environmental variables instead:
overridden. overridden.
- Setting `AFL_USE_ASAN` automatically enables ASAN, provided that your - Setting `AFL_USE_ASAN` automatically enables ASAN, provided that your
compiler supports itt. Note that fuzzing with ASAN is mildly challenging compiler supports it. Note that fuzzing with ASAN is mildly challenging
- see [notes_for_asan.md](notes_for_asan.md). - see [notes_for_asan.md](notes_for_asan.md).
(You can also enable MSAN via `AFL_USE_MSAN`; ASAN and MSAN come with the (You can also enable MSAN via `AFL_USE_MSAN`; ASAN and MSAN come with the
@ -66,8 +66,8 @@ make fairly broad use of environmental variables instead:
- Setting `AFL_USE_LSAN` automatically enables Leak-Sanitizer, provided - Setting `AFL_USE_LSAN` automatically enables Leak-Sanitizer, provided
that your compiler supports it. To perform a leak check within your that your compiler supports it. To perform a leak check within your
program at a certain point (such as at the end of an __AFL_LOOP, program at a certain point (such as at the end of an __AFL_LOOP),
you can run the macro __AFL_CHECK_LEAK(); which will cause you can run the macro __AFL_LEAK_CHECK(); which will cause
an abort if any memory is leaked (you can combine this with the an abort if any memory is leaked (you can combine this with the
LSAN_OPTIONS=suppressions option to supress some known leaks). LSAN_OPTIONS=suppressions option to supress some known leaks).
@ -637,7 +637,7 @@ optimal values if not already present in the environment:
``` ```
- Similarly, the default `LSAN_OPTIONS` are set to: - Similarly, the default `LSAN_OPTIONS` are set to:
``` ```
exit_code=86 exit_code=23
fast_unwind_on_malloc=0 fast_unwind_on_malloc=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

View File

@ -30,7 +30,7 @@ Note that ASAN is incompatible with -static, so be mindful of that.
When compiling with AFL_USE_LSAN, the leak sanitizer will normally run When compiling with AFL_USE_LSAN, the leak sanitizer will normally run
when the program exits. In order to utilize this check at different times, when the program exits. In order to utilize this check at different times,
such as at the end of a loop, you may use the macro __AFL_CHECK_LEAK();. such as at the end of a loop, you may use the macro __AFL_LEAK_CHECK();.
This macro will report a crash in afl-fuzz if any memory is left leaking This macro will report a crash in afl-fuzz if any memory is left leaking
at this stage. You can also use LSAN_OPTIONS and a supressions file at this stage. You can also use LSAN_OPTIONS and a supressions file
for more fine-tuned checking, however make sure you keep exitcode=23. for more fine-tuned checking, however make sure you keep exitcode=23.

View File

@ -832,7 +832,7 @@ static void set_up_environment(void) {
"handle_sigill=0", 0); "handle_sigill=0", 0);
setenv("LSAN_OPTIONS", setenv("LSAN_OPTIONS",
"exitcode=" STRINGIFY(MSAN_ERROR) ":" "exitcode=" STRINGIFY(LSAN_ERROR) ":"
"fast_unwind_on_malloc=0", "fast_unwind_on_malloc=0",
0); 0);

View File

@ -923,7 +923,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} }
cc_params[cc_par_cnt++] = cc_params[cc_par_cnt++] =
"-D__AFL_CHECK_LEAK()=__lsan_do_leak_check()"; "-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 = "