summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch43
1 files changed, 0 insertions, 43 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
deleted file mode 100644
index 7dfa3d87c3..0000000000
--- a/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 1d9a2696903fc59d6a936f4ab4e4407ef329d066 Mon Sep 17 00:00:00 2001
2From: Nick Clifton <nickc@redhat.com>
3Date: Fri, 17 Feb 2017 15:59:45 +0000
4Subject: Fix illegal memory accesses in readelf when parsing
5 a corrupt binary.
6
7 PR binutils/21156
8 * readelf.c (find_section_in_set): Test for invalid section
9 indicies.
10
11CVE: CVE-2017-6969
12Upstream-Status: Backport [master]
13
14Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
15---
16 binutils/ChangeLog | 6 ++++++
17 binutils/readelf.c | 10 ++++++++--
18 2 files changed, 14 insertions(+), 2 deletions(-)
19
20diff --git a/binutils/readelf.c b/binutils/readelf.c
21index 7c158c6342..4960491c5c 100644
22--- a/binutils/readelf.c
23+++ b/binutils/readelf.c
24@@ -675,8 +675,14 @@ find_section_in_set (const char * name, unsigned int * set)
25 if (set != NULL)
26 {
27 while ((i = *set++) > 0)
28- if (streq (SECTION_NAME (section_headers + i), name))
29- return section_headers + i;
30+ {
31+ /* See PR 21156 for a reproducer. */
32+ if (i >= elf_header.e_shnum)
33+ continue; /* FIXME: Should we issue an error message ? */
34+
35+ if (streq (SECTION_NAME (section_headers + i), name))
36+ return section_headers + i;
37+ }
38 }
39
40 return find_section (name);
41--
422.11.0
43