allow ignore dlopen issues

This commit is contained in:
vanhauser-thc 2021-12-17 09:42:05 +01:00
parent 641a943d95
commit b3a0ecfd48
2 changed files with 23 additions and 8 deletions

View File

@ -94,8 +94,8 @@ static char *afl_environment_variables[] = {
"AFL_FORKSRV_INIT_TMOUT", "AFL_FORKSRV_INIT_TMOUT",
"AFL_HARDEN", "AFL_HARDEN",
"AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES", "AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES",
"AFL_IGNORE_UNKNOWN_ENVS",
"AFL_IGNORE_PROBLEMS", "AFL_IGNORE_PROBLEMS",
"AFL_IGNORE_UNKNOWN_ENVS",
"AFL_IMPORT_FIRST", "AFL_IMPORT_FIRST",
"AFL_INST_LIBS", "AFL_INST_LIBS",
"AFL_INST_RATIO", "AFL_INST_RATIO",
@ -193,6 +193,7 @@ static char *afl_environment_variables[] = {
"AFL_SKIP_BIN_CHECK", "AFL_SKIP_BIN_CHECK",
"AFL_SKIP_CPUFREQ", "AFL_SKIP_CPUFREQ",
"AFL_SKIP_CRASHES", "AFL_SKIP_CRASHES",
"AFL_SKIP_OSSFUZZ",
"AFL_STATSD", "AFL_STATSD",
"AFL_STATSD_HOST", "AFL_STATSD_HOST",
"AFL_STATSD_PORT", "AFL_STATSD_PORT",

View File

@ -1421,11 +1421,25 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
// we have a problem as we cannot increase the coverage map anymore. // we have a problem as we cannot increase the coverage map anymore.
if (__afl_already_initialized_forkserver) { if (__afl_already_initialized_forkserver) {
fprintf(stderr, if (!getenv("AFL_IGNORE_PROBLEMS")) {
"[-] FATAL: forkserver is already up, but an instrumented dlopen() "
"library loaded afterwards. You must AFL_PRELOAD such libraries to " fprintf(
"be able to fuzz them or LD_PRELOAD to run outside of afl-fuzz.\n"); stderr,
abort(); "[-] FATAL: forkserver is already up, but an instrumented dlopen() "
"library loaded afterwards. You must AFL_PRELOAD such libraries to "
"be able to fuzz them or LD_PRELOAD to run outside of afl-fuzz.\n"
"To ignore this set AFL_IGNORE_PROBLEMS=1.\n");
abort();
} else {
while (start < stop) {
*(start++) = 4;
}
}
} }
@ -1462,7 +1476,7 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
if (R(100) < inst_ratio) if (R(100) < inst_ratio)
*start = ++__afl_final_loc % __afl_map_size; *start = ++__afl_final_loc % __afl_map_size;
else else
*start = 0; *start = 4;
start++; start++;
@ -1487,7 +1501,7 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
if (R(100) < inst_ratio) if (R(100) < inst_ratio)
*start = ++__afl_final_loc; *start = ++__afl_final_loc;
else else
*start = 0; *start = 4;
start++; start++;