-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
PT_DYNAMIC can end up in r/o PT_LOAD segment #146
Comments
The difference between this executable and ones that don't break is that shiftFile is not called when processing this executable. shiftFile creates a writable PT_LOAD/segment for the moved sections to go into and PT_DYNAMIC pointing into that works fine but when shiftFile is not called, the PT_DYNAMIC header is just updated to point to near the beginning of the file without regard to which segment that gets mapped into (I guess you could contrive a situation where it was unmapped rather than mapped read only but ...). I don't know what the fix would be. I guess a new PT_LOAD always needs to be created and in the non-shiftFiles case, any PT_LOAD covering that part of the file adjusted to no longer cover it? |
Probably duplicate: #152. |
This is also preventing go binaries to be used in classic Snap packages, which rely on rpath changes to work properly. |
Can't reproduce on master:
|
I tried this with a fresh version of influxd and the same old version of patchelf, and didn't get the problem, so I suspect whatever changed was actually not a fix in patchelf. Possibly influxd (or |
See README.md for instructions on how to use this reproducer.
See README.md for instructions on how to use this reproducer.
See README.md for instructions on how to use this reproducer.
See README.md for instructions on how to use this reproducer.
See README.md for instructions on how to use this reproducer.
See README.md for instructions on how to use this reproducer.
See README.md for instructions on how to use this reproducer.
I see there is a reproducer from @limeytexan at https://github.com/limeytexan/NixOS-patchelf-issue-146. I've uploaded a .tar.gz of the source and the patchelf'd and unpatchelf'd build results for posterity. Log:
Both are at 6a888058bc833af8260b90223371d6b2e47ca4a6, and my host is at:
|
Hi, has there been any evolution on this issue? I have just encountered an eerily similar bug, where patchelf 0.18.0 (built from source) appears to corrupt |
Reproducer:
The reason for the crash is seen in
readelf -l
:The PT_DYNAMIC header points into a PT_LOAD section that does not have the W flag, which causes glibc to segv very early in program startup.
The text was updated successfully, but these errors were encountered: