From f98a25139e0cbe27b2ec99e8aea1e392d3a22255 Mon Sep 17 00:00:00 2001 From: Thiruvadi Rajaraman Date: Mon, 4 Sep 2017 18:35:19 +0530 Subject: binutils: CVE-2017-8397 Source: git://sourceware.org/git/binutils-gdb.git MR: 74114 Type: Security Fix Disposition: Backport from binutils-2_29 ChangeID: d55e7590c08c4db483bba2fa35df8fbb6283686e Description: Fix a seg-fault when processing a corrupt binary containing reloc(s) with negative addresses. PR binutils/21434 * reloc.c (bfd_perform_relocation): Check for a negative address in the reloc. Affects: <= 2.29 Author: Nick Clifton (From OE-Core rev: 6dd9179c4208c8d13f7e9c784d9993606416ab97) Signed-off-by: Thiruvadi Rajaraman Reviewed-by: Armin Kuster Signed-off-by: Armin Kuster Signed-off-by: Armin Kuster Signed-off-by: Richard Purdie --- meta/recipes-devtools/binutils/binutils-2.27.inc | 1 + .../binutils/binutils/CVE-2017-8397.patch | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2017-8397.patch (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc index ecb0cdf094..a5122c5d5c 100644 --- a/meta/recipes-devtools/binutils/binutils-2.27.inc +++ b/meta/recipes-devtools/binutils/binutils-2.27.inc @@ -69,6 +69,7 @@ SRC_URI = "\ file://CVE-2017-7304.patch \ file://CVE-2017-8393.patch \ file://CVE-2017-8395.patch \ + file://CVE-2017-8397.patch \ " S = "${WORKDIR}/git" diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-8397.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-8397.patch new file mode 100644 index 0000000000..f966c80c4e --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-8397.patch @@ -0,0 +1,50 @@ +commit 04b31182bf3f8a1a76e995bdfaaaab4c009b9cb2 +Author: Nick Clifton +Date: Wed Apr 26 16:30:22 2017 +0100 + + Fix a seg-fault when processing a corrupt binary containing reloc(s) with negative addresses. + + PR binutils/21434 + * reloc.c (bfd_perform_relocation): Check for a negative address + in the reloc. + +Upstream-Status: Backport + +CVE: CVE-2017-8397 +Signed-off-by: Thiruvadi Rajaraman + + + +Index: git/bfd/reloc.c +=================================================================== +--- git.orig/bfd/reloc.c 2017-09-04 18:06:00.651987605 +0530 ++++ git/bfd/reloc.c 2017-09-04 18:06:10.740066291 +0530 +@@ -623,7 +623,10 @@ + PR 17512: file: c146ab8b, 46dff27f, 38e53ebf. */ + octets = reloc_entry->address * bfd_octets_per_byte (abfd); + if (octets + bfd_get_reloc_size (howto) +- > bfd_get_section_limit_octets (abfd, input_section)) ++ > bfd_get_section_limit_octets (abfd, input_section) ++ /* Check for an overly large offset which ++ masquerades as a negative value too. */ ++ || (octets + bfd_get_reloc_size (howto) < bfd_get_reloc_size (howto))) + return bfd_reloc_outofrange; + + /* Work out which section the relocation is targeted at and the +Index: git/bfd/ChangeLog +=================================================================== +--- git.orig/bfd/ChangeLog 2017-09-04 18:06:10.684065855 +0530 ++++ git/bfd/ChangeLog 2017-09-04 18:08:33.845183050 +0530 +@@ -75,6 +75,12 @@ + + 2017-04-26 Nick Clifton + ++ PR binutils/21434 ++ * reloc.c (bfd_perform_relocation): Check for a negative address ++ in the reloc. ++ ++2017-04-26 Nick Clifton ++ + PR binutils/21431 + * compress.c (bfd_init_section_compress_status): Check the return + value from bfd_malloc. -- cgit v1.2.3-54-g00ecf