glibc/sysdeps/unix/sysv/linux/powerpc
Zack Weinberg ea1bd74def New string function explicit_bzero (from OpenBSD).
explicit_bzero(s, n) is the same as memset(s, 0, n), except that the
compiler is not allowed to delete a call to explicit_bzero even if the
memory pointed to by 's' is dead after the call.  Right now, this effect
is achieved externally by having explicit_bzero be a function whose
semantics are unknown to the compiler, and internally, with a no-op
asm statement that clobbers memory.  This does mean that small
explicit_bzero operations cannot be expanded inline as small memset
operations can, but on the other hand, small memset operations do get
deleted by the compiler.  Hopefully full compiler support for
explicit_bzero will happen relatively soon.

There are two new tests: test-explicit_bzero.c verifies the
visible semantics in the same way as the existing test-bzero.c,
and tst-xbzero-opt.c verifies the not-being-optimized-out property.
The latter is conceptually based on a test written by Matthew Dempsky
for the OpenBSD regression suite.

The crypt() implementation has an immediate use for this new feature.
We avoid having to add a GLIBC_PRIVATE alias for explicit_bzero
by running all of libcrypt's calls through the fortified variant,
__explicit_bzero_chk, which is in the impl namespace anyway.  Currently
I'm not aware of anything in libc proper that needs this, but the
glue is all in place if it does become necessary.  The legacy DES
implementation wasn't bothering to clear its buffers, so I added that,
mostly for consistency's sake.

	* string/explicit_bzero.c: New routine.
	* string/test-explicit_bzero.c, string/tst-xbzero-opt.c: New tests.
	* string/Makefile (routines, strop-tests, tests): Add them.
	* string/test-memset.c: Add ifdeffage for testing explicit_bzero.
	* string/string.h [__USE_MISC]: Declare explicit_bzero.

	* debug/explicit_bzero_chk.c: New routine.
	* debug/Makefile (routines): Add it.
	* debug/tst-chk1.c: Test fortification of explicit_bzero.
	* string/bits/string3.h: Fortify explicit_bzero.

	* manual/string.texi: Document explicit_bzero.
	* NEWS: Mention addition of explicit_bzero.

	* crypt/crypt-entry.c (__crypt_r): Clear key-dependent intermediate
	data before returning, using explicit_bzero.
	* crypt/md5-crypt.c (__md5_crypt_r): Likewise.
	* crypt/sha256-crypt.c (__sha256_crypt_r): Likewise.
	* crypt/sha512-crypt.c (__sha512_crypt_r): Likewise.

	* include/string.h: Redirect internal uses of explicit_bzero
	to __explicit_bzero_chk[_internal].
	* string/Versions [GLIBC_2.25]: Add explicit_bzero.
	* debug/Versions [GLIBC_2.25]: Add __explicit_bzero_chk.
	* sysdeps/arm/nacl/libc.abilist
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist
	* sysdeps/unix/sysv/linux/alpha/libc.abilist
	* sysdeps/unix/sysv/linux/arm/libc.abilist
	* sysdeps/unix/sysv/linux/hppa/libc.abilist
	* sysdeps/unix/sysv/linux/i386/libc.abilist
	* sysdeps/unix/sysv/linux/ia64/libc.abilist
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
	* sysdeps/unix/sysv/linux/nios2/libc.abilist
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
	* sysdeps/unix/sysv/linux/sh/libc.abilist
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist
	* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist:
	Add entries for explicit_bzero and __explicit_bzero_chk.
2016-12-16 16:21:54 -05:00
..
bits Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
powerpc32 New string function explicit_bzero (from OpenBSD). 2016-12-16 16:21:54 -05:00
powerpc64 New string function explicit_bzero (from OpenBSD). 2016-12-16 16:21:54 -05:00
sys powerpc: Installed-header hygiene 2016-10-04 10:54:40 -03:00
Implies NPTL is no longer an add-on! 2014-07-07 09:29:06 -07:00
Makefile Do not override objects in libc.a in other static libraries [BZ #20452] 2016-08-17 14:57:01 +02:00
Versions Revert {send,sendm,recv,recvm}msg conformance changes 2016-06-10 11:58:16 -03:00
arch-fork.h Split arch-fork.h from fork.h 2014-05-16 11:17:41 -07:00
configure Move architecture cases out of sysdeps/unix/sysv/linux/configure.ac. 2014-06-24 20:53:03 +00:00
configure.ac Move architecture cases out of sysdeps/unix/sysv/linux/configure.ac. 2014-06-24 20:53:03 +00:00
dl-brk.S
dl-cache.h Update. 2003-06-25 08:19:44 +00:00
dl-static.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-sysdep.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elision-conf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elision-conf.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elision-lock.c powerpc: Enforce compiler barriers on hardware transactions 2016-01-08 17:47:33 -02:00
elision-timed.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elision-trylock.c powerpc: Enforce compiler barriers on hardware transactions 2016-01-08 17:47:33 -02:00
elision-unlock.c powerpc: Enforce compiler barriers on hardware transactions 2016-01-08 17:47:33 -02:00
force-elision.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
get_clockfreq.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
get_timebase_freq.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getdents64.c
getmsg.c
gettimeofday.c ppc: Use libc_ifunc macro for time, gettimeofday. 2016-10-07 10:12:46 +02:00
htm.h powerpc: Fix macro usage of htm builtins 2016-01-22 14:13:08 -02:00
init-first.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ioctl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ipc_priv.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
kernel-features.h Consolidate posix_fadvise implementations 2016-10-07 14:16:41 -03:00
kernel_termios.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldconfig.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldd-rewrite.sed
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-start.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-vdso.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lowlevellock.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nldbl-abi.h 2006-01-27 Dwayne Grant McConnell <decimal@us.ibm.com> 2006-01-28 00:15:15 +00:00
profil-counter.h
pt-longjmp.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pthread_attr_setstack.c PowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files. 2014-05-26 11:45:14 -05:00
pthread_attr_setstacksize.c PowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files. 2014-05-26 11:45:14 -05:00
pthread_mutex_cond_lock.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pthread_mutex_lock.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pthread_mutex_timedlock.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pthread_mutex_trylock.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
putmsg.c
readdir64.c
readdir64_r.c
readelflib.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rt-sysdep.c Update. 2004-04-19 06:19:34 +00:00
sigcontextinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
syscall.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
syscalls.list Remove __libc_waitpid function name. 2014-11-07 01:27:16 +00:00
sysdep.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-gettimebasefreq.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
time.c ppc: Use libc_ifunc macro for time, gettimeofday. 2016-10-07 10:12:46 +02:00