mirror of
https://git.yoctoproject.org/poky
synced 2026-04-01 05:02:21 +02:00
Source: git://sourceware.org/git/binutils-gdb.git
MR: 74257
Type: Security Fix
Disposition: Backport from 'embedded-binutils-master'
ChangeID: b55df05e3d3fd21bd30edaea124135892747b1ee
Description:
Linking non-ELF file broken by PR20908 fix
PR ld/20968
PR ld/20908
* elflink.c (bfd_elf_final_link): Revert 2016-12-02 change. Move
reloc counting code later after ELF flavour test.
PR lf/20908
* elflink.c (bfd_elf_final_link): Check for ELF flavour binaries
when following indirect links.
Affects: <= 2.28
Author: Nick Clifton <nickc@redhat.com>
(From OE-Core rev: 020863d45d39a336723300138777583afb0b12c7)
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>
48 lines
1.5 KiB
Diff
48 lines
1.5 KiB
Diff
commit d7f399a8de4c55eb841db6493597a587fac002de
|
|
Author: Nick Clifton <nickc@redhat.com>
|
|
Date: Fri Dec 2 17:46:26 2016 +0000
|
|
|
|
Fix seg-fault in linker when passed a corrupt binary input file.
|
|
|
|
PR lf/20908
|
|
* elflink.c (bfd_elf_final_link): Check for ELF flavour binaries
|
|
when following indirect links.
|
|
|
|
Upstream-Status: Backport
|
|
|
|
CVE: CVE-2017-7299
|
|
Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
|
|
|
|
Index: git/bfd/elflink.c
|
|
===================================================================
|
|
--- git.orig/bfd/elflink.c 2017-09-20 14:15:26.337333504 +0530
|
|
+++ git/bfd/elflink.c 2017-09-20 14:20:19.000000000 +0530
|
|
@@ -11201,6 +11201,12 @@
|
|
asection *sec;
|
|
|
|
sec = p->u.indirect.section;
|
|
+ /* See PR 20908 for a reproducer. */
|
|
+ if (bfd_get_flavour (sec->owner) != bfd_target_elf_flavour)
|
|
+ {
|
|
+ _bfd_error_handler (_("%B: not in ELF format"), sec->owner);
|
|
+ goto error_return;
|
|
+ }
|
|
esdi = elf_section_data (sec);
|
|
|
|
/* Mark all sections which are to be included in the
|
|
Index: git/bfd/ChangeLog
|
|
===================================================================
|
|
--- git.orig/bfd/ChangeLog 2017-09-20 14:20:19.000000000 +0530
|
|
+++ git/bfd/ChangeLog 2017-09-20 14:23:48.743556932 +0530
|
|
@@ -192,6 +192,10 @@
|
|
|
|
2016-12-02 Nick Clifton <nickc@redhat.com>
|
|
|
|
+ PR lf/20908
|
|
+ * elflink.c (bfd_elf_final_link): Check for ELF flavour binaries
|
|
+ when following indirect links.
|
|
+
|
|
PR ld/20909
|
|
* aoutx.h (aout_link_add_symbols): Fix off-by-one error in check
|
|
for an illegal string offset.
|