Bug 512618 - chrpath creates broken entries in the .dynamic section of the modified ELF files
Summary: chrpath creates broken entries in the .dynamic section of the modified ELF files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: chrpath
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Axel Thimm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 513419
TreeView+ depends on / blocked
 
Reported: 2009-07-19 21:12 UTC by Christian Krause
Modified: 2009-07-31 17:38 UTC (History)
3 users (show)

Fixed In Version: 0.13-5.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-24 19:38:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
fix the problem by creating proper NULL entries (557 bytes, patch)
2009-07-19 21:12 UTC, Christian Krause
no flags Details | Diff

Description Christian Krause 2009-07-19 21:12:13 UTC
Created attachment 354288 [details]
fix the problem by creating proper NULL entries

Description of problem:

When chrpath deletes an RPATH in an ELF binary, it works in this way that it searches for the RPATH entry in the .dynamic section and moves all following entries of the table one position up
Unfortunately it does not fix the _value_ of the terminating NULL
entry which is then still the value of the previous entry (usually != NULL).

This issue causes further problems relating to prelinking (and un-prelinking).

Version-Release number of selected component (if applicable):
chrpath-0.13-4.fc11.i586

How reproducible:
100%

Steps to Reproduce:
1. get a binary with an RPATH set
2. examine the .dynamic section:
readelf -d exiv2
 0x00000001 (NEEDED)                     Shared library: [libexiv2.so.5]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000f (RPATH)                      Library rpath: [/usr/lib]
[...]
 0x6ffffff0 (VERSYM)                     0x804aed4
 0x00000000 (NULL)                       0x0
3. delete the rpath with "chrpath -d"
4. check the .dynamic section again
 
Actual results:
 0x00000001 (NEEDED)                     Shared library: [libexiv2.so.5]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000c (INIT)                       0x804b7a4
[...]
 0x6ffffff0 (VERSYM)                     0x804aed4
 0x00000000 (NULL)                       0x804aed4


Expected results:
The last terminating NULL entry should also have a value of 0.
 0x00000000 (NULL)                       0x0

Additional info:
I've attached a patch for chrpath which fixes the problem.

Comment 1 Axel Thimm 2009-07-20 17:58:25 UTC
Thanks!

Just FYI I tried to contact upstream for reviewing this patch, who seems to have changed his email address. I now sent some blind mails to emails scrapped off google. The last chrpath release is 7 years ago, so maybe there is no upstream anymore.

Let's wait for a couple of days and if there is no feedback from upstream we apply the patch up to F-10.

Comment 2 Axel Thimm 2009-07-23 15:23:51 UTC
Upstream signaled to try this patch (and is on CC:) :)

If this patch should yield and problem please reopen. Thanks for report & patch!

Comment 3 Christian Krause 2009-07-24 09:27:43 UTC
(In reply to comment #2)
> Upstream signaled to try this patch (and is on CC:) :)
> If this patch should yield and problem please reopen. Thanks for report &
> patch!  

Many thanks! I've tested the koji build and so far it works as expected - thanks! It would be great if you could push it out into updates-testing so that we see if anybody else has any problems with it.

Comment 4 Bradley 2009-07-24 10:13:30 UTC
*** Bug 513419 has been marked as a duplicate of this bug. ***

Comment 5 Jakub Jelinek 2009-07-24 10:38:26 UTC
Can this please be fixed today, so that packages that use chrpath and are rebuilt during the mass rebuild that starts today don't need to be rebuilt again?

Comment 6 Fedora Update System 2009-07-24 10:48:32 UTC
chrpath-0.13-5.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/chrpath-0.13-5.fc11

Comment 7 Fedora Update System 2009-07-24 10:48:37 UTC
chrpath-0.13-5.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/chrpath-0.13-5.fc10

Comment 8 Axel Thimm 2009-07-24 10:54:12 UTC
(In reply to comment #3)
> It would be great if you could push it out into updates-testing so that
> we see if anybody else has any problems with it.  

I pushed it right into stable, I tested the patch with local builds against Fedora 10/11 and RHEL 4/5 and there was no regression.

Also rawhide has this fix as well, so the mass rebuild should fix any such issues in F12.

Comment 9 Axel Thimm 2009-07-24 10:56:21 UTC
(In reply to comment #5)
> Can this please be fixed today, so that packages that use chrpath and are
> rebuilt during the mass rebuild that starts today don't need to be rebuilt
> again?  

We had a mid-air collision :)

Rawhide was fixed already yesterday, at least the koji build finished almost 24h ago.

I queued it in for F-10/F-11 stable as well, if there is a greater hurry for F-10/F-11 I'll file an infrastructure ticket. Should I?

Comment 10 Jakub Jelinek 2009-07-24 11:03:51 UTC
F11/F10 aren't that urgent, they can wait a couple of days certainly.

Comment 11 Fedora Update System 2009-07-24 19:38:34 UTC
chrpath-0.13-5.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2009-07-24 19:42:31 UTC
chrpath-0.13-5.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.