summaryrefslogtreecommitdiff
path: root/subproc.c
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2018-01-14 21:09:50 +0100
committerRobert Swiecki <robert@swiecki.net>2018-01-14 21:09:50 +0100
commit44acf6ea81bbc00a9caa33b3a036e8f6da5ae94e (patch)
tree36fc4cc47610ee86a4e025688591a39c85699e79 /subproc.c
parent04f4b4b591140a2b294646ecff423d0e6d86abc5 (diff)
downloadhonggfuzz-44acf6ea81bbc00a9caa33b3a036e8f6da5ae94e.tar.gz
msyn() the dynamic file before running fuzzed process in non-persistent mode
Diffstat (limited to 'subproc.c')
-rw-r--r--subproc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/subproc.c b/subproc.c
index e9f492d2..8aa67b26 100644
--- a/subproc.c
+++ b/subproc.c
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/time.h>
@@ -326,6 +327,10 @@ bool subproc_Run(run_t* run) {
arch_prepareParent(run);
+ if (!run->global->persistent && msync(run->dynamicFile, run->dynamicFileSz, MS_SYNC) == -1) {
+ LOG_W("Couldn't msync(dynamicFile, sz=%zu)", run->dynamicFileSz);
+ }
+
if (run->global->persistent && !subproc_persistentSendFileIndicator(run)) {
LOG_W("Could not send file size to the persistent process");
kill(run->persistentPid, SIGKILL);