From da53d6dbc28d2a90d6e14dd661e68611c3b741cf Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Thu, 6 Nov 2014 15:48:44 -0500 Subject: Run check-localpltk/textrel/execstack over ld.so. For maximum paranoia we run ld.so through the normal set of tests for all of the shared libraries. This includes running ld.so through check-localplt, check-textrel, and check-execstack. While none of these should trigger any failures given the way ld.so is built, it might possibly fail if a developer does something wrong. This paranoia was triggered by a discussion over the use of __strcpy vs. strcpy [1] and if the symbol could leak and use the libc.so version. The check-localplt test fails right away because localplt.data needs updating for all arches. By default we add 6 new symbols: __tls_get_addr, __libc_memalign, malloc, calloc, realloc and free. Other machines like i386, power, and s390 require some different symbol sets e.g. ___tls_get_addr vs. __tls_get_addr for i386. Verified for i386 Verified for x86_64 Verified for ppc32 Verified for ppc64 Verified for ppc64le Verified for arm Verified for aarch64 Verified for s390 Verified for s390x Guessed for alpha Guessed for ia64 Guessed for m68k Guessed for microblaze Guessed for sparc32 Guessed for sparc64 Defaults for sh Defaults for mips Defaults for hppa Defaults for tile Machine manintainers notified to double check the data used in localplt.data. [1] https://sourceware.org/ml/libc-alpha/2014-10/msg00548.html --- sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data | 8 ++++++++ sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data | 8 ++++++++ sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data | 8 ++++++++ 3 files changed, 24 insertions(+) (limited to 'sysdeps/unix/sysv/linux/powerpc') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data index 8fb56b6086..b25abf8006 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data @@ -5,3 +5,11 @@ libc.so: malloc libc.so: memalign libc.so: realloc libm.so: matherr +# The dynamic loader uses __libc_memalign internally to allocate aligned +# TLS storage. The other malloc family of functions are expected to allow +# user symbol interposition. +ld.so: __libc_memalign +ld.so: malloc +ld.so: calloc +ld.so: realloc +ld.so: free diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data index 6332a006d8..0b3b32739f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data @@ -38,3 +38,11 @@ libm.so: __signbitl libm.so: copysignl ? libm.so: fabsl libm.so: matherr +# The dynamic loader uses __libc_memalign internally to allocate aligned +# TLS storage. The other malloc family of functions are expected to allow +# user symbol interposition. +ld.so: __libc_memalign +ld.so: malloc +ld.so: calloc +ld.so: realloc +ld.so: free diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data index 2219aa9048..49d5de6019 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data @@ -4,3 +4,11 @@ libc.so: malloc libc.so: memalign libc.so: realloc libm.so: matherr +# The dynamic loader uses __libc_memalign internally to allocate aligned +# TLS storage. The other malloc family of functions are expected to +# allow user symbol interposition. +ld.so: __libc_memalign +ld.so: malloc +ld.so: calloc +ld.so: realloc +ld.so: free -- cgit 1.4.1