Bug 2022931
Summary: | chrpath misreads, damages shared libraries with unexpected section ordering | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | "FeRD" (Frank Dana) <ferdnyc> |
Component: | chrpath | Assignee: | David King <amigadave> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 37 | CC: | amigadave, Axel.Thimm |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-12-05 21:02:34 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
"FeRD" (Frank Dana)
2021-11-13 04:47:53 UTC
I have submitted a PR which fixes this issue to our chrpath repo (because upstream appears to have vanished): https://src.fedoraproject.org/rpms/chrpath/pull-request/6 Hopefully that can be merged? Update: As I note in my PR, this is not specific to libraries modified with patchelf (though it was how I discovered the bug). I have since tracked the issue down to a bad assumption in chrpath: The code previously assumed that the first SHT_STRTAB type section it encountered was the dynamic string table, where the rpath string is stored. However, it appears this is not always the case. (patchelf CAN create .dynstr tables in unexpected locations in a library, but that's likely not the only way it can happen.) The PR contains the fix for that bug. It adds two new functions: read_section_names() is responsible for reading in the section names table from the ELF headers, and get_section_name() looks up section names in that table based on their offset. When the section headers are scanned, each is checked not only for being of type SHT_STRTAB, but also having the name .dynstr, before the matching section is returned as the table into which rpathoff indexes the rpath string. This corrects the issue I'd previously reported, and causes chrpath to return correct rpath/runpath data even in libraries where .dynstr is not the first SHT_STRTAB section encountered. PR URL, again: https://src.fedoraproject.org/rpms/chrpath/pull-request/6 This message is a reminder that Fedora Linux 34 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '34'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 34 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle. Changing version to 37. This message is a reminder that Fedora Linux 37 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '37'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 37 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 37 entered end-of-life (EOL) status on None. Fedora Linux 37 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed. The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |