diff options
| author | Cameron Finucane <eep@google.com> | 2024-06-10 18:56:43 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-06-11 04:36:23 +0000 |
| commit | e942bb7959961890e0fafce00076331917d7ac76 (patch) | |
| tree | 3f7ad9c2ead8cca384c75ce5e68312f7ad2c526d /executor/executor.cc | |
| parent | 048c640a64fd064361382a8800de05c87ff630cb (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).
Diffstat (limited to 'executor/executor.cc')
| -rw-r--r-- | executor/executor.cc | 2 |
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); |
