aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
Diffstat (limited to 'executor')
-rw-r--r--executor/executor_linux.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/executor/executor_linux.cc b/executor/executor_linux.cc
index a6d264fde..4b88946dd 100644
--- a/executor/executor_linux.cc
+++ b/executor/executor_linux.cc
@@ -144,13 +144,11 @@ void cover_open()
if (ioctl(th->cover_fd, kcov_init_trace, kCoverSize))
fail("cover init trace write failed");
size_t mmap_alloc_size = kCoverSize * (is_kernel_64_bit ? 8 : 4);
- th->cover_data = (char*)mmap(NULL, mmap_alloc_size, PROT_READ, MAP_SHARED, th->cover_fd, 0);
+ th->cover_data = (char*)mmap(NULL, mmap_alloc_size,
+ PROT_READ | PROT_WRITE, MAP_SHARED, th->cover_fd, 0);
th->cover_end = th->cover_data + mmap_alloc_size;
if (th->cover_data == MAP_FAILED)
fail("cover mmap failed");
- // We only write to the first page, so protect the rest from fuzzer.
- if (mprotect(th->cover_data, SYZ_PAGE_SIZE, PROT_READ | PROT_WRITE))
- fail("cover mprotect failed");
}
}
@@ -199,9 +197,7 @@ bool cover_check(uint64 pc)
{
#if defined(__i386__) || defined(__x86_64__)
// Text/modules range for x86_64.
- // This causes very significant drop in corpus size. Needs additional debugging.
- // return pc >= 0xffffffff80000000ull && pc < 0xffffffffff000000ull;
- return true;
+ return pc >= 0xffffffff80000000ull && pc < 0xffffffffff000000ull;
#else
return true;
#endif