diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2013-10-21 19:37:22 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-30 13:39:01 +0000 |
commit | 35c8b1ac7c3b1e4209b1e30d1dbd1a457286b97b (patch) | |
tree | fea6213e9db37b9f88b778f8531929bbd1e35d2b /meta/recipes-devtools/rpm/rpm_5.4.9.bb | |
parent | a1a379b3c9728a06b086b4c1f06f663f54d7d37d (diff) | |
download | openembedded-core-contrib-35c8b1ac7c3b1e4209b1e30d1dbd1a457286b97b.tar.gz |
debugedit: fix segment fault while file's bss offset have a large number
While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file
into memory. While the file's bss Offset has a large number, elf_update
caculated file size by __elf64_updatenull_wrlock and the size was
enlarged.
In this situation, elf_update invoked ftruncate to enlarge the file,
and memory size (elf->maximum_size) also was incorrectly updated.
There was segment fault in elf_end which invoked munmap with the
length is the enlarged file size, not the mmap's length.
Before the above operations, invoke elf_begin/elf_update/elf_end
with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it
could make sure the file is safe for the following elf operations.
[YOCTO #5356]
https://bugzilla.redhat.com/show_bug.cgi?id=1019707
https://bugzilla.redhat.com/show_bug.cgi?id=1020842
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm_5.4.9.bb')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_5.4.9.bb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb index 5498541a50..4b95a906c9 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb @@ -86,6 +86,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;ex file://rpm-platform2.patch \ file://rpm-remove-sykcparse-decl.patch \ file://debugedit-segv.patch \ + file://debugedit-valid-file-to-fix-segment-fault.patch \ file://rpm-platform-file-fix.patch \ file://rpm-lsb-compatibility.patch \ " |