summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiruvadi Rajaraman <trajaraman@mvista.com>2017-09-04 16:39:25 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-07 17:10:07 +0000
commit742b9c8a28889a01a6055c59c4c5726bf032d617 (patch)
treee8aa0925ea6cf5c96d1758fb6057266e58f8478d
parent10e74c42ad77a5178fc42da5960cd61ecdb97150 (diff)
downloadpoky-742b9c8a28889a01a6055c59c4c5726bf032d617.tar.gz
binutils: CVE-2017-7302
Source: git://sourceware.org/git/binutils-gdb.git MR: 74218 Type: Security Fix Disposition: Backport from binutils-2_28-branch ChangeID: 11677f4fb24c7a49efc23ea7d54de1bf85e74b12 Description: Fix seg-fault running strip on a corrupt binary. PR binutils/20921 * aoutx.h (squirt_out_relocs): Check for and report any relocs that could not be recognised. Affects: <= 2.28 Author: Nick Clifton <nickc@redhat.com> (From OE-Core rev: dbe4c78bee0ed36fc8789f1a13678be1b8c0bcf5) Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> Reviewed-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.27.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/CVE-2017-7302.patch81
2 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc
index 59e46b8bf4..936cdc3c98 100644
--- a/meta/recipes-devtools/binutils/binutils-2.27.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.27.inc
@@ -64,6 +64,7 @@ SRC_URI = "\
64 file://CVE-2017-7225.patch \ 64 file://CVE-2017-7225.patch \
65 file://CVE-2017-7227.patch \ 65 file://CVE-2017-7227.patch \
66 file://CVE-2017-7301.patch \ 66 file://CVE-2017-7301.patch \
67 file://CVE-2017-7302.patch \
67" 68"
68S = "${WORKDIR}/git" 69S = "${WORKDIR}/git"
69 70
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-7302.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-7302.patch
new file mode 100644
index 0000000000..a45de0e0ab
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-7302.patch
@@ -0,0 +1,81 @@
1commit e2996cc315d6ea242e1a954dc20246485ccc8512
2Author: Nick Clifton <nickc@redhat.com>
3Date: Mon Dec 5 14:32:30 2016 +0000
4
5 Fix seg-fault running strip on a corrupt binary.
6
7 PR binutils/20921
8 * aoutx.h (squirt_out_relocs): Check for and report any relocs
9 that could not be recognised.
10
11Upstream-Status: Backport
12
13CVE: CVE-2017-7302
14Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
15
16Index: git/bfd/ChangeLog
17===================================================================
18--- git.orig/bfd/ChangeLog 2017-09-04 15:57:38.564419146 +0530
19+++ git/bfd/ChangeLog 2017-09-04 16:02:31.994883900 +0530
20@@ -124,6 +124,10 @@
21 (aout_link_add_symbols): Fix off by one error checking for
22 overflow of string offset.
23
24+ PR binutils/20921
25+ * aoutx.h (squirt_out_relocs): Check for and report any relocs
26+ that could not be recognised.
27+
28 2016-12-01 Nick Clifton <nickc@redhat.com>
29
30 PR binutils/20891
31Index: git/bfd/aoutx.h
32===================================================================
33--- git.orig/bfd/aoutx.h 2017-09-04 15:57:38.564419146 +0530
34+++ git/bfd/aoutx.h 2017-09-04 16:01:08.830188291 +0530
35@@ -1952,6 +1952,7 @@
36
37 PUT_WORD (abfd, g->address, natptr->r_address);
38
39+ BFD_ASSERT (g->howto != NULL);
40 r_length = g->howto->size ; /* Size as a power of two. */
41 r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
42 /* XXX This relies on relocs coming from a.out files. */
43@@ -2390,16 +2391,34 @@
44 for (natptr = native;
45 count != 0;
46 --count, natptr += each_size, ++generic)
47- MY_swap_ext_reloc_out (abfd, *generic,
48- (struct reloc_ext_external *) natptr);
49+ {
50+ if ((*generic)->howto == NULL)
51+ {
52+ bfd_set_error (bfd_error_invalid_operation);
53+ _bfd_error_handler (_("%B: attempt to write out unknown reloc type"), abfd);
54+ return FALSE;
55+ }
56+ MY_swap_ext_reloc_out (abfd, *generic,
57+ (struct reloc_ext_external *) natptr);
58+ }
59 }
60 else
61 {
62 for (natptr = native;
63 count != 0;
64 --count, natptr += each_size, ++generic)
65- MY_swap_std_reloc_out (abfd, *generic,
66- (struct reloc_std_external *) natptr);
67+ {
68+ /* PR 20921: If the howto field has not been initialised then skip
69+ this reloc. */
70+ if ((*generic)->howto == NULL)
71+ {
72+ bfd_set_error (bfd_error_invalid_operation);
73+ _bfd_error_handler (_("%B: attempt to write out unknown reloc type"), abfd);
74+ return FALSE;
75+ }
76+ MY_swap_std_reloc_out (abfd, *generic,
77+ (struct reloc_std_external *) natptr);
78+ }
79 }
80
81 if (bfd_bwrite ((void *) native, natsize, abfd) != natsize)