aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-01-21 13:06:15 +0100
committerGitHub <noreply@github.com>2022-01-21 13:06:15 +0100
commit2bb86863e6d15dbd5bb0c381afa51f476302784e (patch)
tree020fb8d0b012d5ebfd7ded0b32c00b79851a0532 /src
parentb4c2fc94166b22a77c521884a07fdfee2098147a (diff)
parent26a3d1b53b0a3ae690735c550c2985f079f3c672 (diff)
downloadafl++-2bb86863e6d15dbd5bb0c381afa51f476302784e.tar.gz
Merge branch 'dev' into docs_quality_assurance_3
Diffstat (limited to 'src')
-rw-r--r--src/afl-cc.c8
-rw-r--r--src/afl-forkserver.c21
-rw-r--r--src/afl-fuzz.c9
3 files changed, 23 insertions, 15 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index 974b1d2a..9197c74b 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -767,15 +767,13 @@ static void edit_params(u32 argc, char **argv, char **envp) {
u8 *afllib = find_object("libAFLDriver.a", argv[0]);
if (!be_quiet)
- WARNF(
- "Found erroneous '-fsanitize=fuzzer', trying to replace with "
- "libAFLDriver.a");
+ OKF("Found '-fsanitize=fuzzer', replacing with libAFLDriver.a");
if (!afllib) {
WARNF(
- "Cannot find 'libAFLDriver.a' to replace a wrong "
- "'-fsanitize=fuzzer' in the flags - this will fail!");
+ "Cannot find 'libAFLDriver.a' to replace '-fsanitize=fuzzer' in "
+ "the flags - this will fail!");
} else {
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index eebbb7c8..ffcb30c3 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -405,24 +405,27 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
}
- if (fsrv->nyx_parent) {
-
+ if (fsrv->nyx_standalone){
fsrv->nyx_runner = fsrv->nyx_handlers->nyx_new(
- fsrv->target_path, x, fsrv->nyx_id, fsrv->nyx_bind_cpu_id,
- !fsrv->nyx_standalone);
-
- } else {
+ fsrv->target_path, x, fsrv->nyx_bind_cpu_id, MAX_FILE, true);
+ }
+ else{
+ if (fsrv->nyx_parent) {
+ fsrv->nyx_runner = fsrv->nyx_handlers->nyx_new_parent(
+ fsrv->target_path, x, fsrv->nyx_bind_cpu_id, MAX_FILE, true);
- fsrv->nyx_runner = fsrv->nyx_handlers->nyx_new(
- fsrv->target_path, x, fsrv->nyx_id, fsrv->nyx_bind_cpu_id, true);
+ } else {
+ fsrv->nyx_runner = fsrv->nyx_handlers->nyx_new_child(
+ fsrv->target_path, x, fsrv->nyx_bind_cpu_id, fsrv->nyx_id);
+ }
}
if (fsrv->nyx_runner == NULL) { FATAL("Something went wrong ..."); }
u32 tmp_map_size =
fsrv->nyx_handlers->nyx_get_bitmap_buffer_size(fsrv->nyx_runner);
- fsrv->real_map_size = fsrv->map_size;
+ fsrv->real_map_size = tmp_map_size;
fsrv->map_size = (((tmp_map_size + 63) >> 6) << 6);
if (!be_quiet) { ACTF("Target map size: %u", fsrv->real_map_size); }
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 1edf82f4..50874f47 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -404,6 +404,12 @@ nyx_plugin_handler_t *afl_load_libnyx_plugin(u8 *libnyx_binary) {
plugin->nyx_new = dlsym(handle, "nyx_new");
if (plugin->nyx_new == NULL) { goto fail; }
+ plugin->nyx_new_parent = dlsym(handle, "nyx_new_parent");
+ if (plugin->nyx_new_parent == NULL) { goto fail; }
+
+ plugin->nyx_new_child = dlsym(handle, "nyx_new_child");
+ if (plugin->nyx_new_child == NULL) { goto fail; }
+
plugin->nyx_shutdown = dlsym(handle, "nyx_shutdown");
if (plugin->nyx_shutdown == NULL) { goto fail; }
@@ -1340,7 +1346,8 @@ int main(int argc, char **argv_orig, char **envp) {
"0)");
}
-
+
+ afl->fsrv.nyx_parent = true;
afl->fsrv.nyx_id = 0;
}