binutils: CVE-2017-9756

Source: binutils-gdb.git
MR: 73919
Type: Security Fix
Disposition: Backport from binutils-2_29
ChangeID: bd4a354c2a1bd14e26232fc88a736950aa19403a
Description:

    Prevent address violation problem when disassembling corrupt aarch64 binary.

        PR binutils/21595
        * aarch64-dis.c (aarch64_ext_ldst_reglist): Check for an out of
        range value.

Affects: <= 2.28
Author: Nick Clifton <nickc@redhat.com>
(From OE-Core rev: f48d4c21673c16760c5a9ff51934127339234f85)

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>
This commit is contained in:
Thiruvadi Rajaraman
2017-09-21 19:36:14 +05:30
committed by Richard Purdie
parent 1e97a1e661
commit 9753c5aa54
2 changed files with 44 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ SRC_URI = "\
file://CVE-2017-9753_9754.patch \
file://CVE-2017-9755_1.patch \
file://CVE-2017-9755_2.patch \
file://CVE-2017-9756.patch \
"
S = "${WORKDIR}/git"

View File

@@ -0,0 +1,43 @@
commit cd3ea7c69acc5045eb28f9bf80d923116e15e4f5
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Jun 15 13:26:54 2017 +0100
Prevent address violation problem when disassembling corrupt aarch64 binary.
PR binutils/21595
* aarch64-dis.c (aarch64_ext_ldst_reglist): Check for an out of
range value.
Upstream-Status: Backport
CVE: CVE-2017-9756
Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
Index: git/opcodes/aarch64-dis.c
===================================================================
--- git.orig/opcodes/aarch64-dis.c 2017-09-21 15:48:27.154646380 +0530
+++ git/opcodes/aarch64-dis.c 2017-09-21 15:48:27.134646104 +0530
@@ -381,6 +381,9 @@
info->reglist.first_regno = extract_field (FLD_Rt, code, 0);
/* opcode */
value = extract_field (FLD_opcode, code, 0);
+ /* PR 21595: Check for a bogus value. */
+ if (value >= ARRAY_SIZE (data))
+ return 0;
if (expected_num != data[value].num_elements || data[value].is_reserved)
return 0;
info->reglist.num_regs = data[value].num_regs;
Index: git/opcodes/ChangeLog
===================================================================
--- git.orig/opcodes/ChangeLog 2017-09-21 15:45:32.264491166 +0530
+++ git/opcodes/ChangeLog 2017-09-21 15:49:53.751803571 +0530
@@ -1,3 +1,9 @@
+2017-06-15 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/21595
+ * aarch64-dis.c (aarch64_ext_ldst_reglist): Check for an out of
+ range value.
+
2017-06-15 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/21594