[PATCH] D42325: [AFL] Allow opting out of defered forkserver mode.
Jonathan Metzman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 16:36:26 PST 2018
metzman created this revision.
Herald added subscribers: Sanitizers, llvm-commits.
Dont use defered forkserver mode when DONT_DEFER_FORKSRV is defined.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D42325
Files:
lib/fuzzer/afl/afl_driver.cpp
Index: lib/fuzzer/afl/afl_driver.cpp
===================================================================
--- lib/fuzzer/afl/afl_driver.cpp
+++ lib/fuzzer/afl/afl_driver.cpp
@@ -111,10 +111,12 @@
extern "C" int __afl_persistent_loop(unsigned int);
static volatile char suppress_warning2 = AFL_PERSISTENT[0];
-// Notify AFL about deferred forkserver.
-static volatile char AFL_DEFER_FORKSVR[] = "##SIG_AFL_DEFER_FORKSRV##";
+// Notify AFL about deferred forkserver unless told not to.
+#ifndef DONT_DEFER_FORKSRV
+static volatile char AFL_DEFER_FORKSRV[] = "##SIG_AFL_DEFER_FORKSRV##";
extern "C" void __afl_manual_init();
-static volatile char suppress_warning1 = AFL_DEFER_FORKSVR[0];
+static volatile char suppress_warning1 = AFL_DEFER_FORKSRV[0];
+#endif
// Input buffer.
static const size_t kMaxAflInputSize = 1 << 20;
@@ -304,7 +306,10 @@
maybe_duplicate_stderr();
maybe_initialize_extra_stats();
+ // We must manually init when using defered forkserver.
+#ifndef DONT_DEFER_FORKSRV
__afl_manual_init();
+#endif
int N = 1000;
if (argc == 2 && argv[1][0] == '-')
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42325.130719.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180120/d3329622/attachment.bin>
More information about the llvm-commits
mailing list