diff options
| author | Armin Kuster <akuster808@gmail.com> | 2017-11-26 11:51:52 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-11 22:02:58 +0000 |
| commit | 34a2b675f4c95c8112cb60cc2c88ca247e03d083 (patch) | |
| tree | 729bf586fa41a8c9b0c5b09df99cd2d3f681c88d | |
| parent | 722c61d4f4ce2a756e28c85a079d1f6bba201c12 (diff) | |
| download | poky-34a2b675f4c95c8112cb60cc2c88ca247e03d083.tar.gz | |
binutils: Security Fix CVE-2017-7614
Affects: <= 2.28
(From OE-Core rev: 6dd4758d9f7060ccf1a30d7a4adb09beb43bc574)
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.28.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch | 103 |
2 files changed, 104 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.28.inc b/meta/recipes-devtools/binutils/binutils-2.28.inc index f09bcdc4c1..6ae091c289 100644 --- a/meta/recipes-devtools/binutils/binutils-2.28.inc +++ b/meta/recipes-devtools/binutils/binutils-2.28.inc | |||
| @@ -44,6 +44,7 @@ SRC_URI = "\ | |||
| 44 | file://CVE-2017-7209.patch \ | 44 | file://CVE-2017-7209.patch \ |
| 45 | file://CVE-2017-7210.patch \ | 45 | file://CVE-2017-7210.patch \ |
| 46 | file://CVE-2017-7223.patch \ | 46 | file://CVE-2017-7223.patch \ |
| 47 | file://CVE-2017-7614.patch \ | ||
| 47 | " | 48 | " |
| 48 | S = "${WORKDIR}/git" | 49 | S = "${WORKDIR}/git" |
| 49 | 50 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch new file mode 100644 index 0000000000..be8631ab78 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-7614.patch | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | From ad32986fdf9da1c8748e47b8b45100398223dba8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Nick Clifton <nickc@redhat.com> | ||
| 3 | Date: Tue, 4 Apr 2017 11:23:36 +0100 | ||
| 4 | Subject: [PATCH] Fix null pointer dereferences when using a link built with | ||
| 5 | clang. | ||
| 6 | |||
| 7 | PR binutils/21342 | ||
| 8 | * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer | ||
| 9 | dereference. | ||
| 10 | (bfd_elf_final_link): Only initialize the extended symbol index | ||
| 11 | section if there are extended symbol tables to list. | ||
| 12 | |||
| 13 | Upstream-Status: Backport | ||
| 14 | CVE: CVE-2017-7614 | ||
| 15 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
| 16 | |||
| 17 | --- | ||
| 18 | bfd/ChangeLog | 8 ++++++++ | ||
| 19 | bfd/elflink.c | 35 +++++++++++++++++++++-------------- | ||
| 20 | 2 files changed, 29 insertions(+), 14 deletions(-) | ||
| 21 | |||
| 22 | Index: git/bfd/elflink.c | ||
| 23 | =================================================================== | ||
| 24 | --- git.orig/bfd/elflink.c | ||
| 25 | +++ git/bfd/elflink.c | ||
| 26 | @@ -119,15 +119,18 @@ _bfd_elf_define_linkage_sym (bfd *abfd, | ||
| 27 | defined in shared libraries can't be overridden, because we | ||
| 28 | lose the link to the bfd which is via the symbol section. */ | ||
| 29 | h->root.type = bfd_link_hash_new; | ||
| 30 | + bh = &h->root; | ||
| 31 | } | ||
| 32 | + else | ||
| 33 | + bh = NULL; | ||
| 34 | |||
| 35 | - bh = &h->root; | ||
| 36 | bed = get_elf_backend_data (abfd); | ||
| 37 | if (!_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_GLOBAL, | ||
| 38 | sec, 0, NULL, FALSE, bed->collect, | ||
| 39 | &bh)) | ||
| 40 | return NULL; | ||
| 41 | h = (struct elf_link_hash_entry *) bh; | ||
| 42 | + BFD_ASSERT (h != NULL); | ||
| 43 | h->def_regular = 1; | ||
| 44 | h->non_elf = 0; | ||
| 45 | h->root.linker_def = 1; | ||
| 46 | @@ -11973,24 +11976,28 @@ bfd_elf_final_link (bfd *abfd, struct bf | ||
| 47 | { | ||
| 48 | /* Finish up and write out the symbol string table (.strtab) | ||
| 49 | section. */ | ||
| 50 | - Elf_Internal_Shdr *symstrtab_hdr; | ||
| 51 | + Elf_Internal_Shdr *symstrtab_hdr = NULL; | ||
| 52 | file_ptr off = symtab_hdr->sh_offset + symtab_hdr->sh_size; | ||
| 53 | |||
| 54 | - symtab_shndx_hdr = & elf_symtab_shndx_list (abfd)->hdr; | ||
| 55 | - if (symtab_shndx_hdr != NULL && symtab_shndx_hdr->sh_name != 0) | ||
| 56 | + if (elf_symtab_shndx_list (abfd)) | ||
| 57 | { | ||
| 58 | - symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; | ||
| 59 | - symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); | ||
| 60 | - symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx); | ||
| 61 | - amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx); | ||
| 62 | - symtab_shndx_hdr->sh_size = amt; | ||
| 63 | + symtab_shndx_hdr = & elf_symtab_shndx_list (abfd)->hdr; | ||
| 64 | |||
| 65 | - off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr, | ||
| 66 | - off, TRUE); | ||
| 67 | + if (symtab_shndx_hdr != NULL && symtab_shndx_hdr->sh_name != 0) | ||
| 68 | + { | ||
| 69 | + symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; | ||
| 70 | + symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); | ||
| 71 | + symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx); | ||
| 72 | + amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx); | ||
| 73 | + symtab_shndx_hdr->sh_size = amt; | ||
| 74 | |||
| 75 | - if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0 | ||
| 76 | - || (bfd_bwrite (flinfo.symshndxbuf, amt, abfd) != amt)) | ||
| 77 | - return FALSE; | ||
| 78 | + off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr, | ||
| 79 | + off, TRUE); | ||
| 80 | + | ||
| 81 | + if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0 | ||
| 82 | + || (bfd_bwrite (flinfo.symshndxbuf, amt, abfd) != amt)) | ||
| 83 | + return FALSE; | ||
| 84 | + } | ||
| 85 | } | ||
| 86 | |||
| 87 | symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; | ||
| 88 | Index: git/bfd/ChangeLog | ||
| 89 | =================================================================== | ||
| 90 | --- git.orig/bfd/ChangeLog | ||
| 91 | +++ git/bfd/ChangeLog | ||
| 92 | @@ -1,3 +1,11 @@ | ||
| 93 | +2017-04-04 Nick Clifton <nickc@redhat.com> | ||
| 94 | + | ||
| 95 | + PR binutils/21342 | ||
| 96 | + * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer | ||
| 97 | + dereference. | ||
| 98 | + (bfd_elf_final_link): Only initialize the extended symbol index | ||
| 99 | + section if there are extended symbol tables to list. | ||
| 100 | + | ||
| 101 | 2017-03-07 Alan Modra <amodra@gmail.com> | ||
| 102 | |||
| 103 | PR 21224 | ||
