blob: 5de45f29700d24e2949a55dec89f101044a2cc0a [file] [log] [blame]
Anestis Bechtsoudisd76c3b82015-12-26 17:35:25 +02001/*
2 *
3 * honggfuzz - sanitizer coverage feedback parsing
4 * -----------------------------------------------
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License"); you may
7 * not use this file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 * implied. See the License for the specific language governing
16 * permissions and limitations under the License.
17 *
18 */
19
Jagger3db1d952016-03-10 02:02:46 +010020#ifndef _HF_SANCOV_H_
21#define _HF_SANCOV_H_
Anestis Bechtsoudisd76c3b82015-12-26 17:35:25 +020022
Jagger00265602016-03-10 02:36:27 +010023/*
24 * SIGABRT is not a monitored signal for Android OS, since it produces lots of useless
25 * crashes due to way Android process termination hacks work. As a result the sanitizer's
26 * 'abort_on_error' flag cannot be utilized since it invokes abort() internally. In order
27 * to not lose crashes a custom exitcode is registered and monitored. Since exitcode is a
28 * global flag, it's assumed that target is compiled with only one sanitizer enabled at a
29 * time.
30 */
31#define HF_MSAN_EXIT_CODE 103
32#define HF_ASAN_EXIT_CODE 104
33#define HF_UBSAN_EXIT_CODE 105
34
35/* Prefix for sanitizer report files */
36#define kLOGPREFIX ".hf.san"
37
Jagger20ca4c02016-09-06 01:51:07 +020038/* Bitmap size */
39#define _HF_SANCOV_BITMAP_SIZE 0x3FFFFFF
40
41/* Directory in workspace to store sanitizer coverage data */
42#define _HF_SANCOV_DIR "HF_SANCOV"
43
Jagger3db1d952016-03-10 02:02:46 +010044extern void sancov_Analyze(honggfuzz_t * hfuzz, fuzzer_t * fuzzer);
Robert Swieckieab0e862016-10-18 23:04:42 +020045
Jagger00265602016-03-10 02:36:27 +010046extern bool sancov_Init(honggfuzz_t * hfuzz);
Robert Swieckieab0e862016-10-18 23:04:42 +020047
Jagger2b97dc92016-03-10 04:28:18 +010048extern bool sancov_prepareExecve(honggfuzz_t * hfuzz);
Anestis Bechtsoudisd76c3b82015-12-26 17:35:25 +020049
Jagger3db1d952016-03-10 02:02:46 +010050#endif /* _HF_SANCOV_H_ */