mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 18:48:08 +00:00
Merge pull request #1714 from choller/dev
Add env var to ignore coverage from dynamically loaded code after forkserver
This commit is contained in:
@ -1563,17 +1563,27 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
|
|||||||
"[-] FATAL: forkserver is already up, but an instrumented dlopen() "
|
"[-] FATAL: forkserver is already up, but an instrumented dlopen() "
|
||||||
"library loaded afterwards. You must AFL_PRELOAD such libraries to "
|
"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"
|
"be able to fuzz them or LD_PRELOAD to run outside of afl-fuzz.\n"
|
||||||
"To ignore this set AFL_IGNORE_PROBLEMS=1 but this will be bad for "
|
"To ignore this set AFL_IGNORE_PROBLEMS=1 but this will lead to "
|
||||||
"coverage.\n");
|
"ambiguous coverage data.\n"
|
||||||
|
"In addition, you can set AFL_LLVM_IGNORE_PROBLEMS_COVERAGE=1 to "
|
||||||
|
"ignore the additional coverage instead (use with caution!).\n");
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
u8 ignore_dso_after_fs = !!getenv("AFL_LLVM_IGNORE_PROBLEMS_COVERAGE");
|
||||||
|
if (__afl_debug && ignore_dso_after_fs) {
|
||||||
|
|
||||||
|
fprintf(stderr, "Ignoring coverage from dynamically loaded code\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static u32 offset = 5;
|
static u32 offset = 5;
|
||||||
|
|
||||||
while (start < stop) {
|
while (start < stop) {
|
||||||
|
|
||||||
if (likely(inst_ratio == 100) || R(100) < inst_ratio) {
|
if (!ignore_dso_after_fs &&
|
||||||
|
(likely(inst_ratio == 100) || R(100) < inst_ratio)) {
|
||||||
|
|
||||||
*(start++) = offset;
|
*(start++) = offset;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user