2019-09-04 09:43:09 +02:00
|
|
|
/*
|
|
|
|
|
american fuzzy lop++ - shared memory related header
|
|
|
|
|
---------------------------------------------------
|
|
|
|
|
|
2019-10-19 18:23:01 +02:00
|
|
|
Originally written by Michal Zalewski
|
2019-09-04 10:03:51 +02:00
|
|
|
|
2019-09-04 09:43:09 +02:00
|
|
|
Forkserver design by Jann Horn <jannhorn@googlemail.com>
|
2019-09-04 10:03:51 +02:00
|
|
|
|
2020-01-20 19:21:44 +01:00
|
|
|
Now maintained by Marc Heuse <mh@mh-sec.de>,
|
2020-03-09 14:43:40 +01:00
|
|
|
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>,
|
|
|
|
|
Andrea Fioraldi <andreafioraldi@gmail.com>,
|
|
|
|
|
Dominik Maier <mail@dmnk.co>
|
2019-09-04 09:43:09 +02:00
|
|
|
|
|
|
|
|
Copyright 2016, 2017 Google Inc. All rights reserved.
|
2022-01-01 00:49:17 +01:00
|
|
|
Copyright 2019-2022 AFLplusplus Project. All rights reserved.
|
2019-09-04 09:43:09 +02:00
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at:
|
|
|
|
|
|
2021-11-06 10:28:22 +01:00
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
2019-09-04 09:43:09 +02:00
|
|
|
|
|
|
|
|
Shared code to handle the shared memory. This is used by the fuzzer
|
|
|
|
|
as well the other components like afl-tmin, afl-showmap, etc...
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2019-08-19 12:54:55 +02:00
|
|
|
#ifndef __AFL_SHAREDMEM_H
|
|
|
|
|
#define __AFL_SHAREDMEM_H
|
2019-06-30 10:06:20 +02:00
|
|
|
|
2020-04-17 14:30:36 +02:00
|
|
|
#include "types.h"
|
|
|
|
|
|
2020-03-09 11:24:10 +01:00
|
|
|
typedef struct sharedmem {
|
2019-08-19 12:54:55 +02:00
|
|
|
|
2020-03-09 12:21:54 +01:00
|
|
|
// extern unsigned char *trace_bits;
|
2020-03-09 11:24:10 +01:00
|
|
|
|
2020-03-09 12:21:54 +01:00
|
|
|
#ifdef USEMMAP
|
2020-03-09 11:24:10 +01:00
|
|
|
/* ================ Proteas ================ */
|
2020-03-09 12:21:54 +01:00
|
|
|
int g_shm_fd;
|
|
|
|
|
char g_shm_file_path[L_tmpnam];
|
2020-06-26 09:13:07 +02:00
|
|
|
int cmplog_g_shm_fd;
|
|
|
|
|
char cmplog_g_shm_file_path[L_tmpnam];
|
2020-03-09 12:21:54 +01:00
|
|
|
/* ========================================= */
|
|
|
|
|
#else
|
|
|
|
|
s32 shm_id; /* ID of the SHM region */
|
2020-03-09 11:24:10 +01:00
|
|
|
s32 cmplog_shm_id;
|
2020-03-09 12:21:54 +01:00
|
|
|
#endif
|
2020-03-09 11:24:10 +01:00
|
|
|
|
2020-03-09 12:21:54 +01:00
|
|
|
u8 *map; /* shared memory region */
|
2020-03-09 11:24:10 +01:00
|
|
|
|
2020-04-17 11:39:38 +02:00
|
|
|
size_t map_size; /* actual allocated size */
|
2020-03-09 11:24:10 +01:00
|
|
|
|
|
|
|
|
int cmplog_mode;
|
2021-02-01 12:01:23 +01:00
|
|
|
int shmemfuzz_mode;
|
2020-03-09 11:24:10 +01:00
|
|
|
struct cmp_map *cmp_map;
|
|
|
|
|
|
|
|
|
|
} sharedmem_t;
|
|
|
|
|
|
2020-06-02 14:54:24 +02:00
|
|
|
u8 * afl_shm_init(sharedmem_t *, size_t, unsigned char non_instrumented_mode);
|
2020-03-09 12:21:54 +01:00
|
|
|
void afl_shm_deinit(sharedmem_t *);
|
2020-01-17 16:39:05 +01:00
|
|
|
|
2019-06-30 10:06:20 +02:00
|
|
|
#endif
|
2019-09-02 18:49:43 +02:00
|
|
|
|