-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
Segfault while section headers follows program headers #457
Labels
Comments
brenoguim
added a commit
to brenoguim/patchelf
that referenced
this issue
Feb 18, 2023
brenoguim
added a commit
to brenoguim/patchelf
that referenced
this issue
Feb 19, 2023
…S#457 This patch checks if the section header table is placed right after the program header table such that it would overlap when we add a new entry in the program header table. If that is the case, move the section header table to the end of the file. Moreover, there is no need to add a new PT_LOAD segment everytime. Check if the last segment is already a PT_LOAD with the same characteristics and adjacent. Extend it in this case.
brenoguim
added a commit
to brenoguim/patchelf
that referenced
this issue
Feb 19, 2023
…S#457 This patch checks if the section header table is placed right after the program header table such that it would overlap when we add a new entry in the program header table. If that is the case, move the section header table to the end of the file. Moreover, there is no need to add a new PT_LOAD segment everytime. Check if the last segment is already a PT_LOAD with the same characteristics and adjacent. Extend it in this case.
brenoguim
added a commit
to brenoguim/patchelf
that referenced
this issue
Feb 19, 2023
…S#457 This patch checks if the section header table is placed right after the program header table such that it would overlap when we add a new entry in the program header table. If that is the case, move the section header table to the end of the file. Moreover, there is no need to add a new PT_LOAD segment everytime. Check if the last segment is already a PT_LOAD with the same characteristics and adjacent. Extend it in this case.
bors bot
added a commit
that referenced
this issue
Feb 24, 2023
460: Avoid overlapping program header table with section header table #457 r=Mic92 a=brenoguim Co-authored-by: Breno Rodrigues Guimaraes <[email protected]> Co-authored-by: Breno Rodrigues Guimarães <[email protected]> Co-authored-by: Jörg Thalheim <[email protected]>
Fixed with #460 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
patchelf may bring segfault on GoLang ELF, whose section headers follows program headers and no gap between SHdr and PHdr.
Steps To Reproduce
Expected behavior
patchelf --version
outputpatchelf 0.17.2
Additional context
for original file, Section Headers next to program headers:
Although first patch runs okay, but PHdrs(program headers) do overlap with SHdrs(Section Headers).
because new header added to PHdrs
details here:
here is full record
The text was updated successfully, but these errors were encountered: