summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/binutils_CVE-2014-8501.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/binutils_CVE-2014-8501.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils_CVE-2014-8501.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/binutils_CVE-2014-8501.patch b/meta/recipes-devtools/binutils/binutils/binutils_CVE-2014-8501.patch
new file mode 100644
index 0000000000..a48fe9b23b
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils_CVE-2014-8501.patch
@@ -0,0 +1,60 @@
1Upstream-Status: Backport
2
3CVE-2014-8501 fix.
4
5[YOCTO #7084]
6
7Signed-off-by: Armin Kuster <akuster808@gmail.com>
8
9From 7e1e19887abd24aeb15066b141cdff5541e0ec8e Mon Sep 17 00:00:00 2001
10From: Nick Clifton <nickc@redhat.com>
11Date: Mon, 27 Oct 2014 14:45:06 +0000
12Subject: [PATCH] Fix a seg-fault in strings and other binutuils when parsing a
13 corrupt PE executable with an invalid value in the NumberOfRvaAndSizes field
14 of the AOUT header.
15
16 PR binutils/17512
17 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries
18 with an invalid value for NumberOfRvaAndSizes.
19---
20 bfd/ChangeLog | 4 ++++
21 bfd/peXXigen.c | 12 ++++++++++++
22 2 files changed, 16 insertions(+)
23
24Index: binutils-2.24/bfd/peXXigen.c
25===================================================================
26--- binutils-2.24.orig/bfd/peXXigen.c
27+++ binutils-2.24/bfd/peXXigen.c
28@@ -460,6 +460,18 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
29 {
30 int idx;
31
32+ /* PR 17512: Corrupt PE binaries can cause seg-faults. */
33+ if (a->NumberOfRvaAndSizes > 16)
34+ {
35+ (*_bfd_error_handler)
36+ (_("%B: aout header specifies an invalid number of data-directory entries: %d"),
37+ abfd, a->NumberOfRvaAndSizes);
38+ /* Paranoia: If the number is corrupt, then assume that the
39+ actual entries themselves might be corrupt as well. */
40+ a->NumberOfRvaAndSizes = 0;
41+ }
42+
43+
44 for (idx = 0; idx < a->NumberOfRvaAndSizes; idx++)
45 {
46 /* If data directory is empty, rva also should be 0. */
47Index: binutils-2.24/bfd/ChangeLog
48===================================================================
49--- binutils-2.24.orig/bfd/ChangeLog
50+++ binutils-2.24/bfd/ChangeLog
51@@ -1,5 +1,9 @@
52 2014-10-27 Nick Clifton <nickc@redhat.com>
53
54+ PR binutils/17512
55+ * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries
56+ with an invalid value for NumberOfRvaAndSizes.
57+
58 PR binutils/17510
59 * elf.c (setup_group): Improve handling of corrupt group
60 sections.