summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2018-10535.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2018-10535.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2018-10535.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2018-10535.patch b/meta/recipes-devtools/binutils/binutils/CVE-2018-10535.patch
new file mode 100644
index 0000000000..fa8fbd2aee
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/CVE-2018-10535.patch
@@ -0,0 +1,61 @@
1From db0c309f4011ca94a4abc8458e27f3734dab92ac Mon Sep 17 00:00:00 2001
2From: Nick Clifton <nickc@redhat.com>
3Date: Tue, 24 Apr 2018 16:57:04 +0100
4Subject: [PATCH] Fix an illegal memory access when trying to copy an ELF
5 binary with corrupt section symbols.
6
7 PR 23113
8 * elf.c (ignore_section_sym): Check for the output_section pointer
9 being NULL before dereferencing it.
10
11Upstream-Status: Backport
12CVE: CVE-2018-10535
13Signed-off-by: Armin Kuster <akuster@mvista.com>
14
15---
16 bfd/ChangeLog | 4 ++++
17 bfd/elf.c | 9 ++++++++-
18 2 files changed, 12 insertions(+), 1 deletion(-)
19
20Index: git/bfd/elf.c
21===================================================================
22--- git.orig/bfd/elf.c
23+++ git/bfd/elf.c
24@@ -4021,15 +4021,22 @@ ignore_section_sym (bfd *abfd, asymbol *
25 {
26 elf_symbol_type *type_ptr;
27
28+ if (sym == NULL)
29+ return FALSE;
30+
31 if ((sym->flags & BSF_SECTION_SYM) == 0)
32 return FALSE;
33
34+ if (sym->section == NULL)
35+ return TRUE;
36+
37 type_ptr = elf_symbol_from (abfd, sym);
38 return ((type_ptr != NULL
39 && type_ptr->internal_elf_sym.st_shndx != 0
40 && bfd_is_abs_section (sym->section))
41 || !(sym->section->owner == abfd
42- || (sym->section->output_section->owner == abfd
43+ || (sym->section->output_section != NULL
44+ && sym->section->output_section->owner == abfd
45 && sym->section->output_offset == 0)
46 || bfd_is_abs_section (sym->section)));
47 }
48Index: git/bfd/ChangeLog
49===================================================================
50--- git.orig/bfd/ChangeLog
51+++ git/bfd/ChangeLog
52@@ -1,3 +1,9 @@
53+2018-04-24 Nick Clifton <nickc@redhat.com>
54+
55+ PR 23113
56+ * elf.c (ignore_section_sym): Check for the output_section pointer
57+ being NULL before dereferencing it.
58+
59 2018-04-17 Nick Clifton <nickc@redhat.com>
60
61 PR 23065