Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,13 @@ void MaybeReenterWithoutASLR(int /*argc*/, char** argv) {
// Have we failed to change the personality? That may happen.
if (prev_personality == -1) return;

// Make sure the parsona has been updated with the no-ASLR flag,
// otherwise we will try to reenter infinitely.
// This seems impossible, but can happen in some docker configurations.
const auto new_personality = personality(0xffffffff);
if ((internal::get_as_unsigned(new_personality) & ADDR_NO_RANDOMIZE) == 0)
return;

execv(argv[0], argv);
// The exec() functions return only if an error has occurred,
// in which case we want to just continue as-is.
Expand Down
Loading