glibc/sysdeps
Alan Modra 19a6a3acd1 Harden powerpc64 elf_machine_fixup_plt
IFUNC is difficult to correctly implement on any target needing a GOT
to support position independent code, due to the dependency on order
of dynamic relocations.  ld.so should be changed to apply IFUNC
relocations last, globally, because without that it is actually
impossible to write an IFUNC resolver in C that works in all
situations.  Case in point, vfork in libpthread.so is an IFUNC with
the resolver returning &__libc_vfork.  (system and fork are similar.)
If another shared library, libA say, uses vfork then it is quite
possible that libpthread.so hasn't been dynamically relocated before
the unfortunate libA is dynamically relocated.  In that case the GOT
entry for &__libc_vfork is still zero, so the IFUNC resolver returns
NULL.  LD_BIND_NOW=1 results in libA PLT dynamic relocations being
applied using this NULL value and ld.so segfaults.

This patch hardens ld.so to not segfault on a NULL from an IFUNC
resolver.  It also fixes a problem with undefined weak.  If you leave
the plt entry as-is for undefined weak then if the entry is ever
called it will loop in ld.so rather than segfaulting.

	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_fixup_plt):
	Don't segfault if ifunc resolver returns a NULL.  Do set plt to
	zero for undefined weak.
	(elf_machine_plt_conflict): Similarly.
2015-03-26 12:30:45 +10:30
..
aarch64 Clean up sysdep-dl-routines variable. 2015-02-06 10:42:08 -08:00
alpha Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
arm ARM: Fix memcpy & memmove for [ARM_ALWAYS_BX] 2015-03-19 12:45:24 -07:00
generic Define ETH_ALEN in generic <netinet/if_ether.h>. 2015-03-04 16:11:31 -08:00
gnu hurd: fix unwind-resume.c build 2015-02-08 18:46:00 +01:00
hppa hppa: Fix feupdateenv and fesetexceptflag (Bug 18111). 2015-03-11 02:48:59 -04:00
i386 Add more tests of acosh, asinh and atanh. 2015-03-25 22:21:20 +00:00
ia64 Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
ieee754 powerpc: Fix incorrect results for pow when using FMA 2015-03-10 09:38:54 -04:00
init_array NPTL: Initializer for .init_array-only configurations. 2015-02-13 13:19:11 -08:00
m68k m68k: fix 64-bit arithmetic in atomic operations (bug 18128) 2015-03-14 22:27:36 +01:00
mach Fix warnings 2015-03-21 04:49:44 +01:00
microblaze Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
mips 2015-02-18 Steve Ellcey <sellcey@imgtec.com> 2015-02-18 10:51:37 -08:00
nios2 Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
nptl Include <signal.h> in sysdeps/nptl/allocrtsig.c 2015-01-29 10:00:25 +01:00
posix linux: open and openat ignore 'mode' with O_TMPFILE in flags 2015-02-24 13:19:22 +05:30
powerpc Harden powerpc64 elf_machine_fixup_plt 2015-03-26 12:30:45 +10:30
pthread Fix aio_error thread-safety. 2015-03-06 11:32:24 +01:00
s390 S/390: Regenerate ULPs 2015-03-12 11:04:13 +01:00
sh Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
sparc Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
tile Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY 2015-03-05 08:40:41 -08:00
unix Remove unused macros from i386 lowlevellock.h. 2015-03-25 21:21:18 +00:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
x86 Fix atan / atan2 missing underflows (bug 15319). 2015-02-18 21:10:49 +00:00
x86_64 Add more tests of acosh, asinh and atanh. 2015-03-25 22:21:20 +00:00