diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2018-11-22 19:04:06 +0100 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2019-01-16 19:19:53 +0100 |
| commit | b5df78dc5d994bc61f1ecee2c5c85313178f392e (patch) | |
| tree | c285f3be9e8d0ef32e607186ec9ce9eae6901cce /executor/executor_bsd.h | |
| parent | c0d4a12ee72a2279eada43d9476d2f8a074c3818 (diff) | |
all: support extra coverage
Right now syzkaller only supports coverage collected from the threads that
execute syscalls. However some useful things happen in background threads,
and it would be nice to collect coverage from those threads as well.
This change adds extra coverage support to syzkaller. This coverage is not
associated with a particular syscall, but rather with the whole program.
Executor passes extra coverage over the same ipc mechanism to syz-fuzzer
with syscall number set to -1. syz-fuzzer then passes this coverage to
syz-manager with the call name "extra".
This change requires the following kcov patch:
https://github.com/xairy/linux/pull/2
Diffstat (limited to 'executor/executor_bsd.h')
| -rw-r--r-- | executor/executor_bsd.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/executor/executor_bsd.h b/executor/executor_bsd.h index e0fce2c1e..3af57fa5b 100644 --- a/executor/executor_bsd.h +++ b/executor/executor_bsd.h @@ -54,7 +54,7 @@ static long execute_syscall(const call_t* c, long a[kMaxArgs]) #if GOOS_freebsd || GOOS_openbsd -static void cover_open(cover_t* cov) +static void cover_open(cover_t* cov, bool extra) { int fd = open("/dev/kcov", O_RDWR); if (fd == -1) @@ -85,7 +85,7 @@ static void cover_open(cover_t* cov) cov->data_end = cov->data + mmap_alloc_size; } -static void cover_enable(cover_t* cov, bool collect_comps) +static void cover_enable(cover_t* cov, bool collect_comps, bool extra) { int kcov_mode = collect_comps ? KCOV_MODE_TRACE_CMP : KCOV_MODE_TRACE_PC; #if GOOS_freebsd |
