summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2017-14939.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2017-14939.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2017-14939.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-14939.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-14939.patch
new file mode 100644
index 0000000000..d1e4c3e609
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-14939.patch
@@ -0,0 +1,56 @@
1From 515f23e63c0074ab531bc954f84ca40c6281a724 Mon Sep 17 00:00:00 2001
2From: Alan Modra <amodra@gmail.com>
3Date: Sun, 24 Sep 2017 14:36:16 +0930
4Subject: [PATCH] PR22169, heap-based buffer overflow in read_1_byte
5
6The .debug_line header length field doesn't include the length field
7itself, ie. it's the size of the rest of .debug_line.
8
9 PR 22169
10 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
11
12Upstream-Status: Backport
13Affects: <= 2.29.1
14CVE: CVE-2017-14939
15Signed-off-by: Armin Kuster <akuster@mvista.com>
16
17---
18 bfd/ChangeLog | 5 +++++
19 bfd/dwarf2.c | 7 ++++---
20 2 files changed, 9 insertions(+), 3 deletions(-)
21
22Index: git/bfd/dwarf2.c
23===================================================================
24--- git.orig/bfd/dwarf2.c
25+++ git/bfd/dwarf2.c
26@@ -2084,12 +2084,13 @@ decode_line_info (struct comp_unit *unit
27 offset_size = 8;
28 }
29
30- if (unit->line_offset + lh.total_length > stash->dwarf_line_size)
31+ if (lh.total_length > (size_t) (line_end - line_ptr))
32 {
33 _bfd_error_handler
34 /* xgettext: c-format */
35- (_("Dwarf Error: Line info data is bigger (%#Lx) than the space remaining in the section (%#Lx)"),
36- lh.total_length, stash->dwarf_line_size - unit->line_offset);
37+ (_("Dwarf Error: Line info data is bigger (%#Lx)"
38+ " than the space remaining in the section (%#lx)"),
39+ lh.total_length, (unsigned long) (line_end - line_ptr));
40 bfd_set_error (bfd_error_bad_value);
41 return NULL;
42 }
43Index: git/bfd/ChangeLog
44===================================================================
45--- git.orig/bfd/ChangeLog
46+++ git/bfd/ChangeLog
47@@ -1,4 +1,9 @@
48 2017-09-24 Alan Modra <amodra@gmail.com>
49+
50+ PR 22169
51+ * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
52+
53+2017-09-24 Alan Modra <amodra@gmail.com>
54
55 PR 22166
56 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on