summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch94
1 files changed, 0 insertions, 94 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch b/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch
deleted file mode 100644
index ce5b9f392d..0000000000
--- a/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch
+++ /dev/null
@@ -1,94 +0,0 @@
1From 09dd135df9ebc7a4b640537e23e26a03a288a789 Mon Sep 17 00:00:00 2001
2From: Alan Modra <amodra@gmail.com>
3Date: Wed, 9 Oct 2019 00:07:29 +1030
4Subject: [PATCH] PR25078, stack overflow in function find_abstract_instance
5
6Selectively backporting fix for bfd/dwarf2.c, but not the ChangeLog
7file. There are newer versions of binutils, but none of them contain the
8commit fixing CVE-2019-17450, so backport it to master and zeus.
9
10Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=063c511bd79]
11CVE: CVE-2019-17450
12Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
13
14 PR 25078
15 * dwarf2.c (find_abstract_instance): Delete orig_info_ptr, add
16 recur_count. Error on recur_count reaching 100 rather than
17 info_ptr matching orig_info_ptr. Adjust calls.
18
19---
20 bfd/dwarf2.c | 35 +++++++++++++++++------------------
21 1 file changed, 17 insertions(+), 18 deletions(-)
22
23--- a/bfd/dwarf2.c
24+++ b/bfd/dwarf2.c
25@@ -2812,13 +2812,13 @@ static bfd_boolean comp_unit_maybe_decod
26 struct dwarf2_debug *);
27
28 static bfd_boolean
29-find_abstract_instance (struct comp_unit * unit,
30- bfd_byte * orig_info_ptr,
31- struct attribute * attr_ptr,
32- const char ** pname,
33- bfd_boolean * is_linkage,
34- char ** filename_ptr,
35- int * linenumber_ptr)
36+find_abstract_instance (struct comp_unit *unit,
37+ struct attribute *attr_ptr,
38+ unsigned int recur_count,
39+ const char **pname,
40+ bfd_boolean *is_linkage,
41+ char **filename_ptr,
42+ int *linenumber_ptr)
43 {
44 bfd *abfd = unit->abfd;
45 bfd_byte *info_ptr;
46@@ -2829,6 +2829,14 @@ find_abstract_instance (struct comp_unit
47 struct attribute attr;
48 const char *name = NULL;
49
50+ if (recur_count == 100)
51+ {
52+ _bfd_error_handler
53+ (_("DWARF error: abstract instance recursion detected"));
54+ bfd_set_error (bfd_error_bad_value);
55+ return FALSE;
56+ }
57+
58 /* DW_FORM_ref_addr can reference an entry in a different CU. It
59 is an offset from the .debug_info section, not the current CU. */
60 if (attr_ptr->form == DW_FORM_ref_addr)
61@@ -2962,15 +2970,6 @@ find_abstract_instance (struct comp_unit
62 info_ptr, info_ptr_end);
63 if (info_ptr == NULL)
64 break;
65- /* It doesn't ever make sense for DW_AT_specification to
66- refer to the same DIE. Stop simple recursion. */
67- if (info_ptr == orig_info_ptr)
68- {
69- _bfd_error_handler
70- (_("DWARF error: abstract instance recursion detected"));
71- bfd_set_error (bfd_error_bad_value);
72- return FALSE;
73- }
74 switch (attr.name)
75 {
76 case DW_AT_name:
77@@ -2984,7 +2983,7 @@ find_abstract_instance (struct comp_unit
78 }
79 break;
80 case DW_AT_specification:
81- if (!find_abstract_instance (unit, info_ptr, &attr,
82+ if (!find_abstract_instance (unit, &attr, recur_count + 1,
83 &name, is_linkage,
84 filename_ptr, linenumber_ptr))
85 return FALSE;
86@@ -3200,7 +3199,7 @@ scan_unit_for_symbols (struct comp_unit
87
88 case DW_AT_abstract_origin:
89 case DW_AT_specification:
90- if (!find_abstract_instance (unit, info_ptr, &attr,
91+ if (!find_abstract_instance (unit, &attr, 0,
92 &func->name,
93 &func->is_linkage,
94 &func->file,