about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2024-01-30 15:06:34 +0100
committervanhauser-thc <vh@thc.org>2024-01-30 15:06:34 +0100
commit9604fe922ede9282a06a89b8d18d4de267aebd54 (patch)
tree0c6f0a940ee546e711e43d539471b9c423ba405a /src
parentd5b6c0f773178eb8890d0e7004c3c6d4931687fa (diff)
downloadafl++-9604fe922ede9282a06a89b8d18d4de267aebd54.tar.gz
nyx test for CI
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-init.c6
-rw-r--r--src/afl-fuzz.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index 35932913..8ab44a3b 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -124,6 +124,9 @@ void bind_to_free_cpu(afl_state_t *afl) {
     }
 
     WARNF("Not binding to a CPU core (AFL_NO_AFFINITY set).");
+  #ifdef __linux__
+    if (afl->fsrv.nyx_mode) { afl->fsrv.nyx_bind_cpu_id = 0; }
+  #endif
     return;
 
   }
@@ -151,6 +154,9 @@ void bind_to_free_cpu(afl_state_t *afl) {
     } else {
 
       OKF("CPU binding request using -b %d successful.", afl->cpu_to_bind);
+  #ifdef __linux__
+      if (afl->fsrv.nyx_mode) { afl->fsrv.nyx_bind_cpu_id = afl->cpu_to_bind; }
+  #endif
 
     }
 
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 5aec072e..8cf6c735 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -1915,6 +1915,15 @@ int main(int argc, char **argv_orig, char **envp) {
   bind_to_free_cpu(afl);
   #endif                                                   /* HAVE_AFFINITY */
 
+  #ifdef __linux__
+  if (afl->fsrv.nyx_mode && afl->fsrv.nyx_bind_cpu_id == 0xFFFFFFFF) {
+
+    afl->fsrv.nyx_bind_cpu_id = 0;
+
+  }
+
+  #endif
+
   #ifdef __HAIKU__
   /* Prioritizes performance over power saving */
   set_scheduler_mode(SCHEDULER_MODE_LOW_LATENCY);