-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix MaybeReenterWithoutASLR() in docker
#1985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/benchmark.cc
Outdated
| // 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) != proposed_personality) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, i would think we should just check that ADDR_NO_RANDOMIZE flag is now set.
Mainly, i don't think it is guaranteed that setting one flag wouldn't set/unset something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
src/benchmark.cc
Outdated
| // 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-ADLR flag, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ADLR/ASLR/
In some docker configurations the `personality()` function may return inconsistent results. Double check if the persona has been updated before reentering, otherwise we risk infinite loop. Fixes google#1984.
LebedevRI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
|
nice catch |
In some docker configurations the
personality()function may return inconsistent results. Double check if the persona has been updated before reentering, otherwise we risk infinite loop.Fixes #1984.