diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch deleted file mode 100644 index 5409511a7c..0000000000 --- a/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | From ef81126314f67472a46db9581530fbf5ccb6b3f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nick Clifton <nickc@redhat.com> | ||
3 | Date: Mon, 20 Feb 2017 14:40:39 +0000 | ||
4 | Subject: Fix another memory access error in readelf when | ||
5 | parsing a corrupt binary. | ||
6 | |||
7 | PR binutils/21156 | ||
8 | * dwarf.c (cu_tu_indexes_read): Move into... | ||
9 | (load_cu_tu_indexes): ... here. Change the variable into | ||
10 | tri-state. Change the function into boolean, returning | ||
11 | false if the indicies could not be loaded. | ||
12 | (find_cu_tu_set): Return NULL if the indicies could not be | ||
13 | loaded. | ||
14 | |||
15 | CVE: CVE-2017-6969 | ||
16 | Upstream-Status: Backport [master] | ||
17 | |||
18 | Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com> | ||
19 | --- | ||
20 | binutils/ChangeLog | 10 ++++++++++ | ||
21 | binutils/dwarf.c | 34 ++++++++++++++++++++-------------- | ||
22 | 2 files changed, 30 insertions(+), 14 deletions(-) | ||
23 | |||
24 | diff --git a/binutils/dwarf.c b/binutils/dwarf.c | ||
25 | index 0184a7ab2e..6d879c9b61 100644 | ||
26 | --- a/binutils/dwarf.c | ||
27 | +++ b/binutils/dwarf.c | ||
28 | @@ -76,7 +76,6 @@ int dwarf_check = 0; | ||
29 | as a zero-terminated list of section indexes comprising one set of debug | ||
30 | sections from a .dwo file. */ | ||
31 | |||
32 | -static int cu_tu_indexes_read = 0; | ||
33 | static unsigned int *shndx_pool = NULL; | ||
34 | static unsigned int shndx_pool_size = 0; | ||
35 | static unsigned int shndx_pool_used = 0; | ||
36 | @@ -99,7 +98,7 @@ static int tu_count = 0; | ||
37 | static struct cu_tu_set *cu_sets = NULL; | ||
38 | static struct cu_tu_set *tu_sets = NULL; | ||
39 | |||
40 | -static void load_cu_tu_indexes (void *file); | ||
41 | +static bfd_boolean load_cu_tu_indexes (void *); | ||
42 | |||
43 | /* Values for do_debug_lines. */ | ||
44 | #define FLAG_DEBUG_LINES_RAW 1 | ||
45 | @@ -2715,7 +2714,7 @@ load_debug_info (void * file) | ||
46 | return num_debug_info_entries; | ||
47 | |||
48 | /* If this is a DWARF package file, load the CU and TU indexes. */ | ||
49 | - load_cu_tu_indexes (file); | ||
50 | + (void) load_cu_tu_indexes (file); | ||
51 | |||
52 | if (load_debug_section (info, file) | ||
53 | && process_debug_info (&debug_displays [info].section, file, abbrev, 1, 0)) | ||
54 | @@ -7378,21 +7377,27 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) | ||
55 | section sets that we can use to associate a .debug_info.dwo section | ||
56 | with its associated .debug_abbrev.dwo section in a .dwp file. */ | ||
57 | |||
58 | -static void | ||
59 | +static bfd_boolean | ||
60 | load_cu_tu_indexes (void *file) | ||
61 | { | ||
62 | + static int cu_tu_indexes_read = -1; /* Tri-state variable. */ | ||
63 | + | ||
64 | /* If we have already loaded (or tried to load) the CU and TU indexes | ||
65 | then do not bother to repeat the task. */ | ||
66 | - if (cu_tu_indexes_read) | ||
67 | - return; | ||
68 | - | ||
69 | - if (load_debug_section (dwp_cu_index, file)) | ||
70 | - process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0); | ||
71 | - | ||
72 | - if (load_debug_section (dwp_tu_index, file)) | ||
73 | - process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0); | ||
74 | + if (cu_tu_indexes_read == -1) | ||
75 | + { | ||
76 | + cu_tu_indexes_read = TRUE; | ||
77 | + | ||
78 | + if (load_debug_section (dwp_cu_index, file)) | ||
79 | + if (! process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0)) | ||
80 | + cu_tu_indexes_read = FALSE; | ||
81 | + | ||
82 | + if (load_debug_section (dwp_tu_index, file)) | ||
83 | + if (! process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0)) | ||
84 | + cu_tu_indexes_read = FALSE; | ||
85 | + } | ||
86 | |||
87 | - cu_tu_indexes_read = 1; | ||
88 | + return (bfd_boolean) cu_tu_indexes_read; | ||
89 | } | ||
90 | |||
91 | /* Find the set of sections that includes section SHNDX. */ | ||
92 | @@ -7402,7 +7407,8 @@ find_cu_tu_set (void *file, unsigned int shndx) | ||
93 | { | ||
94 | unsigned int i; | ||
95 | |||
96 | - load_cu_tu_indexes (file); | ||
97 | + if (! load_cu_tu_indexes (file)) | ||
98 | + return NULL; | ||
99 | |||
100 | /* Find SHNDX in the shndx pool. */ | ||
101 | for (i = 0; i < shndx_pool_used; i++) | ||
102 | -- | ||
103 | 2.11.0 | ||
104 | |||