diff options
| author | vanhauser-thc <vh@thc.org> | 2021-12-03 11:35:30 +0100 |
|---|---|---|
| committer | vanhauser-thc <vh@thc.org> | 2021-12-03 11:35:30 +0100 |
| commit | fc094dee13060fd84e89764a9526c11a55072e4d (patch) | |
| tree | eee935905f19703f7bb1bc9dd48b0deed6fe9e50 /instrumentation/SanitizerCoverageLTO.so.cc | |
| parent | a915c05740089890ce38a7809d3252116d1f4fb2 (diff) | |
| download | afl++-fc094dee13060fd84e89764a9526c11a55072e4d.tar.gz | |
change dlopen solution
Diffstat (limited to 'instrumentation/SanitizerCoverageLTO.so.cc')
| -rw-r--r-- | instrumentation/SanitizerCoverageLTO.so.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/instrumentation/SanitizerCoverageLTO.so.cc b/instrumentation/SanitizerCoverageLTO.so.cc index bff85a0a..8d7f0c80 100644 --- a/instrumentation/SanitizerCoverageLTO.so.cc +++ b/instrumentation/SanitizerCoverageLTO.so.cc @@ -1289,6 +1289,18 @@ void ModuleSanitizerCoverage::instrumentFunction( if (!Callee) continue; if (callInst->getCallingConv() != llvm::CallingConv::C) continue; StringRef FuncName = Callee->getName(); + if (!FuncName.compare(StringRef("dlopen")) || + !FuncName.compare(StringRef("_dlopen"))) { + + fprintf(stderr, + "WARNING: dlopen() detected. To have coverage for a library " + "that your target dlopen()'s this must either happen before " + "__AFL_INIT() or you must use AFL_PRELOAD to preload all " + "dlopen()'ed libraries!\n"); + continue; + + } + if (FuncName.compare(StringRef("__afl_coverage_interesting"))) continue; Value *val = ConstantInt::get(Int32Ty, ++afl_global_id); |
