renamed env var to AFL_DEBUG_CHILD

This commit is contained in:
Dominik Maier
2020-11-18 03:02:13 +01:00
parent 57f8aec381
commit f80f62f14b
12 changed files with 32 additions and 18 deletions

View File

@ -58,6 +58,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- added INTROSPECTION support for custom modules - added INTROSPECTION support for custom modules
- python fuzz function was not optional, fixed - python fuzz function was not optional, fixed
- unicornafl synced with upstream (arm64 fix, better rust bindings) - unicornafl synced with upstream (arm64 fix, better rust bindings)
- renamed AFL_DEBUG_CHILD_OUTPUT to AFL_DEBUG_CHILD
### Version ++2.68c (release) ### Version ++2.68c (release)

View File

@ -388,7 +388,7 @@ checks or alter some of the more exotic semantics of the tool:
processing the first queue entry; and `AFL_BENCH_UNTIL_CRASH` causes it to processing the first queue entry; and `AFL_BENCH_UNTIL_CRASH` causes it to
exit soon after the first crash is found. exit soon after the first crash is found.
- Setting `AFL_DEBUG_CHILD_OUTPUT` will not suppress the child output. - Setting `AFL_DEBUG_CHILD` will not suppress the child output.
Not pretty but good for debugging purposes. Not pretty but good for debugging purposes.
- Setting `AFL_NO_CPU_RED` will not display very high cpu usages in red color. - Setting `AFL_NO_CPU_RED` will not display very high cpu usages in red color.

View File

