aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-12-03 14:43:06 +0100
committerDominik Maier <domenukk@gmail.com>2020-12-03 14:43:06 +0100
commita2e2fae840e9946c7994ac6807bed8496d71af56 (patch)
treec4162219bb50b7d46ef15120c13841a4b10d873c /include
parent0f803c63dfb1dafdef3bfe1b43674157efcd7107 (diff)
downloadAFLplusplus-a2e2fae840e9946c7994ac6807bed8496d71af56.tar.gz
AFL_CRASH_EXITCODE env var added, u8->bool
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h7
-rw-r--r--include/common.h2
-rw-r--r--include/envs.h1
-rw-r--r--include/forkserver.h21
4 files changed, 19 insertions, 12 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 933af65d..62d76323 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -144,8 +144,8 @@ struct queue_entry {
u8 *fname; /* File name for the test case */
u32 len; /* Input length */
- u8 cal_failed, /* Calibration failed? */
- trim_done, /* Trimmed? */
+ u8 cal_failed; /* Calibration failed? */
+ bool trim_done, /* Trimmed? */
was_fuzzed, /* historical, but needed for MOpt */
passed_det, /* Deterministic stages passed? */
has_new_cov, /* Triggers new coverage? */
@@ -368,7 +368,8 @@ typedef struct afl_env_vars {
u8 *afl_tmpdir, *afl_custom_mutator_library, *afl_python_module, *afl_path,
*afl_hang_tmout, *afl_forksrv_init_tmout, *afl_skip_crashes, *afl_preload,
*afl_max_det_extras, *afl_statsd_host, *afl_statsd_port,
- *afl_statsd_tags_flavor, *afl_testcache_size, *afl_testcache_entries;
+ *afl_crash_exitcode, *afl_statsd_tags_flavor, *afl_testcache_size,
+ *afl_testcache_entries;
} afl_env_vars_t;
diff --git a/include/common.h b/include/common.h
index c364ade0..6e5039d8 100644
--- a/include/common.h
+++ b/include/common.h
@@ -38,7 +38,7 @@
#define STRINGIFY_VAL_SIZE_MAX (16)
-void detect_file_args(char **argv, u8 *prog_in, u8 *use_stdin);
+void detect_file_args(char **argv, u8 *prog_in, bool *use_stdin);
void check_environment_vars(char **env);
char **argv_cpy_dup(int argc, char **argv);
diff --git a/include/envs.h b/include/envs.h
index 3aa05cb5..43c87148 100644
--- a/include/envs.h
+++ b/include/envs.h
@@ -32,6 +32,7 @@ static char *afl_environment_variables[] = {
"AFL_CODE_START",
"AFL_COMPCOV_BINNAME",
"AFL_COMPCOV_LEVEL",
+ "AFL_CRASH_EXITCODE",
"AFL_CUSTOM_MUTATOR_LIBRARY",
"AFL_CUSTOM_MUTATOR_ONLY",
"AFL_CXX",
diff --git a/include/forkserver.h b/include/forkserver.h
index 300ecffc..5d5c728f 100644
--- a/include/forkserver.h
+++ b/include/forkserver.h
@@ -37,9 +37,7 @@ typedef struct afl_forkserver {
/* a program that includes afl-forkserver needs to define these */
- u8 uses_asan; /* Target uses ASAN? */
u8 *trace_bits; /* SHM with instrumentation bitmap */
- u8 use_stdin; /* use stdin for sending data */
s32 fsrv_pid, /* PID of the fork server */
child_pid, /* PID of the fuzzed program */
@@ -53,8 +51,6 @@ typedef struct afl_forkserver {
fsrv_ctl_fd, /* Fork server control pipe (write) */
fsrv_st_fd; /* Fork server status pipe (read) */
- u8 no_unlink; /* do not unlink cur_input */
-
u32 exec_tmout; /* Configurable exec timeout (ms) */
u32 init_tmout; /* Configurable init timeout (ms) */
u32 map_size; /* map size used by the target */
@@ -73,13 +69,22 @@ typedef struct afl_forkserver {
u8 last_kill_signal; /* Signal that killed the child */
- u8 use_shmem_fuzz; /* use shared mem for test cases */
+ bool use_shmem_fuzz; /* use shared mem for test cases */
+
+ bool support_shmem_fuzz; /* set by afl-fuzz */
+
+ bool use_fauxsrv; /* Fauxsrv for non-forking targets? */
+
+ bool qemu_mode; /* if running in qemu mode or not */
+
+ bool use_stdin; /* use stdin for sending data */
- u8 support_shmem_fuzz; /* set by afl-fuzz */
+ bool no_unlink; /* do not unlink cur_input */
- u8 use_fauxsrv; /* Fauxsrv for non-forking targets? */
+ bool uses_asan; /* Target uses ASAN? */
- u8 qemu_mode; /* if running in qemu mode or not */
+ bool uses_crash_exitcode; /* Custom crash exitcode specified? */
+ u8 crash_exitcode; /* The crash exitcode specified */
u32 *shmem_fuzz_len; /* length of the fuzzing test case */