diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-08-06 10:16:09 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-08-06 09:55:32 +0000 |
| commit | 5ba0fed13435213276f29e3d9e39d926f04ac1a8 (patch) | |
| tree | 7cae2574bd45fba6463cc16f731485a9d973c857 /executor | |
| parent | 4d59bf324183ff9386d28bc6d33b86b3115ddf54 (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.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/executor.cc | 7 |
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; } |
