diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-05-15 09:45:50 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-05-15 09:45:50 +0200 |
| commit | 661fd7b9882caba55e3fbc1c95fd4602ebfe580d (patch) | |
| tree | 094c26cb6f6c93af9b833493f427327055c2c364 /executor/executor_linux.cc | |
| parent | d2284dda4086f426af7ba2c595beff6c09204628 (diff) | |
executor: revert protection of kcov region
Turns out it's protection of kcov region that causes coverage drop.
Revert it and re-enable coverage filtering.
Diffstat (limited to 'executor/executor_linux.cc')
| -rw-r--r-- | executor/executor_linux.cc | 10 |
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 |
