This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-311-g0e6d3ad


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  0e6d3adc60d8073397af6a320e594d98d7fbedde (commit)
      from  6b1df8b27f7c48d3933b152c0edc9493b199df84 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0e6d3adc60d8073397af6a320e594d98d7fbedde

commit 0e6d3adc60d8073397af6a320e594d98d7fbedde
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Oct 28 09:11:55 2016 -0700

    Check IFUNC definition in unrelocated shared library [BZ #20019]
    
    Calling an IFUNC function defined in unrelocated shared library may
    lead to segfault.  This patch issues an error message to request
    relinking the shared library if it references IFUNC function defined
    in the unrelocated shared library.
    
    	[BZ #20019]
    	* sysdeps/i386/dl-machine.h (elf_machine_rel): Check IFUNC
    	definition in unrelocated shared library.
    	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.

diff --git a/ChangeLog b/ChangeLog
index b5626ed..995720e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #20019]
+	* sysdeps/i386/dl-machine.h (elf_machine_rel): Check IFUNC
+	definition in unrelocated shared library.
+	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
+
 2016-10-28  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #20729]
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 4e3968a..e5ad0c5 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -321,7 +321,23 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 			       0)
 	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
 	  && __builtin_expect (!skip_ifunc, 1))
-	value = ((Elf32_Addr (*) (void)) value) ();
+	{
+# ifndef RTLD_BOOTSTRAP
+	  if (sym_map != map
+	      && sym_map->l_type != lt_executable
+	      && !sym_map->l_relocated)
+	    {
+	      const char *strtab
+		= (const char *) D_PTR (map, l_info[DT_STRTAB]);
+	      _dl_fatal_printf ("\
+%s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
+				RTLD_PROGNAME, map->l_name,
+				sym_map->l_name,
+				strtab + refsym->st_name);
+	    }
+# endif
+	  value = ((Elf32_Addr (*) (void)) value) ();
+	}
 
       switch (r_type)
 	{
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index c0f0fa1..5c021dc 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -331,7 +331,23 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
 			       0)
 	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
 	  && __builtin_expect (!skip_ifunc, 1))
-	value = ((ElfW(Addr) (*) (void)) value) ();
+	{
+# ifndef RTLD_BOOTSTRAP
+	  if (sym_map != map
+	      && sym_map->l_type != lt_executable
+	      && !sym_map->l_relocated)
+	    {
+	      const char *strtab
+		= (const char *) D_PTR (map, l_info[DT_STRTAB]);
+	      _dl_fatal_printf ("\
+%s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
+				RTLD_PROGNAME, map->l_name,
+				sym_map->l_name,
+				strtab + refsym->st_name);
+	    }
+# endif
+	  value = ((ElfW(Addr) (*) (void)) value) ();
+	}
 
       switch (r_type)
 	{

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |    7 +++++++
 sysdeps/i386/dl-machine.h   |   18 +++++++++++++++++-
 sysdeps/x86_64/dl-machine.h |   18 +++++++++++++++++-
 3 files changed, 41 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]