glibc/sysdeps/unix/sysv/linux/m68k
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
coldfire Add reallocarray function 2017-05-30 18:27:57 -03:00
m680x0 Add reallocarray function 2017-05-30 18:27:57 -03: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 Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03: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
alphasort64.c
arch-fork.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 m68k: Consolidate nptl/ subdirectories under linux/... 2014-06-23 09:24:18 -07:00
clone.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
configure
configure.ac
dl-librecon.h
dl-static.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fcntl.c
fxstat.c
fxstatat.c
getdents64.c
getmsg.c
getpagesize.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getsysstats.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
glob64.c
init-first.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
kernel-features.h Remove __ASSUME_REQUEUE_PI 2017-04-04 18:02:02 -03:00
ldconfig.h
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libc-m68k-vdso.c
localplt.data ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00
lockf64.c
lxstat.c
m68k-helpers.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k-vdso.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k-vdso.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mmap_internal.h Consolidate Linux mmap implementation (BZ#21270) 2017-04-12 11:04:28 -03:00
mremap.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pt-vfork.c m68k: Consolidate NPTL/non versions of vfork 2014-06-14 21:37:34 +02:00
putmsg.c
readdir64.c
readdir64_r.c
register-dump.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
scandir64.c
sigcontextinfo.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syscall.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syscalls.list posix: Consolidate Linux waitpid syscall 2017-05-18 18:06:47 -03:00
sysdep-cancel.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysdep.S 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
versionsort64.c
vfork.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
xstat.c