Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

rcombs
Copy link

@rcombs rcombs commented Mar 30, 2019

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.

@rcombs rcombs changed the title Fixes for PIE executables Fixes for static PIE executables Mar 30, 2019
@domenkozar
Copy link
Member

@rcombs could you rebase?

rcombs and others added 2 commits June 16, 2020 13:51
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.
@rcombs
Copy link
Author

rcombs commented Jun 16, 2020

Done.

@Mic92
Copy link
Member

Mic92 commented Jul 31, 2020

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This disables this mitigation?

Copy link
Member

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;
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants