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.
This commit is contained in:
Dmitry Vyukov 2018-05-15 09:45:50 +02:00
parent d2284dda40
commit 661fd7b988

View File

@ -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