Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/elfutils/, dev-libs/elfutils/files/
Date: Tue, 29 Jan 2019 21:56:34
Message-Id: 1548798978.d21856c6b7ba9348121de36979d22d94fb0bfc16.slyfox@gentoo
1 commit: d21856c6b7ba9348121de36979d22d94fb0bfc16
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 29 21:55:33 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 29 21:56:18 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d21856c6
7
8 dev-libs/elfutils: fix parsing of partial core, bug #676794
9
10 Reported-by: Demetris Nakos
11 Bug: https://bugs.gentoo.org/676794
12 Bug: https://sourceware.org/PR24103
13 Package-Manager: Portage-2.3.59, Repoman-2.3.12
14 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
15
16 ...utils-0.175.ebuild => elfutils-0.173-r1.ebuild} | 10 ++++---
17 ...utils-0.175.ebuild => elfutils-0.175-r1.ebuild} | 7 +++--
18 .../files/elfutils-0.173-partial-core.patch | 34 ++++++++++++++++++++++
19 3 files changed, 45 insertions(+), 6 deletions(-)
20
21 diff --git a/dev-libs/elfutils/elfutils-0.175.ebuild b/dev-libs/elfutils/elfutils-0.173-r1.ebuild
22 similarity index 92%
23 copy from dev-libs/elfutils/elfutils-0.175.ebuild
24 copy to dev-libs/elfutils/elfutils-0.173-r1.ebuild
25 index 39a57eb90c1..0b41180c4eb 100644
26 --- a/dev-libs/elfutils/elfutils-0.175.ebuild
27 +++ b/dev-libs/elfutils/elfutils-0.173-r1.ebuild
28 @@ -1,7 +1,7 @@
29 -# Copyright 1999-2018 Gentoo Authors
30 +# Copyright 1999-2019 Gentoo Authors
31 # Distributed under the terms of the GNU General Public License v2
32
33 -EAPI=7
34 +EAPI=6
35
36 inherit flag-o-matic multilib-minimal
37
38 @@ -23,7 +23,10 @@ DEPEND="${RDEPEND}
39 >=sys-devel/flex-2.5.4a
40 sys-devel/m4"
41
42 -PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
43 +PATCHES=(
44 + "${FILESDIR}"/${PN}-0.118-PaX-support.patch
45 + "${FILESDIR}"/${PN}-0.173-partial-core.patch
46 +)
47
48 src_prepare() {
49 default
50 @@ -31,7 +34,6 @@ src_prepare() {
51 if ! use static-libs; then
52 sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
53 fi
54 - # https://sourceware.org/PR23914
55 sed -i 's:-Werror::' */Makefile.in || die
56 }
57
58
59 diff --git a/dev-libs/elfutils/elfutils-0.175.ebuild b/dev-libs/elfutils/elfutils-0.175-r1.ebuild
60 similarity index 92%
61 rename from dev-libs/elfutils/elfutils-0.175.ebuild
62 rename to dev-libs/elfutils/elfutils-0.175-r1.ebuild
63 index 39a57eb90c1..ad1c1988b46 100644
64 --- a/dev-libs/elfutils/elfutils-0.175.ebuild
65 +++ b/dev-libs/elfutils/elfutils-0.175-r1.ebuild
66 @@ -1,4 +1,4 @@
67 -# Copyright 1999-2018 Gentoo Authors
68 +# Copyright 1999-2019 Gentoo Authors
69 # Distributed under the terms of the GNU General Public License v2
70
71 EAPI=7
72 @@ -23,7 +23,10 @@ DEPEND="${RDEPEND}
73 >=sys-devel/flex-2.5.4a
74 sys-devel/m4"
75
76 -PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch)
77 +PATCHES=(
78 + "${FILESDIR}"/${PN}-0.118-PaX-support.patch
79 + "${FILESDIR}"/${PN}-0.173-partial-core.patch
80 +)
81
82 src_prepare() {
83 default
84
85 diff --git a/dev-libs/elfutils/files/elfutils-0.173-partial-core.patch b/dev-libs/elfutils/files/elfutils-0.173-partial-core.patch
86 new file mode 100644
87 index 00000000000..41ef14d6683
88 --- /dev/null
89 +++ b/dev-libs/elfutils/files/elfutils-0.173-partial-core.patch
90 @@ -0,0 +1,34 @@
91 +https://sourceware.org/PR24103
92 +https://bugs.gentoo.org/676794
93 +
94 +From da5c5336a1eaf519de246f7d9f0f5585e1d4ac59 Mon Sep 17 00:00:00 2001
95 +From: Mark Wielaard <mark@×××××.org>
96 +Date: Sun, 20 Jan 2019 23:05:56 +0100
97 +Subject: [PATCH] libdwfl: Sanity check partial core file dyn data read.
98 +
99 +When reading the dyn data from the core file check if we got everything,
100 +or just part of the data.
101 +
102 +https://sourceware.org/bugzilla/show_bug.cgi?id=24103
103 +
104 +Signed-off-by: Mark Wielaard <mark@×××××.org>
105 +---
106 + libdwfl/dwfl_segment_report_module.c | 6 ++++++
107 +
108 +--- a/libdwfl/dwfl_segment_report_module.c
109 ++++ b/libdwfl/dwfl_segment_report_module.c
110 +@@ -783,6 +783,12 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
111 + if (dyn_filesz != 0 && dyn_filesz % dyn_entsize == 0
112 + && ! read_portion (&dyn_data, &dyn_data_size, dyn_vaddr, dyn_filesz))
113 + {
114 ++ /* dyn_data_size will be zero if we got everything from the initial
115 ++ buffer, otherwise it will be the size of the new buffer that
116 ++ could be read. */
117 ++ if (dyn_data_size != 0)
118 ++ dyn_filesz = dyn_data_size;
119 ++
120 + void *dyns = malloc (dyn_filesz);
121 + Elf32_Dyn (*d32)[dyn_filesz / sizeof (Elf32_Dyn)] = dyns;
122 + Elf64_Dyn (*d64)[dyn_filesz / sizeof (Elf64_Dyn)] = dyns;
123 +--
124 +2.20.1