]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Run check-localpltk/textrel/execstack over ld.so.
authorCarlos O'Donell <carlos@redhat.com>
Thu, 6 Nov 2014 20:48:44 +0000 (15:48 -0500)
committerCarlos O'Donell <carlos@redhat.com>
Thu, 6 Nov 2014 20:48:44 +0000 (15:48 -0500)
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

16 files changed:
ChangeLog
elf/Makefile
sysdeps/generic/localplt.data
sysdeps/unix/sysv/linux/aarch64/localplt.data
sysdeps/unix/sysv/linux/alpha/localplt.data
sysdeps/unix/sysv/linux/arm/localplt.data
sysdeps/unix/sysv/linux/i386/localplt.data
sysdeps/unix/sysv/linux/ia64/localplt.data
sysdeps/unix/sysv/linux/m68k/localplt.data
sysdeps/unix/sysv/linux/microblaze/localplt.data
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
sysdeps/unix/sysv/linux/s390/localplt.data
sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data

index 9ee1c0d03ca9968e4f0faa62edfb92a2ecca3e92..3d7cf67c2f04cecbc602867620a60ea3ac0a4a33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2014-11-06  Carlos O'Donell  <carlos@redhat.com>
+
+       * elf/Makefile (all-built-dso): Add $(common-objpfx)elf/ld.so.
+       (localplt-build-dso): Add elf/ld.so.
+       * sysdeps/unix/sysv/linux/i386/localplt.data: Add ___tls_get_addr
+       i.e. 3 underscore version, __libc_memalign, malloc, calloc, realloc,
+       and free for ld.so.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data: Add
+       __libc_memalign, malloc, calloc, realloc, and free for ld.so.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data:
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data:
+       Likewise.
+       * sysdeps/unix/sysv/linux/s390/localplt.data: Likewise.
+       * sysdeps/generic/localplt.data: Add __tls_get_addr i.e. 2 underscore
+       version, __libc_memalign, malloc, calloc, realloc and free for ld.so.
+       * sysdeps/unix/sysv/linux/aarch64/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/arm/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/microblaze/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data: Likewise.
+
 2014-11-05  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #14132]
index 94074f3e343c1215c6fc97d6b2f06f81205ab067..34f0b1fb83a4ba9038fd24563eac5d443936f65a 100644 (file)
@@ -904,7 +904,7 @@ CFLAGS-tst-pie2.c += $(pie-ccflag)
 $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
 
 ifeq (yes,$(build-shared))
-all-built-dso := $(common-objpfx)libc.so \
+all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
                 $(filter-out $(common-objpfx)linkobj/libc.so, \
                              $(sort $(wildcard $(addprefix $(common-objpfx), \
                                                            */lib*.so \
@@ -963,6 +963,7 @@ common-generated += $(all-built-dso:$(common-objpfx)%=%.jmprel)
 
 localplt-built-dso := $(addprefix $(common-objpfx),\
                                  libc.so \
+                                 elf/ld.so \
                                  math/libm.so \
                                  rt/librt.so \
                                  dlfcn/libdl.so \
index d2965199f3cb36058efb484eefd35855f1d93e68..d7d673454fa561f6f34c45711062a54f9dc82b66 100644 (file)
@@ -7,3 +7,12 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index dfca9a7ac7ec3daa671751b4f08f55e9230c5893..a3392d37735fc8a146aa30e606959d8f73360ef0 100644 (file)
@@ -12,3 +12,12 @@ libm.so: matherr
 libm.so: __signbit
 libm.so: __signbitf
 libm.so: __signbitl
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index 6b2e51599c4adb6caed70fbc2585c1bf839eaba4..e2a4311cbdacfe69d0313383336ae4c2d39efc01 100644 (file)
@@ -24,3 +24,12 @@ libm.so: matherr
 # We used to offer inline functions that used this, so it must be exported.
 # Ought to reorg things such that carg isn't thus forced to use a plt.
 libm.so: __atan2
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index 109522e37e6edf67df720a5d1137c2c959efb4cf..85160bde528522f728c2c331dab760d0f93b7e55 100644 (file)
@@ -11,3 +11,12 @@ libm.so: __signbitf
 libm.so: matherr
 libpthread.so: __errno_location
 libpthread.so: raise
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index 8fb56b6086388f5a56bf624570b1ff42a04b3f21..009797bc069a69d4bd187d31fa061d6b6c649e85 100644 (file)
@@ -5,3 +5,14 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
+# The dynamic loader needs ___tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+# Note that it is triple underscore for ___tls_get_addr e.g. the alternate
+# ABI.
+ld.so: ___tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index ba488163bb91199a97e59372a59d23e88c703a50..bc2ce41665f5242ddfcb1b59d5979c3e324c1086 100644 (file)
@@ -6,3 +6,12 @@ libc.so: realloc
 libm.so: matherr
 libm.so: matherrf
 libm.so: matherrl
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index d266b8f74b7065144da476295f56f0c1a4a44392..15a9fe5beb78162dd26ac16aebdb2acd9e55788c 100644 (file)
@@ -6,3 +6,12 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index 6dd5bcb4de967c28f9b8b51f44ef8b6d013d49f6..f488c9579c4da4a030ab42d8c7bebdcae8e51414 100644 (file)
@@ -9,3 +9,12 @@ libm.so: __signbit
 libm.so: __signbitf
 libm.so: matherr
 libpthread.so: __errno_location
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index 8fb56b6086388f5a56bf624570b1ff42a04b3f21..b25abf800650c8aba280b48a606b243e664c67a3 100644 (file)
@@ -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
index 6332a006d8c3c04daedd3568f3c87cf5d4013e05..0b3b32739fd50f6cf04d4974cc353e3de896c0ab 100644 (file)
@@ -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
index 2219aa9048c1671d3df1c951b0e814b1d4bf8088..49d5de6019ea4e944c07778b602051ce7120c0f5 100644 (file)
@@ -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
index 8fb56b6086388f5a56bf624570b1ff42a04b3f21..b25abf800650c8aba280b48a606b243e664c67a3 100644 (file)
@@ -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
index 15ba18b96d4e7144337aad09dada4dc66d0171ac..81c165076484713785f9f553abc859227f28a6aa 100644 (file)
@@ -15,3 +15,12 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
index 6f1769c026cdeb5f20d0e70a53df68d7aa9fe226..d6f9e02e8802b002d89a58bd3ba4d30dc473946c 100644 (file)
@@ -17,3 +17,12 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
+# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
+# internally to allocate aligned TLS storage. The other malloc family of
+# functions are expected to allow user symbol interposition.
+ld.so: __tls_get_addr
+ld.so: __libc_memalign
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free