about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjhertz <hectohertz@gmail.com>2021-07-13 04:56:55 -0400
committerGitHub <noreply@github.com>2021-07-13 10:56:55 +0200
commitec4ad161fc73a457fed1afb7368482df14cdc9a2 (patch)
tree1fc563d5d45c6a690c344313546897aeb58d14d5
parentd16d8dbb8511ad227fdeb33eb5a10914d9ad7bd9 (diff)
downloadafl++-ec4ad161fc73a457fed1afb7368482df14cdc9a2.tar.gz
Support AFL_NO_FORKSRV env-var in afl-tmin, afl-showmap, and afl-cmin (#1017)
* Support AFL_NO_FORKSRV env-var

* format

* showmap support

* showmap support

* help messages now show envar support

* formatting

* formatting

Co-authored-by: Jesse Hertz <jesse_hertz@apple.com>
-rw-r--r--src/afl-showmap.c8
-rw-r--r--src/afl-tmin.c11
2 files changed, 16 insertions, 3 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 936d3bc4..480de143 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -853,7 +853,8 @@ static void usage(u8 *argv0) {
       "AFL_PRELOAD: LD_PRELOAD / DYLD_INSERT_LIBRARIES settings for target\n"
       "AFL_PRINT_FILENAMES: If set, the filename currently processed will be "
       "printed to stdout\n"
-      "AFL_QUIET: do not print extra informational output\n",
+      "AFL_QUIET: do not print extra informational output\n"
+      "AFL_NO_FORKSRV: run target via execve instead of using the forkserver\n",
       argv0, MEM_LIMIT, doc_path);
 
   exit(1);
@@ -1097,6 +1098,11 @@ int main(int argc, char **argv_orig, char **envp) {
 
   check_environment_vars(envp);
 
+  if (getenv("AFL_NO_FORKSRV")) {             /* if set, use the fauxserver */
+    fsrv->use_fauxsrv = true;
+
+  }
+
   if (getenv("AFL_DEBUG")) {
 
     DEBUGF("");
diff --git a/src/afl-tmin.c b/src/afl-tmin.c
index 6656712a..2d80abe4 100644
--- a/src/afl-tmin.c
+++ b/src/afl-tmin.c
@@ -877,12 +877,13 @@ static void usage(u8 *argv0) {
       "              the target was compiled for\n"
       "AFL_PRELOAD:  LD_PRELOAD / DYLD_INSERT_LIBRARIES settings for target\n"
       "AFL_TMIN_EXACT: require execution paths to match for crashing inputs\n"
+      "AFL_NO_FORKSRV: run target via execve instead of using the forkserver\n"
       "ASAN_OPTIONS: custom settings for ASAN\n"
       "              (must contain abort_on_error=1 and symbolize=0)\n"
       "MSAN_OPTIONS: custom settings for MSAN\n"
       "              (must contain exitcode="STRINGIFY(MSAN_ERROR)" and symbolize=0)\n"
-      "TMPDIR: directory to use for temporary input files\n"
-      , argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
+      "TMPDIR: directory to use for temporary input files\n",
+      argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
 
   exit(1);
 
@@ -1104,6 +1105,12 @@ int main(int argc, char **argv_orig, char **envp) {
   if (optind == argc || !in_file || !output_file) { usage(argv[0]); }
 
   check_environment_vars(envp);
+
+  if (getenv("AFL_NO_FORKSRV")) {             /* if set, use the fauxserver */
+    fsrv->use_fauxsrv = true;
+
+  }
+
   setenv("AFL_NO_AUTODICT", "1", 1);
 
   /* initialize cmplog_mode */