aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_linux.h
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-08-26 14:34:47 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-08-26 19:29:53 +0200
commitb318694d0fc0781d0bc1e3aebfb916aa36731024 (patch)
treebbb634683d76354341bebb3c1c464b9d01c052d9 /executor/executor_linux.h
parentb599f2fcc734e2183016a340d4f6fc2891d8e41f (diff)
executor: fix remote coverage collection
Currently the data_offset field of cover_t is only initialized for per-syscall coverage collection. As a result, remote coverage is read from an invalid location, fails to pass sanity checks and is not returned to syzkaller. Fix the initialization of cover_t fields.
Diffstat (limited to 'executor/executor_linux.h')
-rw-r--r--executor/executor_linux.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/executor/executor_linux.h b/executor/executor_linux.h
index 3a0620fcd..ed3cbafb3 100644
--- a/executor/executor_linux.h
+++ b/executor/executor_linux.h
@@ -91,6 +91,8 @@ static void cover_open(cover_t* cov, bool extra)
if (cov->data == MAP_FAILED)
fail("cover mmap failed");
cov->data_end = cov->data + mmap_alloc_size;
+ cov->data_offset = is_kernel_64_bit ? sizeof(uint64_t) : sizeof(uint32_t);
+ cov->pc_offset = 0;
}
static void cover_protect(cover_t* cov)