-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Fixes for static PIE executables #166
base: master
Are you sure you want to change the base?
Conversation
@rcombs could you rebase? |
Growing the section can require changing its position, which results in crashes if the code relies on a symbol within it (e.g. _DYNAMIC). Instead, we can usually find an entry that isn't actually required and replace it.
Done. |
It seems that PRs with tests are preferred :) #225 |
debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); | ||
startPage = startOffset; |
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.
This disables this mitigation?
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.
no, it unconditionally applies it...
debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); | ||
startPage = startOffset; | ||
} | ||
startPage = startOffset; |
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.
I understand why isExecutable
was removed as a conditional but not why startPage = startOffset
was moved out.
Most notably, this attempts to avoid growing the dynamic section when adding an rpath, since that results in repositioning the section, which means that existing IP-relative references to the
_DYNAMIC
symbol will become invalid.