aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h5
-rw-r--r--include/common.h16
-rw-r--r--include/envs.h2
-rw-r--r--include/forkserver.h5
4 files changed, 17 insertions, 11 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 23c20cc4..73c3b09f 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -393,8 +393,8 @@ typedef struct afl_env_vars {
*afl_hang_tmout, *afl_forksrv_init_tmout, *afl_preload,
*afl_max_det_extras, *afl_statsd_host, *afl_statsd_port,
*afl_crash_exitcode, *afl_statsd_tags_flavor, *afl_testcache_size,
- *afl_testcache_entries, *afl_kill_signal, *afl_target_env,
- *afl_persistent_record, *afl_exit_on_time;
+ *afl_testcache_entries, *afl_child_kill_signal, *afl_fsrv_kill_signal,
+ *afl_target_env, *afl_persistent_record, *afl_exit_on_time;
} afl_env_vars_t;
@@ -1268,4 +1268,3 @@ void queue_testcase_store_mem(afl_state_t *afl, struct queue_entry *q, u8 *mem);
#endif
#endif
-
diff --git a/include/common.h b/include/common.h
index a983bb0e..c1ba0f20 100644
--- a/include/common.h
+++ b/include/common.h
@@ -32,6 +32,7 @@
#include <unistd.h>
#include <sys/time.h>
#include <stdbool.h>
+#include "forkserver.h"
#include "types.h"
/* STRINGIFY_VAL_SIZE_MAX will fit all stringify_ strings. */
@@ -67,10 +68,16 @@ u8 *find_binary(u8 *fname);
u8 *find_afl_binary(u8 *own_loc, u8 *fname);
-/* Parses the kill signal environment variable, FATALs on error.
- If the env is not set, sets the env to default_signal for the signal handlers
- and returns the default_signal. */
-int parse_afl_kill_signal_env(u8 *afl_kill_signal_env, int default_signal);
+/* Parses the (numeric) kill signal environment variable passed
+ via `numeric_signal_as_str`.
+ If NULL is passed, the `default_signal` value is returned.
+ FATALs if `numeric_signal_as_str` is not a valid integer .*/
+int parse_afl_kill_signal(u8 *numeric_signal_as_str, int default_signal);
+
+/* Configure the signals that are used to kill the forkserver
+ and the forked childs. If `afl_kill_signal_env` or `afl_fsrv_kill_signal_env`
+ is NULL, the appropiate values are read from the environment. */
+void configure_afl_kill_signals(afl_forkserver_t *fsrv, char* afl_kill_signal_env, char* afl_fsrv_kill_signal_env);
/* Read a bitmap from file fname to memory
This is for the -B option again. */
@@ -133,4 +140,3 @@ FILE *create_ffile(u8 *fn);
s32 create_file(u8 *fn);
#endif
-
diff --git a/include/envs.h b/include/envs.h
index 2204a100..33c09780 100644
--- a/include/envs.h
+++ b/include/envs.h
@@ -110,6 +110,7 @@ static char *afl_environment_variables[] = {
"AFL_INST_RATIO",
"AFL_KEEP_TIMEOUTS",
"AFL_KILL_SIGNAL",
+ "AFL_FORK_SERVER_KILL_SIGNAL",
"AFL_KEEP_TRACES",
"AFL_KEEP_ASSEMBLY",
"AFL_LD_HARD_FAIL",
@@ -239,4 +240,3 @@ static char *afl_environment_variables[] = {
extern char *afl_environment_variables[];
#endif
-
diff --git a/include/forkserver.h b/include/forkserver.h
index 59ce0ee7..bfd441d4 100644
--- a/include/forkserver.h
+++ b/include/forkserver.h
@@ -163,7 +163,9 @@ typedef struct afl_forkserver {
void (*add_extra_func)(void *afl_ptr, u8 *mem, u32 len);
- u8 kill_signal;
+ u8 child_kill_signal;
+ u8 fsrv_kill_signal;
+
u8 persistent_mode;
#ifdef __linux__
@@ -222,4 +224,3 @@ void afl_fsrv_kill(afl_forkserver_t *fsrv);
#endif /* ^RLIMIT_AS */
#endif
-