Bug 187618 - elf_update generates corrupt objects
Summary: elf_update generates corrupt objects
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: elfutils
Version: 5
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Roland McGrath
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-01 22:53 UTC by Nicholas Miell
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 0.121-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-06-15 23:54:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
simple test usage of elf_update which damages the object file. (1.17 KB, text/x-csrc)
2006-04-01 22:53 UTC, Nicholas Miell
no flags Details
eu-readelf -a output from a victim object file, before being run through the test program (6.52 KB, text/plain)
2006-04-01 22:54 UTC, Nicholas Miell
no flags Details
eu-readelf -a output from the victim object file, after being run through the test program (6.27 KB, text/plain)
2006-04-01 22:57 UTC, Nicholas Miell
no flags Details
eu-readelf -a output from the victim object file, before being run through the test program with elfutils 0.120 (6.75 KB, text/plain)
2006-04-07 22:33 UTC, Nicholas Miell
no flags Details
eu-readelf -a output from the victim object file, after being run through the test program with elfutils 0.120 (6.43 KB, text/plain)
2006-04-07 22:37 UTC, Nicholas Miell
no flags Details

Description Nicholas Miell 2006-04-01 22:53:51 UTC
The attached simple test case damages the target object file. AFAIK, it should
make no changes whatsoever. All the documentation I've found (for either the SCO
version or the Sun version) suggest that this is a perfectly valid use of
elf_flagdata() and elf_update().

This is elfutils-0.119-1.2.1.

Comment 1 Nicholas Miell 2006-04-01 22:53:51 UTC
Created attachment 127186 [details]
simple test usage of elf_update which damages the object file.

Comment 2 Nicholas Miell 2006-04-01 22:54:55 UTC
Created attachment 127187 [details]
eu-readelf -a output from a victim object file, before being run through the test program

Comment 3 Nicholas Miell 2006-04-01 22:57:27 UTC
Created attachment 127188 [details]
eu-readelf -a output from the victim object file, after being run through the test program

Comment 4 Roland McGrath 2006-04-07 06:16:03 UTC
This is fixed in version 0.120 now in rawhide.


Comment 5 Nicholas Miell 2006-04-07 22:33:33 UTC
Created attachment 127487 [details]
eu-readelf -a output from the victim object file, before being run through the test program with elfutils 0.120

I'm including this again because I lost the original test object.

Comment 6 Nicholas Miell 2006-04-07 22:37:51 UTC
Created attachment 127488 [details]
eu-readelf -a output from the victim object file, after being run through the test program with elfutils 0.120

Looking at a comparison of the before & after, it appears that the contents of
.shstrtab is getting lost.

(There's also differences in object layout, but I think that's purely a "libelf
does things differently than libbfd" issue.)

Comment 7 Ulrich Drepper 2006-05-28 07:44:15 UTC
The development version of the code has no such problem anymore.  The package
maintainer will make a new release sometime soon but it'll be at least a week, I
guess.

Comment 8 Roland McGrath 2006-06-15 09:00:10 UTC
We think this is fixed in 0.121, which will appear in rawhide as soon as it
percolates through, and can already be found at
ftp://sources.redhat.com/pub/systemtap/elfutils/ to try it out now.
Please verify that your bug no longer occurs.

Comment 9 Nicholas Miell 2006-06-15 23:05:03 UTC
It's fixed. Thanks.


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