summaryrefslogtreecommitdiff
path: root/linux/perf.c
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2017-03-06 23:21:55 +0100
committerRobert Swiecki <robert@swiecki.net>2017-03-06 23:21:55 +0100
commit26753f0b0b17edd26142bbf950ff3030574d4aa6 (patch)
treeb3bbbc6a19e638623fab62d50e65510c9e52c134 /linux/perf.c
parent1163b9bc2319588d7d675d3f471d83580a012543 (diff)
downloadhonggfuzz-26753f0b0b17edd26142bbf950ff3030574d4aa6.tar.gz
linux: map aux buffer as prot_read
Diffstat (limited to 'linux/perf.c')
-rw-r--r--linux/perf.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/linux/perf.c b/linux/perf.c
index ef13dbe9..0eb39227 100644
--- a/linux/perf.c
+++ b/linux/perf.c
@@ -215,7 +215,7 @@ static bool arch_perfCreate(honggfuzz_t * hfuzz, fuzzer_t * fuzzer UNUSED, pid_t
pem->aux_offset = pem->data_offset + pem->data_size;
pem->aux_size = _HF_PERF_AUX_SZ;
fuzzer->linux.perfMmapAux =
- mmap(NULL, pem->aux_size, PROT_READ | PROT_WRITE, MAP_SHARED, *perfFd, pem->aux_offset);
+ mmap(NULL, pem->aux_size, PROT_READ, MAP_SHARED, *perfFd, pem->aux_offset);
if (fuzzer->linux.perfMmapAux == MAP_FAILED) {
munmap(fuzzer->linux.perfMmapBuf, _HF_PERF_MAP_SZ + getpagesize());
@@ -392,14 +392,10 @@ void arch_perfAnalyze(honggfuzz_t * hfuzz, fuzzer_t * fuzzer)
if (fuzzer->linux.perfMmapBuf != NULL) {
struct perf_event_mmap_page *pem = (struct perf_event_mmap_page *)fuzzer->linux.perfMmapBuf;
- ATOMIC_SET(pem->aux_head, 0);
- ATOMIC_SET(pem->aux_tail, 0);
- ATOMIC_SET(pem->aux_offset, 0);
- ATOMIC_SET(pem->aux_size, 0);
ATOMIC_SET(pem->data_head, 0);
ATOMIC_SET(pem->data_tail, 0);
- ATOMIC_SET(pem->data_offset, 0);
- ATOMIC_SET(pem->data_size, 0);
+ ATOMIC_SET(pem->aux_head, 0);
+ ATOMIC_SET(pem->aux_tail, 0);
}
fuzzer->linux.hwCnts.cpuInstrCnt = instrCount;