diff options
| author | Thiruvadi Rajaraman <trajaraman@mvista.com> | 2017-09-04 18:31:38 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-07 17:10:08 +0000 |
| commit | 70f2d42e842bbf9d87a4a3674e648777b5afd632 (patch) | |
| tree | a64bdd0e532c1890e1c50bc10333cd4c590f617c | |
| parent | a36d21557b756e5e0b063f001841fd5afd2c706c (diff) | |
| download | poky-70f2d42e842bbf9d87a4a3674e648777b5afd632.tar.gz | |
binutils: CVE-2017-8395
Source: git://sourceware.org/git/binutils-gdb.git
MR: 74153
Type: Security Fix
Disposition: Backport from binutils-2_29
ChangeID: 27dce214c561f9ae6f874990432f9d76a7de29d4
Description:
Fix seg-fault attempting to compress a debug section in a corrupt binary.
PR binutils/21431
* compress.c (bfd_init_section_compress_status): Check the return
value from bfd_malloc.
Affects: <= 2.29
Author: Nick Clifton <nickc@redhat.com>
(From OE-Core rev: addac2e8f6f6132807a590a032a4292079542fbe)
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-8395.patch | 72 |
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc index 447de53946..ecb0cdf094 100644 --- a/meta/recipes-devtools/binutils/binutils-2.27.inc +++ b/meta/recipes-devtools/binutils/binutils-2.27.inc | |||
| @@ -68,6 +68,7 @@ SRC_URI = "\ | |||
| 68 | file://CVE-2017-7303.patch \ | 68 | file://CVE-2017-7303.patch \ |
| 69 | file://CVE-2017-7304.patch \ | 69 | file://CVE-2017-7304.patch \ |
| 70 | file://CVE-2017-8393.patch \ | 70 | file://CVE-2017-8393.patch \ |
| 71 | file://CVE-2017-8395.patch \ | ||
| 71 | " | 72 | " |
| 72 | S = "${WORKDIR}/git" | 73 | S = "${WORKDIR}/git" |
| 73 | 74 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-8395.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-8395.patch new file mode 100644 index 0000000000..42793e133b --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-8395.patch | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | commit e63d123268f23a4cbc45ee55fb6dbc7d84729da3 | ||
| 2 | Author: Nick Clifton <nickc@redhat.com> | ||
| 3 | Date: Wed Apr 26 13:07:49 2017 +0100 | ||
| 4 | |||
| 5 | Fix seg-fault attempting to compress a debug section in a corrupt binary. | ||
| 6 | |||
| 7 | PR binutils/21431 | ||
| 8 | * compress.c (bfd_init_section_compress_status): Check the return | ||
| 9 | value from bfd_malloc. | ||
| 10 | |||
| 11 | Upstream-Status: Backport | ||
| 12 | |||
| 13 | CVE: CVE-2017-8395 | ||
| 14 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
| 15 | |||
| 16 | Index: git/bfd/compress.c | ||
| 17 | =================================================================== | ||
| 18 | --- git.orig/bfd/compress.c 2017-09-04 17:55:00.546577566 +0530 | ||
| 19 | +++ git/bfd/compress.c 2017-09-04 17:55:10.770664577 +0530 | ||
| 20 | @@ -534,7 +534,6 @@ | ||
| 21 | { | ||
| 22 | bfd_size_type uncompressed_size; | ||
| 23 | bfd_byte *uncompressed_buffer; | ||
| 24 | - bfd_boolean ret; | ||
| 25 | |||
| 26 | /* Error if not opened for read. */ | ||
| 27 | if (abfd->direction != read_direction | ||
| 28 | @@ -550,18 +549,18 @@ | ||
| 29 | /* Read in the full section contents and compress it. */ | ||
| 30 | uncompressed_size = sec->size; | ||
| 31 | uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size); | ||
| 32 | + /* PR 21431 */ | ||
| 33 | + if (uncompressed_buffer == NULL) | ||
| 34 | + return FALSE; | ||
| 35 | + | ||
| 36 | if (!bfd_get_section_contents (abfd, sec, uncompressed_buffer, | ||
| 37 | 0, uncompressed_size)) | ||
| 38 | - ret = FALSE; | ||
| 39 | - else | ||
| 40 | - { | ||
| 41 | - uncompressed_size = bfd_compress_section_contents (abfd, sec, | ||
| 42 | - uncompressed_buffer, | ||
| 43 | - uncompressed_size); | ||
| 44 | - ret = uncompressed_size != 0; | ||
| 45 | - } | ||
| 46 | + return FALSE; | ||
| 47 | |||
| 48 | - return ret; | ||
| 49 | + uncompressed_size = bfd_compress_section_contents (abfd, sec, | ||
| 50 | + uncompressed_buffer, | ||
| 51 | + uncompressed_size); | ||
| 52 | + return uncompressed_size != 0; | ||
| 53 | } | ||
| 54 | |||
| 55 | /* | ||
| 56 | Index: git/bfd/ChangeLog | ||
| 57 | =================================================================== | ||
| 58 | --- git.orig/bfd/ChangeLog 2017-09-04 17:55:10.714664101 +0530 | ||
| 59 | +++ git/bfd/ChangeLog 2017-09-04 17:56:40.991431847 +0530 | ||
| 60 | @@ -73,6 +73,12 @@ | ||
| 61 | (evax_bfd_print_egsd): Check for an overlarge record length. | ||
| 62 | (evax_bfd_print_etir): Likewise. | ||
| 63 | |||
| 64 | +2017-04-26 Nick Clifton <nickc@redhat.com> | ||
| 65 | + | ||
| 66 | + PR binutils/21431 | ||
| 67 | + * compress.c (bfd_init_section_compress_status): Check the return | ||
| 68 | + value from bfd_malloc. | ||
| 69 | + | ||
| 70 | 2017-04-25 Maciej W. Rozycki <macro@imgtec.com> | ||
| 71 | |||
| 72 | * readelf.c (process_mips_specific): Remove error reporting from | ||
