summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch87
1 files changed, 15 insertions, 72 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch b/meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch
index b240a3f994..010e6b5d53 100644
--- a/meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch
+++ b/meta/recipes-devtools/binutils/binutils/CVE-2018-18309.patch
@@ -49,39 +49,9 @@ Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
49 bfd/reloc.c | 19 +++++++++++++------ 49 bfd/reloc.c | 19 +++++++++++++------
50 14 files changed, 50 insertions(+), 23 deletions(-) 50 14 files changed, 50 insertions(+), 23 deletions(-)
51 51
52diff --git a/bfd/ChangeLog b/bfd/ChangeLog
53index 68c1ff665b..e9696ee314 100644
54--- a/bfd/ChangeLog
55+++ b/bfd/ChangeLog
56@@ -1,3 +1,23 @@
57+2018-10-13 Alan Modra <amodra@gmail.com>
58+
59+ PR 23770
60+ PR 23425
61+ * reloc.c (_bfd_clear_contents): Replace "location" param with
62+ "buf" and "off". Bounds check "off". Return status.
63+ * cofflink.c (_bfd_coff_generic_relocate_section): Update
64+ _bfd_clear_contents call.
65+ * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Likewise.
66+ * elf32-arc.c (elf_arc_relocate_section): Likewise.
67+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
68+ * elf32-metag.c (metag_final_link_relocate): Likewise.
69+ * elf32-nds32.c (nds32_elf_get_relocated_section_contents): Likewise.
70+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
71+ * elf32-visium.c (visium_elf_relocate_section): Likewise.
72+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
73+ * elf64-x86-64.c *(elf_x86_64_relocate_section): Likewise.
74+ * libbfd-in.h (_bfd_clear_contents): Update prototype.
75+ * libbfd.h: Regenerate.
76+
77 2018-09-20 Alan Modra <amodra@gmail.com>
78
79 PR 23685
80diff --git a/bfd/cofflink.c b/bfd/cofflink.c
81index 2f73f72e31..b7ea69b7f9 100644
82--- a/bfd/cofflink.c 52--- a/bfd/cofflink.c
83+++ b/bfd/cofflink.c 53+++ b/bfd/cofflink.c
84@@ -3080,7 +3080,7 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, 54@@ -3080,7 +3080,7 @@ _bfd_coff_generic_relocate_section (bfd
85 if (sec != NULL && discarded_section (sec)) 55 if (sec != NULL && discarded_section (sec))
86 { 56 {
87 _bfd_clear_contents (howto, input_bfd, input_section, 57 _bfd_clear_contents (howto, input_bfd, input_section,
@@ -90,11 +60,9 @@ index 2f73f72e31..b7ea69b7f9 100644
90 continue; 60 continue;
91 } 61 }
92 62
93diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
94index cf256f70e0..3374f411f9 100644
95--- a/bfd/elf-bfd.h 63--- a/bfd/elf-bfd.h
96+++ b/bfd/elf-bfd.h 64+++ b/bfd/elf-bfd.h
97@@ -2811,7 +2811,7 @@ extern asection _bfd_elf_large_com_section; 65@@ -2811,7 +2811,7 @@ extern asection _bfd_elf_large_com_secti
98 { \ 66 { \
99 int i_; \ 67 int i_; \
100 _bfd_clear_contents (howto, input_bfd, input_section, \ 68 _bfd_clear_contents (howto, input_bfd, input_section, \
@@ -103,11 +71,9 @@ index cf256f70e0..3374f411f9 100644
103 \ 71 \
104 if (bfd_link_relocatable (info) \ 72 if (bfd_link_relocatable (info) \
105 && (input_section->flags & SEC_DEBUGGING)) \ 73 && (input_section->flags & SEC_DEBUGGING)) \
106diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
107index 7a1b3042ae..30f47a5b22 100644
108--- a/bfd/elf32-arc.c 74--- a/bfd/elf32-arc.c
109+++ b/bfd/elf32-arc.c 75+++ b/bfd/elf32-arc.c
110@@ -1549,7 +1549,7 @@ elf_arc_relocate_section (bfd * output_bfd, 76@@ -1552,7 +1552,7 @@ elf_arc_relocate_section (bfd * outp
111 if (sec != NULL && discarded_section (sec)) 77 if (sec != NULL && discarded_section (sec))
112 { 78 {
113 _bfd_clear_contents (howto, input_bfd, input_section, 79 _bfd_clear_contents (howto, input_bfd, input_section,
@@ -116,11 +82,9 @@ index 7a1b3042ae..30f47a5b22 100644
116 rel->r_info = 0; 82 rel->r_info = 0;
117 rel->r_addend = 0; 83 rel->r_addend = 0;
118 84
119diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
120index 49797dcbfa..177471777d 100644
121--- a/bfd/elf32-i386.c 85--- a/bfd/elf32-i386.c
122+++ b/bfd/elf32-i386.c 86+++ b/bfd/elf32-i386.c
123@@ -2197,7 +2197,7 @@ elf_i386_relocate_section (bfd *output_bfd, 87@@ -2197,7 +2197,7 @@ elf_i386_relocate_section (bfd *output_b
124 if (sec != NULL && discarded_section (sec)) 88 if (sec != NULL && discarded_section (sec))
125 { 89 {
126 _bfd_clear_contents (howto, input_bfd, input_section, 90 _bfd_clear_contents (howto, input_bfd, input_section,
@@ -129,11 +93,9 @@ index 49797dcbfa..177471777d 100644
129 wrel->r_offset = rel->r_offset; 93 wrel->r_offset = rel->r_offset;
130 wrel->r_info = 0; 94 wrel->r_info = 0;
131 wrel->r_addend = 0; 95 wrel->r_addend = 0;
132diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c
133index efe95bddff..7f96246e5d 100644
134--- a/bfd/elf32-metag.c 96--- a/bfd/elf32-metag.c
135+++ b/bfd/elf32-metag.c 97+++ b/bfd/elf32-metag.c
136@@ -1396,7 +1396,7 @@ metag_final_link_relocate (reloc_howto_type *howto, 98@@ -1396,7 +1396,7 @@ metag_final_link_relocate (reloc_howto_t
137 rel, relend, howto, contents) \ 99 rel, relend, howto, contents) \
138 { \ 100 { \
139 _bfd_clear_contents (howto, input_bfd, input_section, \ 101 _bfd_clear_contents (howto, input_bfd, input_section, \
@@ -142,11 +104,9 @@ index efe95bddff..7f96246e5d 100644
142 \ 104 \
143 if (bfd_link_relocatable (info) \ 105 if (bfd_link_relocatable (info) \
144 && (input_section->flags & SEC_DEBUGGING)) \ 106 && (input_section->flags & SEC_DEBUGGING)) \
145diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
146index 0d86e5b865..184cf320f7 100644
147--- a/bfd/elf32-nds32.c 107--- a/bfd/elf32-nds32.c
148+++ b/bfd/elf32-nds32.c 108+++ b/bfd/elf32-nds32.c
149@@ -12582,14 +12582,14 @@ nds32_elf_get_relocated_section_contents (bfd *abfd, 109@@ -12582,14 +12582,14 @@ nds32_elf_get_relocated_section_contents
150 symbol = *(*parent)->sym_ptr_ptr; 110 symbol = *(*parent)->sym_ptr_ptr;
151 if (symbol->section && discarded_section (symbol->section)) 111 if (symbol->section && discarded_section (symbol->section))
152 { 112 {
@@ -165,11 +125,9 @@ index 0d86e5b865..184cf320f7 100644
165 (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; 125 (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
166 (*parent)->addend = 0; 126 (*parent)->addend = 0;
167 (*parent)->howto = &none_howto; 127 (*parent)->howto = &none_howto;
168diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
169index 61f70de12e..c31e26efd7 100644
170--- a/bfd/elf32-ppc.c 128--- a/bfd/elf32-ppc.c
171+++ b/bfd/elf32-ppc.c 129+++ b/bfd/elf32-ppc.c
172@@ -8232,7 +8232,7 @@ ppc_elf_relocate_section (bfd *output_bfd, 130@@ -8232,7 +8232,7 @@ ppc_elf_relocate_section (bfd *output_bf
173 howto = ppc_elf_howto_table[r_type]; 131 howto = ppc_elf_howto_table[r_type];
174 132
175 _bfd_clear_contents (howto, input_bfd, input_section, 133 _bfd_clear_contents (howto, input_bfd, input_section,
@@ -178,11 +136,9 @@ index 61f70de12e..c31e26efd7 100644
178 wrel->r_offset = rel->r_offset; 136 wrel->r_offset = rel->r_offset;
179 wrel->r_info = 0; 137 wrel->r_info = 0;
180 wrel->r_addend = 0; 138 wrel->r_addend = 0;
181diff --git a/bfd/elf32-visium.c b/bfd/elf32-visium.c
182index e8f1c4c9e4..961366cd87 100644
183--- a/bfd/elf32-visium.c 139--- a/bfd/elf32-visium.c
184+++ b/bfd/elf32-visium.c 140+++ b/bfd/elf32-visium.c
185@@ -621,7 +621,7 @@ visium_elf_relocate_section (bfd *output_bfd, 141@@ -621,7 +621,7 @@ visium_elf_relocate_section (bfd *output
186 or sections discarded by a linker script, we just want the 142 or sections discarded by a linker script, we just want the
187 section contents zeroed. Avoid any special processing. */ 143 section contents zeroed. Avoid any special processing. */
188 _bfd_clear_contents (howto, input_bfd, input_section, 144 _bfd_clear_contents (howto, input_bfd, input_section,
@@ -191,11 +147,9 @@ index e8f1c4c9e4..961366cd87 100644
191 147
192 rel->r_info = 0; 148 rel->r_info = 0;
193 rel->r_addend = 0; 149 rel->r_addend = 0;
194diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
195index eadde17615..7c3534ac65 100644
196--- a/bfd/elf64-ppc.c 150--- a/bfd/elf64-ppc.c
197+++ b/bfd/elf64-ppc.c 151+++ b/bfd/elf64-ppc.c
198@@ -14073,7 +14073,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, 152@@ -14074,7 +14074,7 @@ ppc64_elf_relocate_section (bfd *output_
199 { 153 {
200 _bfd_clear_contents (ppc64_elf_howto_table[r_type], 154 _bfd_clear_contents (ppc64_elf_howto_table[r_type],
201 input_bfd, input_section, 155 input_bfd, input_section,
@@ -204,11 +158,9 @@ index eadde17615..7c3534ac65 100644
204 wrel->r_offset = rel->r_offset; 158 wrel->r_offset = rel->r_offset;
205 wrel->r_info = 0; 159 wrel->r_info = 0;
206 wrel->r_addend = 0; 160 wrel->r_addend = 0;
207diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
208index c3a6c31ed2..4dcab43478 100644
209--- a/bfd/elf64-x86-64.c 161--- a/bfd/elf64-x86-64.c
210+++ b/bfd/elf64-x86-64.c 162+++ b/bfd/elf64-x86-64.c
211@@ -2490,7 +2490,7 @@ elf_x86_64_relocate_section (bfd *output_bfd, 163@@ -2490,7 +2490,7 @@ elf_x86_64_relocate_section (bfd *output
212 if (sec != NULL && discarded_section (sec)) 164 if (sec != NULL && discarded_section (sec))
213 { 165 {
214 _bfd_clear_contents (howto, input_bfd, input_section, 166 _bfd_clear_contents (howto, input_bfd, input_section,
@@ -217,11 +169,9 @@ index c3a6c31ed2..4dcab43478 100644
217 wrel->r_offset = rel->r_offset; 169 wrel->r_offset = rel->r_offset;
218 wrel->r_info = 0; 170 wrel->r_info = 0;
219 wrel->r_addend = 0; 171 wrel->r_addend = 0;
220diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
221index e53b255dad..f6d9565f03 100644
222--- a/bfd/libbfd-in.h 172--- a/bfd/libbfd-in.h
223+++ b/bfd/libbfd-in.h 173+++ b/bfd/libbfd-in.h
224@@ -696,8 +696,8 @@ extern bfd_reloc_status_type _bfd_relocate_contents 174@@ -696,8 +696,8 @@ extern bfd_reloc_status_type _bfd_reloca
225 (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN; 175 (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN;
226 176
227 /* Clear a given location using a given howto. */ 177 /* Clear a given location using a given howto. */
@@ -232,11 +182,9 @@ index e53b255dad..f6d9565f03 100644
232 182
233 /* Link stabs in sections in the first pass. */ 183 /* Link stabs in sections in the first pass. */
234 184
235diff --git a/bfd/libbfd.h b/bfd/libbfd.h
236index a8851c8026..1189e63358 100644
237--- a/bfd/libbfd.h 185--- a/bfd/libbfd.h
238+++ b/bfd/libbfd.h 186+++ b/bfd/libbfd.h
239@@ -701,8 +701,8 @@ extern bfd_reloc_status_type _bfd_relocate_contents 187@@ -701,8 +701,8 @@ extern bfd_reloc_status_type _bfd_reloca
240 (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN; 188 (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *) ATTRIBUTE_HIDDEN;
241 189
242 /* Clear a given location using a given howto. */ 190 /* Clear a given location using a given howto. */
@@ -247,11 +195,9 @@ index a8851c8026..1189e63358 100644
247 195
248 /* Link stabs in sections in the first pass. */ 196 /* Link stabs in sections in the first pass. */
249 197
250diff --git a/bfd/reloc.c b/bfd/reloc.c
251index 8dbb8896d3..1686780669 100644
252--- a/bfd/reloc.c 198--- a/bfd/reloc.c
253+++ b/bfd/reloc.c 199+++ b/bfd/reloc.c
254@@ -1613,16 +1613,22 @@ _bfd_relocate_contents (reloc_howto_type *howto, 200@@ -1613,16 +1613,22 @@ _bfd_relocate_contents (reloc_howto_type
255 relocations against discarded symbols, to make ignorable debug or unwind 201 relocations against discarded symbols, to make ignorable debug or unwind
256 information more obvious. */ 202 information more obvious. */
257 203
@@ -276,7 +222,7 @@ index 8dbb8896d3..1686780669 100644
276 size = bfd_get_reloc_size (howto); 222 size = bfd_get_reloc_size (howto);
277 switch (size) 223 switch (size)
278 { 224 {
279@@ -1687,6 +1693,7 @@ _bfd_clear_contents (reloc_howto_type *howto, 225@@ -1681,6 +1687,7 @@ _bfd_clear_contents (reloc_howto_type *h
280 #endif 226 #endif
281 break; 227 break;
282 } 228 }
@@ -284,7 +230,7 @@ index 8dbb8896d3..1686780669 100644
284 } 230 }
285 231
286 /* 232 /*
287@@ -8275,14 +8282,14 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, 233@@ -8268,14 +8275,14 @@ bfd_generic_get_relocated_section_conten
288 234
289 if (symbol->section && discarded_section (symbol->section)) 235 if (symbol->section && discarded_section (symbol->section))
290 { 236 {
@@ -303,6 +249,3 @@ index 8dbb8896d3..1686780669 100644
303 (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; 249 (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
304 (*parent)->addend = 0; 250 (*parent)->addend = 0;
305 (*parent)->howto = &none_howto; 251 (*parent)->howto = &none_howto;
306--
3072.13.3
308