summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2019-12972.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2019-12972.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2019-12972.patch51
1 files changed, 0 insertions, 51 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2019-12972.patch b/meta/recipes-devtools/binutils/binutils/CVE-2019-12972.patch
deleted file mode 100644
index 07d1d65467..0000000000
--- a/meta/recipes-devtools/binutils/binutils/CVE-2019-12972.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From 30bcc01478433a1cb05b36dc5c4beef7d2c89b5b Mon Sep 17 00:00:00 2001
2From: Alan Modra <amodra@gmail.com>
3Date: Fri, 21 Jun 2019 11:51:38 +0930
4Subject: [PATCH] PR24689, string table corruption
5
6The testcase in the PR had a e_shstrndx section of type SHT_GROUP.
7hdr->contents were initialized by setup_group rather than being read
8from the file, thus last byte was not zero and string dereference ran
9off the end of the buffer.
10
11 PR 24689
12 * elfcode.h (elf_object_p): Check type of e_shstrndx section.
13
14Upstream-Status: Backport
15CVE: CVE-2019-12972
16Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
17---
18 bfd/ChangeLog | 5 +++++
19 bfd/elfcode.h | 3 ++-
20 2 files changed, 7 insertions(+), 1 deletion(-)
21
22diff --git a/bfd/ChangeLog b/bfd/ChangeLog
23index 91f09e6346..e66fb40a2c 100644
24--- a/bfd/ChangeLog
25+++ b/bfd/ChangeLog
26@@ -1,3 +1,8 @@
27+2019-06-21 Alan Modra <amodra@gmail.com>
28+
29+ PR 24689
30+ * elfcode.h (elf_object_p): Check type of e_shstrndx section.
31+
32 2019-02-20 Alan Modra <amodra@gmail.com>
33
34 PR 24236
35diff --git a/bfd/elfcode.h b/bfd/elfcode.h
36index ec5ea766de..a35a629087 100644
37--- a/bfd/elfcode.h
38+++ b/bfd/elfcode.h
39@@ -755,7 +755,8 @@ elf_object_p (bfd *abfd)
40 /* A further sanity check. */
41 if (i_ehdrp->e_shnum != 0)
42 {
43- if (i_ehdrp->e_shstrndx >= elf_numsections (abfd))
44+ if (i_ehdrp->e_shstrndx >= elf_numsections (abfd)
45+ || i_shdrp[i_ehdrp->e_shstrndx].sh_type != SHT_STRTAB)
46 {
47 /* PR 2257:
48 We used to just goto got_wrong_format_error here
49--
502.20.1
51