@ -636,8 +636,11 @@ int main(int argc, char **argv_orig, char **envp) {
if (listen(sock, 1) < 0) { PFATAL("listen() failed"); } if (listen(sock, 1) < 0) { PFATAL("listen() failed"); }
afl_fsrv_start(fsrv, use_argv, &stop_soon, afl_fsrv_start(
get_afl_env("AFL_DEBUG_CHILD_OUTPUT") ? 1 : 0); fsrv, use_argv, &stop_soon,
(get_afl_env("AFL_DEBUG_CHILD") || get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
? 1
: 0);
#ifdef USE_DEFLATE #ifdef USE_DEFLATE
compressor = libdeflate_alloc_compressor(1); compressor = libdeflate_alloc_compressor(1);

View File

@ -362,8 +362,8 @@ typedef struct afl_env_vars {
u8 afl_skip_cpufreq, afl_exit_when_done, afl_no_affinity, afl_skip_bin_check, u8 afl_skip_cpufreq, afl_exit_when_done, afl_no_affinity, afl_skip_bin_check,
afl_dumb_forksrv, afl_import_first, afl_custom_mutator_only, afl_no_ui, afl_dumb_forksrv, afl_import_first, afl_custom_mutator_only, afl_no_ui,
afl_force_ui, afl_i_dont_care_about_missing_crashes, afl_bench_just_one, afl_force_ui, afl_i_dont_care_about_missing_crashes, afl_bench_just_one,
afl_bench_until_crash, afl_debug_child_output, afl_autoresume, afl_bench_until_crash, afl_debug_child, afl_autoresume, afl_cal_fast,
afl_cal_fast, afl_cycle_schedules, afl_expand_havoc, afl_statsd; afl_cycle_schedules, afl_expand_havoc, afl_statsd;
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_skip_crashes, *afl_preload, *afl_hang_tmout, *afl_forksrv_init_tmout, *afl_skip_crashes, *afl_preload,

View File

@ -6,6 +6,7 @@ static char *afl_environment_deprecated[] = {
"AFL_LLVM_WHITELIST", "AFL_LLVM_WHITELIST",
"AFL_GCC_WHITELIST", "AFL_GCC_WHITELIST",
"AFL_DEBUG_CHILD_OUTPUT",
"AFL_DEFER_FORKSRV", "AFL_DEFER_FORKSRV",
"AFL_POST_LIBRARY", "AFL_POST_LIBRARY",
"AFL_PERSISTENT", "AFL_PERSISTENT",
@ -36,7 +37,7 @@ static char *afl_environment_variables[] = {
"AFL_CXX", "AFL_CXX",
"AFL_CYCLE_SCHEDULES", "AFL_CYCLE_SCHEDULES",
"AFL_DEBUG", "AFL_DEBUG",
"AFL_DEBUG_CHILD_OUTPUT", "AFL_DEBUG_CHILD",
"AFL_DEBUG_GDB", "AFL_DEBUG_GDB",
"AFL_DISABLE_TRIM", "AFL_DISABLE_TRIM",
"AFL_DONT_OPTIMIZE", "AFL_DONT_OPTIMIZE",

View File

@ -992,7 +992,7 @@ void __sanitizer_cov_trace_pc_guard(uint32_t *guard) {
// For stability analysis, if you want to know to which function unstable // For stability analysis, if you want to know to which function unstable
// edge IDs belong - uncomment, recompile+install llvm_mode, recompile // edge IDs belong - uncomment, recompile+install llvm_mode, recompile
// the target. libunwind and libbacktrace are better solutions. // the target. libunwind and libbacktrace are better solutions.
// Set AFL_DEBUG_CHILD_OUTPUT=1 and run afl-fuzz with 2>file to capture // Set AFL_DEBUG_CHILD=1 and run afl-fuzz with 2>file to capture
// the backtrace output // the backtrace output
/* /*
uint32_t unstable[] = { ... unstable edge IDs }; uint32_t unstable[] = { ... unstable edge IDs };

View File

@ -332,7 +332,7 @@ u8 calibrate_case(afl_state_t *afl, struct queue_entry *q, u8 *use_mem,
} }
afl_fsrv_start(&afl->fsrv, afl->argv, &afl->stop_soon, afl_fsrv_start(&afl->fsrv, afl->argv, &afl->stop_soon,
afl->afl_env.afl_debug_child_output); afl->afl_env.afl_debug_child);
if (afl->fsrv.support_shmem_fuzz && !afl->fsrv.use_shmem_fuzz) { if (afl->fsrv.support_shmem_fuzz && !afl->fsrv.use_shmem_fuzz) {

View File

@ -268,11 +268,13 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
afl->afl_env.afl_bench_until_crash = afl->afl_env.afl_bench_until_crash =
get_afl_env(afl_environment_variables[i]) ? 1 : 0; get_afl_env(afl_environment_variables[i]) ? 1 : 0;
} else if (!strncmp(env, "AFL_DEBUG_CHILD_OUTPUT", } else if (!strncmp(env, "AFL_DEBUG_CHILD",
afl_environment_variable_len) ||
!strncmp(env, "AFL_DEBUG_CHILD_OUTPUT",
afl_environment_variable_len)) { afl_environment_variable_len)) {
afl->afl_env.afl_debug_child_output = afl->afl_env.afl_debug_child =
get_afl_env(afl_environment_variables[i]) ? 1 : 0; get_afl_env(afl_environment_variables[i]) ? 1 : 0;
} else if (!strncmp(env, "AFL_AUTORESUME", } else if (!strncmp(env, "AFL_AUTORESUME",

View File

@ -166,7 +166,7 @@ static void usage(u8 *argv0, int more_help) {
"AFL_CUSTOM_MUTATOR_ONLY: avoid AFL++'s internal mutators\n" "AFL_CUSTOM_MUTATOR_ONLY: avoid AFL++'s internal mutators\n"
"AFL_CYCLE_SCHEDULES: after completing a cycle, switch to a different -p schedule\n" "AFL_CYCLE_SCHEDULES: after completing a cycle, switch to a different -p schedule\n"
"AFL_DEBUG: extra debugging output for Python mode trimming\n" "AFL_DEBUG: extra debugging output for Python mode trimming\n"
"AFL_DEBUG_CHILD_OUTPUT: do not suppress stdout/stderr from target\n" "AFL_DEBUG_CHILD: do not suppress stdout/stderr from target\n"
"AFL_DISABLE_TRIM: disable the trimming of test cases\n" "AFL_DISABLE_TRIM: disable the trimming of test cases\n"
"AFL_DUMB_FORKSRV: use fork server without feedback from target\n" "AFL_DUMB_FORKSRV: use fork server without feedback from target\n"
"AFL_EXIT_WHEN_DONE: exit when all inputs are run and no new finds are found\n" "AFL_EXIT_WHEN_DONE: exit when all inputs are run and no new finds are found\n"
@ -1426,7 +1426,7 @@ int main(int argc, char **argv_orig, char **envp) {
afl->cmplog_fsrv.cmplog_binary = afl->cmplog_binary; afl->cmplog_fsrv.cmplog_binary = afl->cmplog_binary;
afl->cmplog_fsrv.init_child_func = cmplog_exec_child; afl->cmplog_fsrv.init_child_func = cmplog_exec_child;
afl_fsrv_start(&afl->cmplog_fsrv, afl->argv, &afl->stop_soon, afl_fsrv_start(&afl->cmplog_fsrv, afl->argv, &afl->stop_soon,
afl->afl_env.afl_debug_child_output); afl->afl_env.afl_debug_child);
OKF("Cmplog forkserver successfully started"); OKF("Cmplog forkserver successfully started");
} }

View File

@ -1091,7 +1091,11 @@ int main(int argc, char **argv_orig, char **envp) {
} }
afl_fsrv_start(fsrv, use_argv, &stop_soon, afl_fsrv_start(fsrv, use_argv, &stop_soon,
get_afl_env("AFL_DEBUG_CHILD_OUTPUT") ? 1 : 0); (get_afl_env("AFL_DEBUG_CHILD") ||
get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
? 1
: 0);
map_size = fsrv->map_size; map_size = fsrv->map_size;
if (fsrv->support_shmem_fuzz && !fsrv->use_shmem_fuzz) if (fsrv->support_shmem_fuzz && !fsrv->use_shmem_fuzz)

View File

@ -1141,8 +1141,11 @@ int main(int argc, char **argv_orig, char **envp) {
read_initial_file(); read_initial_file();
afl_fsrv_start(fsrv, use_argv, &stop_soon, afl_fsrv_start(
get_afl_env("AFL_DEBUG_CHILD_OUTPUT") ? 1 : 0); fsrv, use_argv, &stop_soon,
(get_afl_env("AFL_DEBUG_CHILD") || get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
? 1
: 0);
if (fsrv->support_shmem_fuzz && !fsrv->use_shmem_fuzz) if (fsrv->support_shmem_fuzz && !fsrv->use_shmem_fuzz)
shm_fuzz = deinit_shmem(fsrv, shm_fuzz); shm_fuzz = deinit_shmem(fsrv, shm_fuzz);

View File

@ -7,7 +7,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/samples/shel
test -e ../unicorn_mode/samples/simple/simple_target.bin -a -e ../unicorn_mode/samples/compcov_x64/compcov_target.bin && { test -e ../unicorn_mode/samples/simple/simple_target.bin -a -e ../unicorn_mode/samples/compcov_x64/compcov_target.bin && {
{ {
# We want to see python errors etc. in logs, in case something doesn't work # We want to see python errors etc. in logs, in case something doesn't work
export AFL_DEBUG_CHILD_OUTPUT=1 export AFL_DEBUG_CHILD=1
# some python version should be available now # some python version should be available now
PYTHONS="`command -v python3` `command -v python` `command -v python2`" PYTHONS="`command -v python3` `command -v python` `command -v python2`"
@ -34,7 +34,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/samples/shel
cd ../unicorn_mode/samples/persistent cd ../unicorn_mode/samples/persistent
make >>errors 2>&1 make >>errors 2>&1
$ECHO "$GREY[*] running afl-fuzz for unicorn_mode (persistent), this will take approx 25 seconds" $ECHO "$GREY[*] running afl-fuzz for unicorn_mode (persistent), this will take approx 25 seconds"
AFL_DEBUG_CHILD_OUTPUT=1 ../../../afl-fuzz -m none -V25 -U -i sample_inputs -o out -d -- ./harness @@ >>errors 2>&1 AFL_DEBUG_CHILD=1 ../../../afl-fuzz -m none -V25 -U -i sample_inputs -o out -d -- ./harness @@ >>errors 2>&1
test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && { test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
$ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode (persistent)" $ECHO "$GREEN[+] afl-fuzz is working correctly with unicorn_mode (persistent)"
} || { } || {
@ -96,7 +96,7 @@ test -d ../unicorn_mode/unicornafl -a -e ../unicorn_mode/unicornafl/samples/shel
} }
fi fi
unset AFL_DEBUG_CHILD_OUTPUT unset AFL_DEBUG_CHILD
} }
} || { } || {