aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_windows.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-02-19 19:35:04 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-02-19 21:48:20 +0100
commit75a7c5e2d1f09a4a58e7e1f1f4ef0b0f55a33413 (patch)
treed44c2457c44b53192005f0b89cd6633a2a2b0ff9 /executor/executor_windows.cc
parent90fd6503136121e9494761a460898e83bc0b6b3e (diff)
prog: rework address allocation
1. mmap all memory always, without explicit mmap calls in the program. This makes lots of things much easier and removes lots of code. Makes mmap not a special syscall and allows to fuzz without mmap enabled. 2. Change address assignment algorithm. Current algorithm allocates unmapped addresses too frequently and allows collisions between arguments of a single syscall. The new algorithm analyzes actual allocations in the program and places new arguments at unused locations.
Diffstat (limited to 'executor/executor_windows.cc')
-rw-r--r--executor/executor_windows.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/executor/executor_windows.cc b/executor/executor_windows.cc
index 778387b42..374151ef2 100644
--- a/executor/executor_windows.cc
+++ b/executor/executor_windows.cc
@@ -23,6 +23,10 @@ int main(int argc, char** argv)
return 0;
}
+ if (VirtualAlloc((void*)SYZ_DATA_OFFSET, SYZ_NUM_PAGES * SYZ_PAGE_SIZE,
+ MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE) != (void*)SYZ_DATA_OFFSET)
+ fail("mmap of data segment failed");
+
setup_control_pipes();
receive_execute(true);
execute_one();