diff options
-rw-r--r-- | instrumentation/afl-compiler-rt.o.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c index cc73e5ec..65dafb8c 100644 --- a/instrumentation/afl-compiler-rt.o.c +++ b/instrumentation/afl-compiler-rt.o.c @@ -1417,6 +1417,20 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) { if (start == stop || *start) return; + // If a dlopen of an instrumented library happens after the forkserver then + // we have a problem. + // Should we abort()? This way a user would/could find out. + // Currently we just do not instrument that lib, which is invisible. + if (__afl_already_initialized_forkserver) { + + fprintf(stderr, + "[-] ERROR: forkserver is already up, but an instrumented dlopen() " + "library loaded afterwards. You must LD_PRELOAD such libraries to " + "be able to fuzz them.\n"); + return; // or should be abort()? + + } + x = getenv("AFL_INST_RATIO"); if (x) inst_ratio = (u32)atoi(x); |