blob: 33a1c402a96837d03362f902f7d8eaa81272655c [file] [log] [blame]
robert.swiecki3bb518c2010-10-14 00:48:24 +00001/*
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +00002 *
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +00003 * honggfuzz - core structures and macros
4 * -----------------------------------------
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +00005 *
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +00006 * Author: Robert Swiecki <swiecki@google.com>
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +00007 *
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +00008 * Copyright 2010-2015 by Google Inc. All Rights Reserved.
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +00009 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License. You may obtain
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +000012 * a copy of the License at
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +000013 *
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +000014 * http://www.apache.org/licenses/LICENSE-2.0
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +000015 *
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +000016 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19 * implied. See the License for the specific language governing
20 * permissions and limitations under the License.
robert.swiecki@gmail.com3b630b42015-02-16 10:53:53 +000021 *
robert.swiecki@gmail.com772b33d2015-02-14 20:35:00 +000022 */
robert.swiecki3bb518c2010-10-14 00:48:24 +000023
Jagger876a74c2016-02-09 22:09:11 +010024#ifndef _HF_COMMON_H_
25#define _HF_COMMON_H_
robert.swiecki3bb518c2010-10-14 00:48:24 +000026
robert.swiecki@gmail.comba85c3e2015-02-02 14:55:16 +000027#include <limits.h>
robert.swiecki@gmail.com41d8e052015-02-19 01:10:41 +000028#include <pthread.h>
robert.swiecki3bb518c2010-10-14 00:48:24 +000029#include <stdbool.h>
30#include <stdint.h>
robert.swiecki@gmail.comba85c3e2015-02-02 14:55:16 +000031#include <sys/param.h>
Robert Swiecki3bfc33c2016-03-14 18:12:41 +010032#include <sys/queue.h>
robert.swiecki@gmail.comba85c3e2015-02-02 14:55:16 +000033#include <sys/types.h>
Jagger5f9c1292016-04-03 22:19:22 +020034#include <sys/wait.h>
Robert Swiecki64d74252016-03-31 17:28:56 +020035#include <time.h>
robert.swiecki3bb518c2010-10-14 00:48:24 +000036
Anestis Bechtsoudis4d9e8c92016-01-31 16:18:48 +020037#ifdef __clang__
38#include <stdatomic.h>
39#endif
40
Anestis Bechtsoudis2ff92d12015-12-20 15:33:20 +020041#ifndef UNUSED
42#define UNUSED __attribute__((unused))
43#endif
44
robert.swiecki3bb518c2010-10-14 00:48:24 +000045#define PROG_NAME "honggfuzz"
Anestis Bechtsoudisbfcba122016-04-28 10:55:20 +030046#define PROG_VERSION "0.7rc"
robert.swiecki32b69c92015-02-26 14:56:36 +000047#define PROG_AUTHORS "Robert Swiecki <swiecki@google.com> et al.,\nCopyright 2010-2015 by Google Inc. All Rights Reserved."
robert.swiecki3bb518c2010-10-14 00:48:24 +000048
Robert Swieckia9db9dd2016-03-09 16:29:37 +010049/* Go-style defer implementation */
50#define __STRMERGE(a, b) a##b
51#define _STRMERGE(a, b) __STRMERGE(a, b)
52
53#ifdef __clang__
Jagger4fe18692016-04-22 23:15:07 +020054static void __attribute__ ((unused)) __clang_cleanup_func(void (^*dfunc) (void))
Robert Swieckia9db9dd2016-03-09 16:29:37 +010055{
56 (*dfunc) ();
57}
58
Jagger4fe18692016-04-22 23:15:07 +020059#define defer void (^_STRMERGE(__defer_f_, __COUNTER__))(void) __attribute__((cleanup(__clang_cleanup_func))) __attribute__((unused)) = ^
Robert Swieckia9db9dd2016-03-09 16:29:37 +010060#else
61#define __block
Jagger4fe18692016-04-22 23:15:07 +020062#define _DEFER(a, count) \
63 auto void _STRMERGE(__defer_f_, count)(void *_defer_arg __attribute__((unused))); \
64 int _STRMERGE(__defer_var_, count) __attribute__((cleanup(_STRMERGE(__defer_f_, count)))) __attribute__((unused)); \
65 void _STRMERGE(__defer_f_, count)(void *_defer_arg __attribute__((unused)))
66#define defer _DEFER(a, __COUNTER__)
Robert Swieckia9db9dd2016-03-09 16:29:37 +010067#endif
68
robert.swiecki@gmail.com64dc2a02015-02-17 22:21:30 +000069/* Name of the template which will be replaced with the proper name of the file */
robert.swiecki@gmail.coma0d87142015-02-14 13:11:18 +000070#define _HF_FILE_PLACEHOLDER "___FILE___"
robert.swiecki@gmail.com64dc2a02015-02-17 22:21:30 +000071
72/* Default name of the report created with some architectures */
robert.swiecki@gmail.come7190b92015-02-14 23:05:42 +000073#define _HF_REPORT_FILE "HONGGFUZZ.REPORT.TXT"
robert.swiecki3bb518c2010-10-14 00:48:24 +000074
robert.swiecki@gmail.com64dc2a02015-02-17 22:21:30 +000075/* Default stack-size of created threads. Must be bigger then _HF_DYNAMIC_FILE_MAX_SZ */
robert.swiecki@gmail.com23b3a2f2015-03-01 03:40:12 +000076#define _HF_PTHREAD_STACKSIZE (1024 * 1024 * 8) /* 8MB */
robert.swiecki@gmail.com01b6dd42015-02-16 18:11:28 +000077
robert.swiecki@gmail.come7680522015-02-22 22:22:37 +000078/* Align to the upper-page boundary */
robert.swiecki87f7c7e2015-02-26 14:11:57 +000079#define _HF_PAGE_ALIGN_UP(x) (((size_t)x + (size_t)getpagesize() - (size_t)1) & ~((size_t)getpagesize() - (size_t)1))
robert.swiecki@gmail.come7680522015-02-22 22:22:37 +000080
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +030081/* String buffer size for function names in stack traces produced from libunwind */
Jaggerd628a702015-08-23 12:59:37 +020082#define _HF_FUNC_NAME_SZ 256 // Should be alright for mangled C++ procs too
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +030083
Anestis Bechtsoudis5c86ebc2015-09-27 18:06:43 +030084/* Number of crash verifier iterations before tag crash as stable */
85#define _HF_VERIFIER_ITER 5
86
Anestis Bechtsoudis60ea5e72015-11-24 19:10:06 +020087/* Constant prefix used for single frame crashes stackhash masking */
Anestis Bechtsoudisc06f8b32015-12-26 14:48:05 +020088#define _HF_SINGLE_FRAME_MASK 0xBADBAD0000000000
89
90/* Size (in bytes) for report data to be stored in stack before written to file */
91#define _HF_REPORT_SIZE 8192
Anestis Bechtsoudis0ef90002015-11-22 21:17:06 +020092
Anestis Bechtsoudis02b99be2015-12-27 11:53:01 +020093#define _HF_DYNFILE_SUB_MASK 0xFFFUL // Zero-set two MSB
94
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +020095/* Bitmap size */
Jagger5d9fb9c2016-03-17 00:08:37 +010096#define _HF_BITMAP_SIZE 0x3FFFFFF
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +020097
Robert Swiecki3bfc33c2016-03-14 18:12:41 +010098/* Perf bitmap size */
Jagger1d5467e2016-04-16 19:20:34 +020099#define _HF_PERF_BITMAP_SIZE (1024U * 1024U * 24U)
Robert Swiecki3bfc33c2016-03-14 18:12:41 +0100100
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200101/* Directory in workspace to store sanitizer coverage data */
102#define _HF_SANCOV_DIR "HF_SANCOV"
103
Anestis Bechtsoudis8e634c32016-01-13 13:07:26 +0200104#if defined(__ANDROID__)
105#define _HF_MONITOR_SIGABRT 0
106#else
107#define _HF_MONITOR_SIGABRT 1
108#endif
109
Anestis Bechtsoudis7c88d7a2016-02-09 17:55:38 +0200110/* Size of remote pid cmdline char buffer */
111#define _HF_PROC_CMDLINE_SZ 8192
112
Jaggerd34417d2016-03-16 01:26:54 +0100113#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
114
115/* Memory barriers */
116#define rmb() __asm__ __volatile__("":::"memory")
117#define wmb() __sync_synchronize()
118
119/* Atomics */
Jaggerba75eff2016-04-21 21:33:26 +0200120#define ATOMIC_GET(x) __atomic_load_n(&(x), __ATOMIC_SEQ_CST)
121#define ATOMIC_SET(x, y) __atomic_store_n(&(x), y, __ATOMIC_SEQ_CST)
Jagger8073b352016-04-21 21:47:36 +0200122#define ATOMIC_CLEAR(x) __atomic_clear(&(x), __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100123
Jaggerba75eff2016-04-21 21:33:26 +0200124#define ATOMIC_PRE_INC(x) __atomic_add_fetch(&(x), 1, __ATOMIC_SEQ_CST)
125#define ATOMIC_POST_INC(x) __atomic_fetch_add(&(x), 1, __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100126
Jaggerba75eff2016-04-21 21:33:26 +0200127#define ATOMIC_PRE_DEC(x) __atomic_sub_fetch(&(x), 1, __ATOMIC_SEQ_CST)
128#define ATOMIC_POST_DEC(x) __atomic_fetch_sub(&(x), 1, __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100129
Jaggerba75eff2016-04-21 21:33:26 +0200130#define ATOMIC_PRE_ADD(x, y) __atomic_add_fetch(&(x), y, __ATOMIC_SEQ_CST)
131#define ATOMIC_POST_ADD(x, y) __atomic_fetch_add(&(x), y, __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100132
Jaggerba75eff2016-04-21 21:33:26 +0200133#define ATOMIC_PRE_SUB(x, y) __atomic_sub_fetch(&(x), y, __ATOMIC_SEQ_CST)
134#define ATOMIC_POST_SUB(x, y) __atomic_fetch_sub(&(x), y, __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100135
Jaggerba75eff2016-04-21 21:33:26 +0200136#define ATOMIC_PRE_AND(x, y) __atomic_and_fetch(&(x), y, __ATOMIC_SEQ_CST)
137#define ATOMIC_POST_AND(x, y) __atomic_fetch_and(&(x), y, __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100138
Jaggerba75eff2016-04-21 21:33:26 +0200139#define ATOMIC_PRE_OR(x, y) __atomic_or_fetch(&(x), y, __ATOMIC_SEQ_CST)
140#define ATOMIC_POST_OR(x, y) __atomic_fetch_or(&(x), y, __ATOMIC_SEQ_CST)
Jaggerd34417d2016-03-16 01:26:54 +0100141
Jagger5f9c1292016-04-03 22:19:22 +0200142/* Missing WIFCONTINUED in Android */
143#ifndef WIFCONTINUED
144#define WIFCONTINUED(x) WEXITSTATUS(0)
145#endif // ndef(WIFCONTINUED)
146
robert.swiecki@gmail.comcac22fd2015-02-19 14:03:28 +0000147typedef enum {
robert.swiecki@gmail.com81e26dc2015-03-03 04:26:04 +0000148 _HF_DYNFILE_NONE = 0x0,
149 _HF_DYNFILE_INSTR_COUNT = 0x1,
150 _HF_DYNFILE_BRANCH_COUNT = 0x2,
Jagger3abc5602016-02-04 00:53:43 +0100151 _HF_DYNFILE_BTS_BLOCK = 0x8,
152 _HF_DYNFILE_BTS_EDGE = 0x10,
Jagger39bd2b02016-02-04 01:16:15 +0100153 _HF_DYNFILE_IPT_BLOCK = 0x20,
Jagger0d2727a2016-02-08 02:08:42 +0100154 _HF_DYNFILE_CUSTOM = 0x40,
robert.swiecki@gmail.comcac22fd2015-02-19 14:03:28 +0000155} dynFileMethod_t;
156
robert.swiecki3bb518c2010-10-14 00:48:24 +0000157typedef struct {
Jaggerb409ee12015-09-09 02:02:32 +0200158 uint64_t cpuInstrCnt;
159 uint64_t cpuBranchCnt;
Jaggerb409ee12015-09-09 02:02:32 +0200160 uint64_t customCnt;
Robert Swiecki3bfc33c2016-03-14 18:12:41 +0100161 uint64_t bbCnt;
Robert Swieckiac56a502016-03-17 18:59:46 +0100162 uint64_t newBBCnt;
Jaggerb409ee12015-09-09 02:02:32 +0200163} hwcnt_t;
164
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200165/* Sanitizer coverage specific data structures */
Jaggerb409ee12015-09-09 02:02:32 +0200166typedef struct {
Anestis Bechtsoudis56e360f2016-01-11 14:29:17 +0200167 uint64_t hitBBCnt;
168 uint64_t totalBBCnt;
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200169 uint64_t dsoCnt;
170 uint64_t iDsoCnt;
Anestis Bechtsoudis56e360f2016-01-11 14:29:17 +0200171 uint64_t newBBCnt;
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200172 uint64_t crashesCnt;
Anestis Bechtsoudisbe0ac7b2015-12-26 15:38:47 +0200173} sancovcnt_t;
174
175typedef struct {
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200176 uint32_t capacity;
177 uint32_t *pChunks;
178 uint32_t nChunks;
179} bitmap_t;
180
181/* Memory map struct */
182typedef struct __attribute__ ((packed)) {
183 uint64_t start; // region start addr
184 uint64_t end; // region end addr
185 uint64_t base; // region base addr
186 char mapName[NAME_MAX]; // bin/DSO name
Anestis Bechtsoudis56e360f2016-01-11 14:29:17 +0200187 uint64_t bbCnt;
188 uint64_t newBBCnt;
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200189} memMap_t;
190
191/* Trie node data struct */
192typedef struct __attribute__ ((packed)) {
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200193 bitmap_t *pBM;
194} trieData_t;
195
196/* Trie node struct */
197typedef struct __attribute__ ((packed)) node {
198 char key;
199 trieData_t data;
200 struct node *next;
201 struct node *prev;
202 struct node *children;
203 struct node *parent;
204} node_t;
Anestis Bechtsoudisb78cf602016-01-07 13:10:50 +0200205
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200206/* EOF Sanitizer coverage specific data structures */
207
208typedef struct {
Anestis Bechtsoudis61b5ab12016-01-08 16:07:02 +0200209 char *asanOpts;
210 char *msanOpts;
211 char *ubsanOpts;
212} sanOpts_t;
213
Robert Swiecki6c9f6822016-03-14 16:12:27 +0100214typedef enum {
215 _HF_STATE_UNSET = 0,
216 _HF_STATE_STATIC = 1,
217 _HF_STATE_DYNAMIC_PRE = 2,
218 _HF_STATE_DYNAMIC_MAIN = 3,
219} fuzzState_t;
220
Robert Swiecki3bfc33c2016-03-14 18:12:41 +0100221struct dynfile_t {
222 uint8_t *data;
223 size_t size;
Robert Swiecki7084e652016-03-14 19:47:00 +0100224 TAILQ_ENTRY(dynfile_t) pointers;
Robert Swiecki3bfc33c2016-03-14 18:12:41 +0100225};
226
Anestis Bechtsoudis61b5ab12016-01-08 16:07:02 +0200227typedef struct {
robert.swiecki3bb518c2010-10-14 00:48:24 +0000228 char **cmdline;
Robert Swiecki72d2bef2016-01-19 14:39:26 +0100229 char cmdline_txt[PATH_MAX];
robert.swiecki3bb518c2010-10-14 00:48:24 +0000230 char *inputFile;
231 bool nullifyStdio;
232 bool fuzzStdin;
233 bool saveUnique;
Jagger0764ad72015-09-06 01:11:08 +0200234 bool useScreen;
Anestis Bechtsoudis5c86ebc2015-09-27 18:06:43 +0300235 bool useVerifier;
Robert Swiecki6c9f6822016-03-14 16:12:27 +0100236 time_t timeStart;
robert.swiecki3bb518c2010-10-14 00:48:24 +0000237 char *fileExtn;
Anestis Bechtsoudisd9680532015-09-06 17:37:05 +0300238 char *workDir;
Robert Swieckia96d78d2016-03-14 16:50:50 +0100239 double origFlipRate;
robert.swiecki3bb518c2010-10-14 00:48:24 +0000240 char *externalCommand;
robert.swiecki@gmail.com4f1124f2015-04-21 17:12:22 +0000241 const char *dictionaryFile;
Anestis Bechtsoudis70f2fbd2016-01-14 13:15:19 +0200242 char **dictionary;
Anestis Bechtsoudisd59af692015-09-21 15:15:05 +0300243 const char *blacklistFile;
244 uint64_t *blacklist;
245 size_t blacklistCnt;
robert.swiecki3bb518c2010-10-14 00:48:24 +0000246 long tmOut;
Jaggerea39a8f2015-09-05 00:57:22 +0200247 size_t dictionaryCnt;
248 size_t mutationsMax;
Jaggerea39a8f2015-09-05 00:57:22 +0200249 size_t threadsMax;
250 size_t threadsFinished;
robert.swiecki@gmail.com4da86bf2015-02-22 14:24:58 +0000251 size_t maxFileSz;
robert.swiecki@gmail.come7190b92015-02-14 23:05:42 +0000252 char *reportFile;
Robert Swieckic578d642015-09-08 16:13:36 +0200253 uint64_t asLimit;
robert.swiecki3bb518c2010-10-14 00:48:24 +0000254 char **files;
Anestis Bechtsoudis46ea10e2015-11-07 18:16:25 +0200255 size_t fileCnt;
Robert Swiecki05354ca2016-03-15 19:10:23 +0100256 size_t lastFileIndex;
257 size_t doneFileIndex;
Jaggercdbf6852016-02-07 22:06:02 +0100258 int exeFd;
Jagger80041fe2016-03-10 21:32:35 +0100259 bool clearEnv;
robert.swiecki@gmail.com15eca6f2015-03-04 03:31:36 +0000260 char *envs[128];
Robert Swiecki0f937af2016-03-30 18:19:16 +0200261 bool persistent;
robert.swiecki@gmail.com41d8e052015-02-19 01:10:41 +0000262
Robert Swiecki6c9f6822016-03-14 16:12:27 +0100263 fuzzState_t state;
Robert Swiecki3bfc33c2016-03-14 18:12:41 +0100264 uint8_t *bbMap;
265 size_t bbMapSz;
266 size_t dynfileqCnt;
Robert Swieckie586c1f2016-03-14 18:46:03 +0100267 pthread_mutex_t dynfileq_mutex;
Robert Swiecki3bfc33c2016-03-14 18:12:41 +0100268 TAILQ_HEAD(dynfileq_t, dynfile_t) dynfileq;
Robert Swiecki6c9f6822016-03-14 16:12:27 +0100269
Jagger0764ad72015-09-06 01:11:08 +0200270 size_t mutationsCnt;
271 size_t crashesCnt;
Anestis Bechtsoudisd7e8ed22015-09-10 18:29:34 +0300272 size_t uniqueCrashesCnt;
Anestis Bechtsoudis79b799e2015-11-01 00:02:25 +0200273 size_t verifiedCrashesCnt;
Anestis Bechtsoudisd59af692015-09-21 15:15:05 +0300274 size_t blCrashesCnt;
Jagger4b5281e2015-09-06 02:35:37 +0200275 size_t timeoutedCnt;
Jagger0764ad72015-09-06 01:11:08 +0200276
robert.swiecki@gmail.comcac22fd2015-02-19 14:03:28 +0000277 dynFileMethod_t dynFileMethod;
Anestis Bechtsoudisbe0ac7b2015-12-26 15:38:47 +0200278 sancovcnt_t sanCovCnts;
Anestis Bechtsoudisa16f70f2016-01-03 13:03:21 +0200279 pthread_mutex_t sanCov_mutex;
Anestis Bechtsoudis61b5ab12016-01-08 16:07:02 +0200280 sanOpts_t sanOpts;
Robert Swiecki6c9f6822016-03-14 16:12:27 +0100281 size_t dynFileIterExpire;
282 bool useSanCov;
283 node_t *covMetadata;
Jagger247c3b42016-03-21 23:24:05 +0100284 bool msanReportUMRS;
Robert Swiecki6c9f6822016-03-14 16:12:27 +0100285
286 /* For the Linux code */
Jagger247c3b42016-03-21 23:24:05 +0100287 struct {
288 hwcnt_t hwCnts;
289 uint64_t dynamicCutOffAddr;
290 bool disableRandomization;
291 void *ignoreAddr;
292 size_t numMajorFrames;
293 pid_t pid;
294 const char *pidFile;
295 char *pidCmd;
296 } linux;
robert.swiecki3bb518c2010-10-14 00:48:24 +0000297} honggfuzz_t;
298
Jaggere6be75c2016-03-17 03:18:04 +0100299typedef struct {
robert.swiecki@gmail.com882900b2015-02-11 13:56:22 +0000300 pid_t pid;
Robert Swieckidecf14b2016-03-31 15:09:28 +0200301 pid_t persistentPid;
robert.swiecki@gmail.com3213a112015-03-12 01:42:02 +0000302 int64_t timeStartedMillis;
Robert Swieckidecf14b2016-03-31 15:09:28 +0200303 const char *origFileName;
robert.swiecki@gmail.com882900b2015-02-11 13:56:22 +0000304 char fileName[PATH_MAX];
Anestis Bechtsoudis5c86ebc2015-09-27 18:06:43 +0300305 char crashFileName[PATH_MAX];
robert.swiecki@gmail.com882900b2015-02-11 13:56:22 +0000306 uint64_t pc;
307 uint64_t backtrace;
308 uint64_t access;
309 int exception;
Anestis Bechtsoudisc06f8b32015-12-26 14:48:05 +0200310 char report[_HF_REPORT_SIZE];
Anestis Bechtsoudis6b9e83d2015-10-02 11:10:50 -0700311 bool mainWorker;
Robert Swieckia96d78d2016-03-14 16:50:50 +0100312 float flipRate;
Robert Swieckia96d78d2016-03-14 16:50:50 +0100313 uint8_t *dynamicFile;
314 size_t dynamicFileSz;
robert.swiecki@gmail.comd4dd4df2015-02-18 00:50:12 +0000315
Robert Swieckidecf14b2016-03-31 15:09:28 +0200316 sancovcnt_t sanCovCnts;
317
Jagger2381ef42016-03-20 23:32:05 +0100318 struct {
319 /* For Linux code */
Jagger2381ef42016-03-20 23:32:05 +0100320 uint8_t *perfMmapBuf;
321 uint8_t *perfMmapAux;
Robert Swieckidecf14b2016-03-31 15:09:28 +0200322 hwcnt_t hwCnts;
Robert Swiecki12800cd2016-03-31 15:38:10 +0200323 pid_t attachedPid;
324 int persistentSock;
Robert Swiecki9f9968a2016-04-01 14:39:51 +0200325#if defined(_HF_ARCH_LINUX)
Robert Swiecki64d74252016-03-31 17:28:56 +0200326 timer_t timerId;
Robert Swiecki9f9968a2016-04-01 14:39:51 +0200327#endif // defined(_HF_ARCH_LINUX)
Jagger2381ef42016-03-20 23:32:05 +0100328 } linux;
robert.swiecki@gmail.com882900b2015-02-11 13:56:22 +0000329} fuzzer_t;
robert.swiecki3bb518c2010-10-14 00:48:24 +0000330
robert.swiecki3bb518c2010-10-14 00:48:24 +0000331#endif