summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-03-25 17:19:52 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-25 17:42:58 (GMT)
commit5a9d83de1f764dc7ceebe4f0c754d77aa506ffe3 (patch)
tree50c2d2ca4a35c67e095c60391f448aa3082bb842
parent5ec19c8bccdb20cd392969b8a14d72f6114757cf (diff)
downloadpoky-5a9d83de1f764dc7ceebe4f0c754d77aa506ffe3.tar.gz
rpm: Add workaround for debugedit-segv
[ YOCTO #4089 ] On PPC and MIPS, there appears to be a condition that causes debugedit to segfault. The segfault is related to a call into the md5hash algorithm, an address of '0', and a size > 0 is passed causing the access of the address to segv. This workaround may prove to be the final fix, but it's currently unclear what the actual cause of the 0 address is. (From OE-Core rev: a046029eb96cd9307253937ceeadafaaa6d06dce) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/rpm/rpm/debugedit-segv.patch35
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4.9.bb3
2 files changed, 37 insertions, 1 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
new file mode 100644
index 0000000..bd91693
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
@@ -0,0 +1,35 @@
1There are cases, especially on PPC and MIPS, where the data address
2returned is 0, but the size is not 0.
3
4It appears to happen when the sections headers are similar to:
5
6 [21] .data PROGBITS 000239c0 0139c0 000010 00 WA 0 0 8
7 [22] .got PROGBITS 000239d0 0139d0 000014 04 WAX 0 0 4
8 [23] .plt NOBITS 000239e4 0139e4 000234 00 WAX 0 0 4
9 [24] .bss NOBITS 00023c18 0139e4 0001c8 00 WA 0 0 8
10 [25] .comment PROGBITS 00000000 0139e4 000011 01 MS 0 0 1
11 [26] .debug_aranges PROGBITS 00000000 0139f8 000d68 00 0 0 8
12
13Sections 23 and 24 (.plt and .bss) which are NOBITS have a loaded data address
14of 0, but a size != 0.
15
16This could be a bug in libelf...
17
18Upstream-status: Pending
19
20Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
21
22Index: rpm-5.4.9/tools/debugedit.c
23===================================================================
24--- rpm-5.4.9.orig/tools/debugedit.c
25+++ rpm-5.4.9/tools/debugedit.c
26@@ -1434,7 +1434,8 @@ handle_build_id (DSO *dso, Elf_Data *bui
27 auto inline void process (const void *data, size_t size)
28 {
29 memchunk chunk = { .data = (void *) data, .size = size };
30- hashFunctionContextUpdateMC (&ctx, &chunk);
31+ if (data != NULL && size != 0)
32+ hashFunctionContextUpdateMC (&ctx, &chunk);
33 }
34 union
35 {
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
index ba24111..e9c8f23 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
@@ -84,7 +84,8 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;ex
84 file://python-rpm-rpmsense.patch \ 84 file://python-rpm-rpmsense.patch \
85 file://rpm-reloc-macros.patch \ 85 file://rpm-reloc-macros.patch \
86 file://rpm-platform2.patch \ 86 file://rpm-platform2.patch \
87 file://rpm-remove-sykcparse-decl.patch \ 87 file://rpm-remove-sykcparse-decl.patch \
88 file://debugedit-segv.patch \
88 " 89 "
89 90
90# Uncomment the following line to enable platform score debugging 91# Uncomment the following line to enable platform score debugging