glibc/sysdeps/unix/sysv/linux/hppa
Dennis Wölfing 2e0bbbfbf9 Add reallocarray function
The reallocarray function is an extension from OpenBSD.  It is an
integer-overflow-safe replacement for realloc(p, X*Y) and
malloc(X*Y) (realloc(NULL, X*Y)).  It can therefore help in preventing
certain security issues in code.

This is an updated version of a patch originally submitted by Rüdiger
Sonderfeld in May 2014 [1].

Checked on i686-linux-gnu and x86_64-linux-gnu.

[1] <https://sourceware.org/ml/libc-alpha/2014-05/msg00481.html>.

2017-05-30  Dennis Wölfing  <denniswoelfing@gmx.de>
            Rüdiger Sonderfeld  <ruediger@c-plusplus.de>

	* include/stdlib.h (__libc_reallocarray): New declaration.
	* malloc/Makefile (routines): Add reallocarray.
	(tests): Add tst-reallocarray.c.
	* malloc/Versions: Add reallocarray and __libc_reallocarray.
	* malloc/malloc-internal.h (check_mul_overflow_size_t): New inline
	function.
	* malloc/malloc.h (reallocarray): New declaration.
	* stdlib/stdlib.h (reallocarray): Likewise.
	* malloc/reallocarray.c: New file.
	* malloc/tst-reallocarray.c: New test file.
	* manual/memory.texi: Document reallocarray.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Add reallocarray.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tilepro/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
2017-05-30 18:27:57 -03:00
..
bits Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sys Fix sys/ucontext.h namespace from signal.h etc. inclusion (bug 21457). 2017-05-23 11:49:48 +00:00
Implies NPTL is no longer an add-on! 2014-07-07 09:29:06 -07:00
Makefile Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
Versions Revert {send,sendm,recv,recvm}msg conformance changes 2016-06-10 11:58:16 -03:00
____longjmp_chk.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
arch-fork.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
atomic-machine.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
brk.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
c++-types.data HPPA: Add c++-types.data. 2014-09-07 22:09:49 -04:00
clone.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fcntl.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
fxstat.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
fxstatat.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
getcontext.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getdents64.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
internaltypes.h New condvar implementation that provides stronger ordering guarantees. 2016-12-31 14:56:47 +01:00
ipc_priv.h hppa: set __IPC_64 as zero for SysV IPC calls 2017-03-07 09:12:48 +01:00
kernel-features.h Consolidate Linux send implementation 2017-03-09 15:22:06 +01:00
kernel_sigaction.h Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
kernel_stat.h Allow [f]statfs64 to alias [f]statfs 2016-11-22 09:59:12 -08:00
ld.abilist ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00
libBrokenLocale.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libanl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libc.abilist Add reallocarray function 2017-05-30 18:27:57 -03:00
libcrypt.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libdl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libm.abilist Add fromfp functions. 2016-12-31 00:40:59 +00:00
libnsl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libpthread.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libresolv.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
librt.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libthread_db.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libutil.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
localplt.data ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00
lxstat.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
makecontext.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
profil-counter.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pt-vfork.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthreadP.h HPPA: Transition to new non-addon NPTL. 2014-09-07 22:08:36 -04:00
pthread_cond_broadcast.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_cond_destroy.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_cond_init.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_cond_signal.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_cond_wait.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setcontext.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
shlib-versions Remove configuration name patterns from shlib-versions. 2014-09-12 12:28:47 +00:00
swapcontext.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syscall.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syscalls.list Consolidate Linux send implementation 2017-03-09 15:22:06 +01:00
sysdep-cancel.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysdep.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ucontext_i.sym Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
umount.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
utimes.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
xstat.c Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00