glibc/sysdeps/unix/sysv/linux/s390
Adhemerval Zanella 158d5fa0e1 Consolidate Linux mmap implementation (BZ#21270)
This patch consolidates all Linux mmap implementations on default
sysdeps/unix/sysv/linux/mmap{64}.c one.  To accomodate all required
architecture specific requeriments a new internal header is created
(mmap_internal.h) where each architecture add its specific code
requirements.  Currently only x86_64 (to define MMAP_PREPARE to add
MAP_32BITS), s390 (which have a different kernel ABI for mmap), m68k
(which have variable minimum page sizes), and MIPS n32 (which zero
extend the offset to handle negative one correctly) redefine the new
header.

The patch also fixes BZ#21270 where default mmap64 on architectures
which uses mmap2 silent truncates large offsets value (larger than
1 << (page shift + 8 * sizeof (off_t)) or 1<<44 on architectures with
4096 bytes page size).  The new consolidate implementation returns
EINVAL as allowed by POSIX.

It also adds a tests for on current tst-mmap-offset one.  I have run
a full make check on x86_64, x86_64-32, i686, aarch64, armhf, powerpc,
powerpc64le, sparc64, and sparcv9 without any regressions.  I also ran
some basic tests (tst-mmap-offset) on sh4, m68k, and on qemu simulated
MIPS32 and MIPS64.

	[BZ #21270]
	* posix/tst-mmap-offset.c (do_prepare): New function.
	(do_test): Rename to do_test_bz18877 and use FAIL_RET.
	(do_test_bz21270): New function.
	* sysdeps/unix/sysv/linux/aarch64/mmap.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/mmap.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/hppa/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/mmap_internal.h: New file.
	* sysdeps/unix/sysv/linux/m68k/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Remove mmap
	from auto-generation list.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/mmap.c: New file.
	* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Add check for invalid
	offsets and support for mmap2 syscall.
2017-04-12 11:04:28 -03:00
..
bits Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fpu Implement accurate fma. 2010-10-13 22:27:03 -04:00
s390-32 Consolidate Linux mmap implementation (BZ#21270) 2017-04-12 11:04:28 -03:00
s390-64 Consolidate Linux mmap implementation (BZ#21270) 2017-04-12 11:04:28 -03:00
sys Add Linux PTRACE_EVENT_STOP 2017-02-08 07:18:44 +00:00
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
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-cache.h Update. 2003-06-25 08:19:44 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-conf.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-conf.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-lock.c S390: Adjust lock elision code after review. 2017-01-20 09:53:04 +01:00
elision-timed.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-trylock.c S390: Adjust lock elision code after review. 2017-01-20 09:53:04 +01:00
elision-unlock.c S390: Adjust lock elision code after review. 2017-01-20 09:53:04 +01:00
force-elision.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
htm.h S390: Adjust lock elision code after review. 2017-01-20 09:53:04 +01:00
Implies NPTL is no longer an add-on! 2014-07-07 09:29:06 -07:00
init-first.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmp-unwind.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
kernel-features.h Consolidate Linux send implementation 2017-03-09 15:22:06 +01:00
ldconfig.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ldd-rewrite.sed Fix for bi-arch support. 2002-03-11 11:01:07 +00:00
libanl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libc-vdso.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
localplt.data ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00
longjmp_chk.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lowlevellock.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Makefile S390: Use own tbegin macro instead of __builtin_tbegin. 2016-12-20 15:12:48 +01:00
mmap_internal.h Consolidate Linux mmap implementation (BZ#21270) 2017-04-12 11:04:28 -03:00
nldbl-abi.h * math/divtc3.c: New file. 2006-02-01 03:02:06 +00:00
opensock.c * sysdeps/unix/sysv/linux/Makefile [subdir=inet] (sysdep_headers): 2007-11-23 15:19:41 +00:00
pt-longjmp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pt-vfork.S S390: Consolidate NPTL/non versions of vfork 2014-06-26 09:30:52 -07:00
pthread_mutex_cond_lock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_mutex_lock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_mutex_timedlock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_mutex_trylock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
readelflib.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rt-sysdep.S Update. 2004-04-18 02:37:56 +00:00
sa_len.c Clean up __libc_sa_len helper. 2013-08-27 10:34:16 -07:00
semtimedop.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigcontextinfo.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysconf.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
system.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ucontext_i.sym S/390: Revert the jmp_buf/ucontext_t ABI change. 2014-07-31 20:04:54 +02:00
Versions Move remaining S390 code out of nptl/. 2014-06-26 09:31:11 -07:00