about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWorksButNotTested <62701594+WorksButNotTested@users.noreply.github.com>2021-10-13 18:41:45 +0100
committerGitHub <noreply@github.com>2021-10-13 19:41:45 +0200
commit319db6759ba9dfaac454d5669214ae3aa65831fe (patch)
tree1e9b0c2196adb636aa5091ae09181f31945c31fa
parente0c052cad70b5cf2c86e1bda1d279a2ac1440077 (diff)
downloadafl++-319db6759ba9dfaac454d5669214ae3aa65831fe.tar.gz
Fix missing MAP_FIXED_NOREPLACE (#1116)
Co-authored-by: Your Name <you@example.com>
-rw-r--r--frida_mode/src/instrument/instrument_x64.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/frida_mode/src/instrument/instrument_x64.c b/frida_mode/src/instrument/instrument_x64.c
index 60f443e0..ebdf1440 100644
--- a/frida_mode/src/instrument/instrument_x64.c
+++ b/frida_mode/src/instrument/instrument_x64.c
@@ -18,6 +18,14 @@
 
 #if defined(__x86_64__)
 
+#ifndef MAP_FIXED_NOREPLACE
+  #ifdef MAP_EXCL
+    #define MAP_FIXED_NOREPLACE MAP_EXCL | MAP_FIXED
+  #else
+    #define MAP_FIXED_NOREPLACE MAP_FIXED
+  #endif
+#endif
+
 gboolean instrument_is_coverage_optimize_supported(void) {
 
   return true;