glibc/sysdeps/powerpc/powerpc64/power7
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
..
fpu Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
multiarch PowerPC: Adjust multiarch Implies for PowerPC64 2013-12-13 14:29:27 -05:00
add_n.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
bcopy.c PowerPC: optimized memmove for POWER7/PPC64 2014-07-07 15:41:21 -05:00
Implies powerpc: Re-work the Implies structure 2010-06-30 09:57:38 -07:00
Makefile powerpc: Fix strstr/power7 build 2015-08-11 10:03:09 -03:00
memchr.S Fix powerpc64/power7 memchr for large input sizes 2016-12-16 11:30:20 -02:00
memcmp.S powerpc: Rearrange cfi_offset calls 2016-03-11 11:31:58 -03:00
memcpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memmove.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mempcpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memrchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memset.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rawmemchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stpncpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strcasecmp_l.S Optimized strcasecmp for Power7 2011-12-17 20:32:59 -05:00
strcasecmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strchrnul.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strcmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strlen.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strncmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strncpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strnlen.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strrchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strstr-ppc64.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strstr.S powerpc: Rearrange cfi_offset calls 2016-03-11 11:31:58 -03:00
sub_n.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00