feat: allow to skip readme creation on crash

This commit is contained in:
Ruben ten Hove
2022-06-17 21:03:46 +02:00
parent 80892b8fc5
commit 3d1a57deed
5 changed files with 15 additions and 6 deletions

View File

@ -619,6 +619,10 @@ The QEMU wrapper used to instrument binary-only code supports several settings:
emulation" variables (e.g., `QEMU_STACK_SIZE`), but there should be no emulation" variables (e.g., `QEMU_STACK_SIZE`), but there should be no
reason to touch them. reason to touch them.
- Normally a `README.txt` is written to the `crashes/` directory when a first
crash is found. Setting `AFL_NO_CRASH_README` will prevent this. Useful when
counting crashes based on a file count in that directory.
## 7) Settings for afl-frida-trace ## 7) Settings for afl-frida-trace
The FRIDA wrapper used to instrument binary-only code supports many of the same The FRIDA wrapper used to instrument binary-only code supports many of the same

View File

@ -386,7 +386,7 @@ typedef struct afl_env_vars {
afl_bench_until_crash, afl_debug_child, afl_autoresume, afl_cal_fast, afl_bench_until_crash, afl_debug_child, afl_autoresume, afl_cal_fast,
afl_cycle_schedules, afl_expand_havoc, afl_statsd, afl_cmplog_only_new, afl_cycle_schedules, afl_expand_havoc, afl_statsd, afl_cmplog_only_new,
afl_exit_on_seed_issues, afl_try_affinity, afl_ignore_problems, afl_exit_on_seed_issues, afl_try_affinity, afl_ignore_problems,
afl_keep_timeouts, afl_pizza_mode; afl_keep_timeouts, afl_pizza_mode, afl_no_crash_readme;
u8 *afl_tmpdir, *afl_custom_mutator_library, *afl_python_module, *afl_path, u8 *afl_tmpdir, *afl_custom_mutator_library, *afl_python_module, *afl_path,
*afl_hang_tmout, *afl_forksrv_init_tmout, *afl_preload, *afl_hang_tmout, *afl_forksrv_init_tmout, *afl_preload,
@ -1267,4 +1267,3 @@ void queue_testcase_store_mem(afl_state_t *afl, struct queue_entry *q, u8 *mem);
#endif #endif
#endif #endif

View File

@ -159,6 +159,7 @@ static char *afl_environment_variables[] = {
"AFL_NO_COLOUR", "AFL_NO_COLOUR",
#endif #endif
"AFL_NO_CPU_RED", "AFL_NO_CPU_RED",
"AFL_NO_CRASH_README",
"AFL_NO_FORKSRV", "AFL_NO_FORKSRV",
"AFL_NO_UI", "AFL_NO_UI",
"AFL_NO_PYTHON", "AFL_NO_PYTHON",
@ -234,4 +235,3 @@ static char *afl_environment_variables[] = {
extern char *afl_environment_variables[]; extern char *afl_environment_variables[];
#endif #endif

View File

@ -720,7 +720,7 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) {
} }
if (unlikely(!afl->saved_crashes)) { write_crash_readme(afl); } if (unlikely(!afl->saved_crashes) && (afl->afl_env.afl_no_crash_readme != 1)) { write_crash_readme(afl); }
#ifndef SIMPLE_FILES #ifndef SIMPLE_FILES
@ -821,4 +821,3 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) {
return keeping; return keeping;
} }

View File

@ -510,6 +510,14 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
afl->afl_env.afl_pizza_mode = afl->afl_env.afl_pizza_mode =
atoi((u8 *)get_afl_env(afl_environment_variables[i])); atoi((u8 *)get_afl_env(afl_environment_variables[i]));
} else if (!strncmp(env, "AFL_NO_CRASH_README",
afl_environment_variable_len)) {
afl->afl_env.afl_no_crash_readme =
atoi((u8 *)get_afl_env(afl_environment_variables[i]));
if (afl->afl_env.afl_pizza_mode == 0) { if (afl->afl_env.afl_pizza_mode == 0) {
afl->afl_env.afl_pizza_mode = 1; afl->afl_env.afl_pizza_mode = 1;
@ -665,4 +673,3 @@ void afl_states_request_skip(void) {
LIST_FOREACH(&afl_states, afl_state_t, { el->skip_requested = 1; }); LIST_FOREACH(&afl_states, afl_state_t, { el->skip_requested = 1; });
} }