diff options
| author | Thiruvadi Rajaraman <trajaraman@mvista.com> | 2017-09-21 19:09:43 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-07 17:10:08 +0000 |
| commit | 776302af499938bf5d058d0d0957209f09c60900 (patch) | |
| tree | 4813c570f578ce280f3e86614d922f999325e28d | |
| parent | b5093a5c875f50e716ed35f2a65f1ae21c603e4f (diff) | |
| download | poky-776302af499938bf5d058d0d0957209f09c60900.tar.gz | |
binutils: CVE-2017-9746
Source: binutils-gdb.git
MR: 74049
Type: Security Fix
Disposition: Backport from binutils-2_29
ChangeID: 8dad195531894850a242ccf70990a963cf16f291
Description:
Fix address violation when disassembling a corrupt binary.
PR binutils/21580
binutils * objdump.c (disassemble_bytes): Check for buffer overrun when
printing out rae insns.
ld * testsuite/ld-nds32/diff.d: Adjust expected output.
Affects: <= 2.28
Author: Nick Clifton <nickc@redhat.com>
(From OE-Core rev: 2a13567ea790d71a36eab0293f5a1918ef447e13)
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.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch | 88 |
2 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc index 5e1e0be393..8d2c9d7031 100644 --- a/meta/recipes-devtools/binutils/binutils-2.27.inc +++ b/meta/recipes-devtools/binutils/binutils-2.27.inc | |||
| @@ -80,6 +80,7 @@ SRC_URI = "\ | |||
| 80 | file://CVE-2017-7299_2.patch \ | 80 | file://CVE-2017-7299_2.patch \ |
| 81 | file://CVE-2017-9751.patch \ | 81 | file://CVE-2017-9751.patch \ |
| 82 | file://CVE-2017-9749.patch \ | 82 | file://CVE-2017-9749.patch \ |
| 83 | file://CVE-2017-9746.patch \ | ||
| 83 | " | 84 | " |
| 84 | S = "${WORKDIR}/git" | 85 | S = "${WORKDIR}/git" |
| 85 | 86 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch new file mode 100644 index 0000000000..e9efb7b89a --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-9746.patch | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | commit ae87f7e73eba29bd38b3a9684a10b948ed715612 | ||
| 2 | Author: Nick Clifton <nickc@redhat.com> | ||
| 3 | Date: Wed Jun 14 16:50:03 2017 +0100 | ||
| 4 | |||
| 5 | Fix address violation when disassembling a corrupt binary. | ||
| 6 | |||
| 7 | PR binutils/21580 | ||
| 8 | binutils * objdump.c (disassemble_bytes): Check for buffer overrun when | ||
| 9 | printing out rae insns. | ||
| 10 | |||
| 11 | ld * testsuite/ld-nds32/diff.d: Adjust expected output. | ||
| 12 | |||
| 13 | Upstream-Status: Backport | ||
| 14 | |||
| 15 | CVE: CVE-2017-9746 | ||
| 16 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
| 17 | |||
| 18 | |||
| 19 | Index: git/binutils/objdump.c | ||
| 20 | =================================================================== | ||
| 21 | --- git.orig/binutils/objdump.c 2017-09-21 13:54:00.187228032 +0530 | ||
| 22 | +++ git/binutils/objdump.c 2017-09-21 13:54:00.659231783 +0530 | ||
| 23 | @@ -1780,20 +1780,23 @@ | ||
| 24 | |||
| 25 | for (j = addr_offset * opb; j < addr_offset * opb + pb; j += bpc) | ||
| 26 | { | ||
| 27 | - int k; | ||
| 28 | - | ||
| 29 | - if (bpc > 1 && inf->display_endian == BFD_ENDIAN_LITTLE) | ||
| 30 | - { | ||
| 31 | - for (k = bpc - 1; k >= 0; k--) | ||
| 32 | - printf ("%02x", (unsigned) data[j + k]); | ||
| 33 | - putchar (' '); | ||
| 34 | - } | ||
| 35 | - else | ||
| 36 | + /* PR 21580: Check for a buffer ending early. */ | ||
| 37 | + if (j + bpc <= stop_offset * opb) | ||
| 38 | { | ||
| 39 | - for (k = 0; k < bpc; k++) | ||
| 40 | - printf ("%02x", (unsigned) data[j + k]); | ||
| 41 | - putchar (' '); | ||
| 42 | + int k; | ||
| 43 | + | ||
| 44 | + if (inf->display_endian == BFD_ENDIAN_LITTLE) | ||
| 45 | + { | ||
| 46 | + for (k = bpc - 1; k >= 0; k--) | ||
| 47 | + printf ("%02x", (unsigned) data[j + k]); | ||
| 48 | + } | ||
| 49 | + else | ||
| 50 | + { | ||
| 51 | + for (k = 0; k < bpc; k++) | ||
| 52 | + printf ("%02x", (unsigned) data[j + k]); | ||
| 53 | + } | ||
| 54 | } | ||
| 55 | + putchar (' '); | ||
| 56 | } | ||
| 57 | |||
| 58 | for (; pb < octets_per_line; pb += bpc) | ||
| 59 | Index: git/ld/testsuite/ld-nds32/diff.d | ||
| 60 | =================================================================== | ||
| 61 | --- git.orig/ld/testsuite/ld-nds32/diff.d 2017-09-21 13:53:52.395166097 +0530 | ||
| 62 | +++ git/ld/testsuite/ld-nds32/diff.d 2017-09-21 13:54:00.659231783 +0530 | ||
| 63 | @@ -7,9 +7,9 @@ | ||
| 64 | |||
| 65 | Disassembly of section .data: | ||
| 66 | 00008000 <WORD> (7e 00 00 00|00 00 00 7e).* | ||
| 67 | -00008004 <HALF> (7e 00 7e fe|00 7e 7e fe).* | ||
| 68 | -00008006 <BYTE> 7e fe 00 fe.* | ||
| 69 | -00008007 <ULEB128> fe 00.* | ||
| 70 | +00008004 <HALF> (7e 00|00 7e).* | ||
| 71 | +00008006 <BYTE> 7e.* | ||
| 72 | +00008007 <ULEB128> fe.* | ||
| 73 | ... | ||
| 74 | 00008009 <ULEB128_2> fe 00.* | ||
| 75 | .* | ||
| 76 | Index: git/ld/ChangeLog | ||
| 77 | =================================================================== | ||
| 78 | --- git.orig/ld/ChangeLog 2017-09-21 13:53:59.611223454 +0530 | ||
| 79 | +++ git/ld/ChangeLog 2017-09-21 14:01:12.294643335 +0530 | ||
| 80 | @@ -1,3 +1,8 @@ | ||
| 81 | +2017-06-14 Nick Clifton <nickc@redhat.com> | ||
| 82 | + | ||
| 83 | + PR binutils/21580 | ||
| 84 | + * testsuite/ld-nds32/diff.d: Adjust expected output. | ||
| 85 | + | ||
| 86 | 2016-12-05 Nick Clifton <nickc@redhat.com> | ||
| 87 | |||
| 88 | PR ld/20906 | ||
