glibc/manual
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
..
examples libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) 2016-09-30 09:14:15 -07:00
argp.texi Manual typos: The Basic Program/System Interface 2016-10-06 12:19:25 +05:30
arith.texi Define FE_SNANS_ALWAYS_SIGNAL. 2016-12-16 18:03:25 +00:00
charset.texi manual: fix typos in character set handling 2016-06-16 00:45:37 -04:00
check-safety.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
conf.texi Manual typos: System Configuration Parameters 2016-10-06 12:24:07 +05:30
contrib.texi Manual typos: Contributors to 2016-10-06 12:30:03 +05:30
creature.texi Make _REENTRANT and _THREAD_SAFE aliases for _POSIX_C_SOURCE=199506L. 2016-12-08 15:45:33 -05:00
crypt.texi Add getentropy, getrandom, <sys/random.h> [BZ #17252] 2016-12-12 17:28:04 +01:00
ctype.texi manual: fix typos in the character handling chapter 2016-06-16 00:37:44 -04:00
debug.texi Manual typos: Debugging support 2016-10-06 12:25:38 +05:30
dir .. 2005-11-21 15:45:19 +00:00
errno.texi manual: fix typos in error reporting 2016-05-19 23:25:06 -04:00
fdl-1.3.texi BZ#13738: Switch manual to FDL 1.3. 2012-02-24 12:58:10 -08:00
filesys.texi Manual typos: File System Interface 2016-10-06 12:01:51 +05:30
freemanuals.texi Update to canonical freemanuals.texi file. 2013-09-24 14:06:56 -07:00
getopt.texi Manual typos: The Basic Program/System Interface 2016-10-06 12:19:25 +05:30
header.texi Use Texinfo macros to refer to the GNU C Library within the manual. 2012-02-28 14:44:20 +00:00
install-plain.texi BZ #15941: Fix INSTALL file regeneration failure with makeinfo 5.x 2013-12-05 09:58:20 +05:30
install.texi Add pretty printers for the NPTL lock types 2016-12-08 18:59:02 +05:30
intro.texi manual: fix typo in the introduction 2016-05-19 23:22:59 -04:00
io.texi Clean up glibc manual references to "GNU system" (bug 6911). 2012-03-08 01:27:38 +00:00
ipc.texi manual/ipc.texi: Fix AC-safety notes. 2014-04-08 17:12:15 -04:00
job.texi Manual typos: Job Control 2016-10-06 12:20:28 +05:30
lang.texi Manual typos: C Language Facilities in the Library 2016-10-06 12:27:48 +05:30
lgpl-2.1.texi Use canonical FSF .texi files for LGPL and FDL texts. 2011-06-06 16:16:55 -07:00
libc-texinfo.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
libc.texinfo Fix doc quoting problems with Texinfo 5 2016-01-10 00:20:51 -08:00
libcbook.texi
libdl.texi * manual/libdl.texi: New. 2014-01-31 23:23:59 -02:00
libm-err-tab.pl Add llogb, llogbf, llogbl. 2016-12-02 01:42:49 +00:00
llio.texi Manual typos: Low-Level Input/Output 2016-10-06 11:58:02 +05:30
locale.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
macros.texi Fix exponents in manual. 2015-08-20 09:43:50 +02:00
maint.texi Manual typos: Library Maintenance 2016-10-06 12:29:11 +05:30
Makefile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
math.texi Add getentropy, getrandom, <sys/random.h> [BZ #17252] 2016-12-12 17:28:04 +01:00
memory.texi Remove references to sbrk to grow/shrink arenas 2016-10-26 15:07:07 +05:30
message.texi manual: fix typos in the message chapter 2016-06-16 01:14:32 -04:00
nss.texi Manual typos: System Databases and Name Service Switch 2016-10-06 12:36:26 +05:30
nsswitch.texi
pattern.texi manual: fix typos in the pattern chapter 2016-06-16 01:34:38 -04:00
pipe.texi * manual/pipe.texi: Document MTASC-safety properties. 2014-01-31 23:37:28 -02:00
platform.texi PowerPC: Extend Program Priority Register support 2015-08-19 17:43:26 -03:00
probes.texi Manual typos: Internal probes 2016-10-06 12:26:35 +05:30
process.texi Manual typos: Processes 2016-10-06 12:20:00 +05:30
resource.texi Manual typos: Resource Usage and Limitation 2016-10-06 12:16:53 +05:30
search.texi manual: fix typos in the search chapter 2016-06-16 01:24:16 -04:00
setjmp.texi Manual typos: Non-Local Exits 2016-10-06 12:17:29 +05:30
signal.texi Manual typos: Signal Handling 2016-10-06 12:18:05 +05:30
socket.texi Manual typos: Sockets 2016-10-06 12:05:11 +05:30
startup.texi Manual typos: The Basic Program/System Interface 2016-10-06 12:19:25 +05:30
stdio-fp.c
stdio.texi Manual typos: Input/Output on Streams 2016-10-06 11:55:58 +05:30
string.texi New string function explicit_bzero (from OpenBSD). 2016-12-16 16:21:54 -05:00
summary.awk Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sysinfo.texi manual: Remove non-existent mount options S_IMMUTABLE and S_APPEND [BZ #11235] 2016-11-15 15:56:00 -05:00
syslog.texi Manual typos: Syslog 2016-10-06 12:08:46 +05:30
terminal.texi Manual typos: Low-Level Terminal Interface 2016-10-06 12:07:28 +05:30
texinfo.tex Update miscellaneous files from upstream sources. 2016-01-05 18:04:06 +00:00
texis.awk Correct close statement. 2001-05-18 13:01:32 +00:00
threads.texi Manual typos: POSIX Threads 2016-10-06 12:26:06 +05:30
time.texi Manual typos: Date and Time 2016-10-06 12:14:36 +05:30
tsort.awk Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
users.texi Manual typos: Users and Groups 2016-10-06 12:21:46 +05:30
xtract-typefun.awk Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00