aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-08-06 10:16:09 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-08-06 09:55:32 +0000
commit5ba0fed13435213276f29e3d9e39d926f04ac1a8 (patch)
tree7cae2574bd45fba6463cc16f731485a9d973c857
parent4d59bf324183ff9386d28bc6d33b86b3115ddf54 (diff)
executor: keep output area base address on reallocation
Output area may be remapped from several different processes (i.e. after forking), so we should not assume that the suggested base address will be the same.
-rw-r--r--executor/executor.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index 53c52efc3..9adcf7835 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -748,6 +748,13 @@ static uint32* output_base_address()
// See the comment in input_base_address();
return 0;
}
+ if (output_data != NULL) {
+ // If output_data was already mapped, use the old base address
+ // since we could be extending the area from a different pid:
+ // realloc_output_data() may be called from a fork, which would cause
+ // input_base_address() to return a different address.
+ return (uint32*)output_data;
+ }
// Leave some unmmapped area after the input data.
return input_base_address() + kMaxInput + SYZ_PAGE_SIZE;
}