Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Armin Kuster <akuster808@gmail.com>
To: akuster@mvista.com, openembedded-core@lists.openembedded.org
Subject: [pyro][PATCH 11/26] binutils: Security fix for CVE-2017-9040 and CVE-2017-9042
Date: Sun, 26 Nov 2017 18:34:57 -0800	[thread overview]
Message-ID: <1511750112-2263-11-git-send-email-akuster808@gmail.com> (raw)
In-Reply-To: <1511750112-2263-1-git-send-email-akuster808@gmail.com>

Affects: <= 2.28
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 meta/recipes-devtools/binutils/binutils-2.28.inc   |  1 +
 .../binutils/binutils/CVE-2017-9040_9042.patch     | 57 ++++++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.28.inc b/meta/recipes-devtools/binutils/binutils-2.28.inc
index b8199a4..c376433 100644
--- a/meta/recipes-devtools/binutils/binutils-2.28.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.28.inc
@@ -53,6 +53,7 @@ SRC_URI = "\
      file://CVE-2017-8421.patch \
      file://CVE-2017-9038_9044.patch \
      file://CVE-2017-9039.patch \
+     file://CVE-2017-9040_9042.patch \
 "
 S  = "${WORKDIR}/git"
 
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch
new file mode 100644
index 0000000..79c6a7d
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-9040_9042.patch
@@ -0,0 +1,57 @@
+From 7296a62a2a237f6b1ad8db8c38b090e9f592c8cf Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Thu, 13 Apr 2017 16:06:30 +0100
+Subject: [PATCH] readelf: fix out of range subtraction, seg fault from a NULL
+ pointer and memory exhaustion, all from parsing corrupt binaries.
+
+	PR binutils/21379
+	* readelf.c (process_dynamic_section): Detect over large section
+	offsets in the DT_SYMTAB entry.
+
+	PR binutils/21345
+	* readelf.c (process_mips_specific): Catch an unfeasible memory
+	allocation before it happens and print a suitable error message.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9040
+CVE: CVE-2017-9042
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ binutils/ChangeLog | 12 ++++++++++++
+ binutils/readelf.c | 26 +++++++++++++++++++++-----
+ 2 files changed, 33 insertions(+), 5 deletions(-)
+
+Index: git/binutils/readelf.c
+===================================================================
+--- git.orig/binutils/readelf.c
++++ git/binutils/readelf.c
+@@ -9306,6 +9306,12 @@ process_dynamic_section (FILE * file)
+ 	     processing that.  This is overkill, I know, but it
+ 	     should work.  */
+ 	  section.sh_offset = offset_from_vma (file, entry->d_un.d_val, 0);
++	  if ((bfd_size_type) section.sh_offset > current_file_size)
++	    {
++	      /* See PR 21379 for a reproducer.  */
++	      error (_("Invalid DT_SYMTAB entry: %lx"), (long) section.sh_offset);
++	      return FALSE;
++	    }
+ 
+ 	  if (archive_file_offset != 0)
+ 	    section.sh_size = archive_file_size - section.sh_offset;
+@@ -15175,6 +15181,15 @@ process_mips_specific (FILE * file)
+ 	  return 0;
+ 	}
+ 
++      /* PR 21345 - print a slightly more helpful error message
++	 if we are sure that the cmalloc will fail.  */
++      if (conflictsno * sizeof (* iconf) > current_file_size)
++	{
++	  error (_("Overlarge number of conflicts detected: %lx\n"),
++		 (long) conflictsno);
++	  return FALSE;
++	}
++
+       iconf = (Elf32_Conflict *) cmalloc (conflictsno, sizeof (* iconf));
+       if (iconf == NULL)
+ 	{
-- 
2.7.4



  parent reply	other threads:[~2017-11-27  2:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  2:34 [pyro][PATCH 01/26] binutils: Security fix CVE-2017-7223 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 02/26] binutils: Security Fix CVE-2017-7614 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 03/26] binutils: Security fix CVE-2017-8393 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 04/26] binutls: Secuirty fix CVE-2017-8394 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 05/26] binutls: Security fix CVE-2017-8395 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 06/26] binutils: Secuirty fix CVE-2017-8396 and CVE-2017-8397 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 07/26] binutils: Security fix for CVE-2017-8398 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 08/26] binutils: Security fix CVE-2017-8421 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 09/26] binutils: Security fix for CVE-2017-9038 and CVE-2017-9044 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 10/26] binutils: Security fix for CVE-2017-9039 Armin Kuster
2017-11-27  2:34 ` Armin Kuster [this message]
2017-11-27  2:34 ` [pyro][PATCH 12/26] binutils: Security fix for CVE-2017-9742 Armin Kuster
2017-11-27  2:34 ` [pyro][PATCH 13/26] binutls: Security fix for CVE-2017-9744 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 14/26] binutils: Security fix for CVE-2017-9745 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 15/26] binutls: Security for fix CVE-2017-9746 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 16/26] binutls: Security fix for CVE-2017-9747 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 17/26] binutls: Security fix for CVE-2017-9748 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 18/26] binutils: Security fix for CVE-2017-9749 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 19/26] Binutils: Security fix for CVE-2017-9750 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 20/26] binutls: Security fix for CVE-2017-9751 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 21/26] binutls: Security fix for CVE-2017-9752 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 22/26] binutls: Security fix for CVE-2017-9753 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 23/26] binutls: Security fix for CVE-2017-9755 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 24/26] binutls: Secuirty fix for CVE-2017-9756 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 25/26] binutils: Security fix for CVE-2017-9954 Armin Kuster
2017-11-27  2:35 ` [pyro][PATCH 26/26] binutls: Security fix for CVE-2017-9955 Armin Kuster
2017-11-27  3:04 ` ✗ patchtest: failure for "[pyro] binutils: Security fix ..." and 25 more Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511750112-2263-11-git-send-email-akuster808@gmail.com \
    --to=akuster808@gmail.com \
    --cc=akuster@mvista.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox