Bug 512618

Summary: chrpath creates broken entries in the .dynamic section of the modified ELF files
Product: [Fedora] Fedora Reporter: Christian Krause <chkr>
Component: chrpathAssignee: Axel Thimm <axel.thimm>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: bbaetz, jakub, pere
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.13-5.fc10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-24 19:38:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 513419    
Attachments:
Description Flags
fix the problem by creating proper NULL entries none

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.