aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Finucane <eep@google.com>2024-06-10 18:56:43 -0700
committerDmitry Vyukov <dvyukov@google.com>2024-06-11 04:36:23 +0000
commite942bb7959961890e0fafce00076331917d7ac76 (patch)
tree3f7ad9c2ead8cca384c75ce5e68312f7ad2c526d
parent048c640a64fd064361382a8800de05c87ff630cb (diff)
executor: map input buffer as shared
To receive data, executor relies on changes propagating to its copy of the shared memory buffer. This is only guaranteed with MAP_SHARED, whereas behavior is "unspecified" for MAP_PRIVATE (but happened to work on most implementations).
-rw-r--r--executor/executor.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index 2c73c20dd..88a0963c8 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -460,7 +460,7 @@ int main(int argc, char** argv)
os_init(argc, argv, (char*)SYZ_DATA_OFFSET, SYZ_NUM_PAGES * SYZ_PAGE_SIZE);
current_thread = &threads[0];
- void* mmap_out = mmap(NULL, kMaxInput, PROT_READ, MAP_PRIVATE, kInFd, 0);
+ void* mmap_out = mmap(NULL, kMaxInput, PROT_READ, MAP_SHARED, kInFd, 0);
if (mmap_out == MAP_FAILED)
fail("mmap of input file failed");
input_data = static_cast<uint8*>(mmap_out);