nptl: Clear TLS area for static binaries.
commit13fcd46ea7d2d93858061748d6428b900150f6ad
authorChristophe Lyon <christophe.lyon@st.com>
Wed, 4 Jul 2018 15:55:38 +0000 (4 17:55 +0200)
committerWaldemar Brodkorb <wbrodkorb@conet.de>
Fri, 10 Aug 2018 14:02:45 +0000 (10 16:02 +0200)
treed2b2fd5c5553ae759abdca6df97ae48edf8afb99
parent606a8b28e4987e09572dd0c6b40546cdcbcc1bf7
nptl: Clear TLS area for static binaries.

busybox init checks it has pid 1, but getpid() returns another value
when building busybox statically. This is because the corresponding
area is not cleared when allocated (it is allocated with
MAP_UNINITIALIZED, whose behavior depends on the Linux kernel's
CONFIG_MMAP_ALLOW_UNINITIALIZED).

This patch fixes the problem by explicitly clearing the memory area.

* libpthread/nptl/sysdeps/generic/libc-tls.c (__libc_tls_setup):
Clear tlsblock.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
libpthread/nptl/sysdeps/generic/libc-tls.c