glibc/sysdeps/powerpc
Adhemerval Zanella b224637928 Fix powerpc64/power7 memchr for large input sizes
Current optimized powercp64/power7 memchr uses a strategy to check for
p versus align(p+n) (where 'p' is the input char pointer and n the
maximum size to check for the byte) without taking care for possible
overflow on the pointer addition in case of large 'n'.

It was triggered by 3038145ca2 where default rawmemchr (used to
created ppc64 rawmemchr in ifunc selection) now uses memchr (p, c, (size_t)-1)
on its implementation.

This patch fixes it by implement a satured addition where overflows
sets the maximum pointer size to UINTPTR_MAX.

Checked on powerpc64le-linux-gnu.

	[BZ# 20971]
	* sysdeps/powerpc/powerpc64/power7/memchr.S (__memchr): Avoid
	overflow in pointer addition.
	* string/test-memchr.c (do_test): Add an argument to pass as
	the size on memchr.
	(test_main): Add check for SIZE_MAX.
2016-12-16 11:30:20 -02:00
..
bits Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
fpu Fix powerpc fmax, fmin sNaN handling (bug 20947). 2016-12-15 00:43:16 +00:00
nofpu Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
nptl Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
power4 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
power5+/fpu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
power6 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
power7/fpu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
powerpc32 powerpc: Add hidden definition for __sigsetjmp 2016-11-29 10:16:35 +01:00
powerpc64 Fix powerpc64/power7 memchr for large input sizes 2016-12-16 11:30:20 -02:00
soft-fp soft-fp: support after-rounding tininess detection. 2014-02-12 18:27:12 +00:00
sys/platform powerpc: Installed-header hygiene 2016-10-04 10:54:40 -03:00
Implies PowerPC: unify math_ldbl.h implementations 2013-03-08 11:07:15 -03:00
Makefile powerpc: Add hwcap/hwcap2/platform data to TCB. 2015-12-03 13:56:13 -02:00
Versions Add femode_t functions. 2016-09-07 16:40:09 +00:00
abort-instr.h Update. 2002-09-15 18:31:23 +00:00
atomic-machine.h Remove atomic_compare_and_exchange_bool_rel. 2016-06-24 23:04:40 +03:00
dl-procinfo.c powerpc: remove _dl_platform_string and _dl_powerpc_platforms 2016-12-13 10:15:09 +01:00
dl-procinfo.h powerpc: remove _dl_platform_string and _dl_powerpc_platforms 2016-12-13 10:15:09 +01:00
dl-tls.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-tls.h elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
ffs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fpu_control.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hwcapinfo.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
hwcapinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ifunc-sel.h powerpc: fix ifunc-sel.h fix asm constraints and clobber list 2016-08-03 00:22:44 +02:00
jmpbuf-offsets.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-tls.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
locale-defines.sym powerpc: strcasestr optmization for power8 2016-04-22 19:23:13 +05:30
longjmp.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
math-tests.h Add tests for fegetexceptflag, fesetexceptflag. 2016-08-10 21:01:08 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mp_clz_tab.c Update. 2002-03-14 20:48:50 +00:00
novmx-longjmp.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
novmx-sigjmp.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
novmxsetjmp.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
preconfigure Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments. 2014-06-25 17:52:56 +00:00
rtld-global-offsets.sym PowerPC: Define AT_HWCAP2 bits and AT_HWCAP2 handling for POWER8. 2013-06-28 16:52:49 -05:00
sched_cpucount.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sigjmp.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strcat.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sysdep.h powerpc: Enforce compiler barriers on hardware transactions 2016-01-08 17:47:33 -02:00
test-arith.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-arithf.c Update. 1997-08-10 18:37:15 +00:00
test-get_hwcap-static.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-get_hwcap.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-gettimebase.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tls-macros.h Split tls-macros.h in sysdeps directories. 2012-07-19 17:04:04 -03:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-tlsopt-powerpc.c powerpc __tls_get_addr call optimization 2015-03-25 15:53:47 +10:30