glibc/sysdeps/i386/i686/multiarch
Adhemerval Zanella 23d27709a4 Fix i686 memchr for large input sizes
Similar to BZ#19387 and BZ#20971, both i686 memchr optimized assembly
implementations (memchr-sse2-bsf and memchr-sse2) do not handle the
size overflow correctly.

It is shown by the new tests added by commit 3daef2c8ee, where
both implementation fails with size as SIZE_MAX.

This patch uses a similar strategy used on 3daef2c8ee, where
saturared math is used for overflow case.

Checked on i686-linux-gnu.

	[BZ #21014]
	* sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S (MEMCHR): Avoid overflow
	in pointer addition.
	* sysdeps/i386/i686/multiarch/memchr-sse2.S (MEMCHR): Likewise.
2017-01-02 17:52:51 -02:00
..
bcopy-sse2-unaligned.S i386: memcpy functions with SSE2 unaligned load/store 2014-12-30 07:19:38 -08:00
bcopy-ssse3-rep.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
bcopy-ssse3.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
bcopy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bzero-sse2-rep.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
bzero-sse2.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
bzero.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ifunc-impl-list.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
locale-defines.sym SSSE3 optimized strcasecmp and strncasecmp for x86-32 2011-11-13 09:50:13 -05:00
Makefile Remove x86 ifunc-defines.sym and rtld-global-offsets.sym 2016-05-11 05:51:39 -07:00
memchr-sse2-bsf.S Fix i686 memchr for large input sizes 2017-01-02 17:52:51 -02:00
memchr-sse2.S Fix i686 memchr for large input sizes 2017-01-02 17:52:51 -02:00
memchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcmp-sse4.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcmp-ssse3.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy-sse2-unaligned.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy-ssse3-rep.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy-ssse3.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memmove_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memmove-sse2-unaligned.S i386: memcpy functions with SSE2 unaligned load/store 2014-12-30 07:19:38 -08:00
memmove-ssse3-rep.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
memmove-ssse3.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
memmove.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mempcpy_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mempcpy-sse2-unaligned.S i386: memcpy functions with SSE2 unaligned load/store 2014-12-30 07:19:38 -08:00
mempcpy-ssse3-rep.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
mempcpy-ssse3.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
mempcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memrchr-c.c Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
memrchr-sse2-bsf.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memrchr-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset-sse2-rep.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rawmemchr-sse2-bsf.S Optimized memchr, memrchr, rawmemchr for x86-32 2011-10-12 11:42:04 -04:00
rawmemchr-sse2.S Optimized memchr, memrchr, rawmemchr for x86-32 2011-10-12 11:42:04 -04:00
rawmemchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rtld-strnlen.c Fix strnlen change 2011-10-23 16:30:40 -04:00
s_fma-fma.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
s_fma.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
s_fmaf-fma.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
s_fmaf.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sched_cpucount.c Support multiarch for i686. 2009-07-31 11:53:35 -07:00
stpcpy-sse2.S Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
stpcpy-ssse3.S Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
stpcpy.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
stpncpy-sse2.S Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
stpncpy-ssse3.S Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
stpncpy.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strcasecmp_l-c.c Fix x86 strcasecmp_l (bug 13786). 2012-02-29 22:37:38 +00:00
strcasecmp_l-sse4.S Add SSE4.2 support for strcasecmp and strncasecmp on x86-32 2011-11-14 18:24:35 -05:00
strcasecmp_l-ssse3.S SSSE3 optimized strcasecmp and strncasecmp for x86-32 2011-11-13 09:50:13 -05:00
strcasecmp_l.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strcasecmp-c.c SSSE3 optimized strcasecmp and strncasecmp for x86-32 2011-11-13 09:50:13 -05:00
strcasecmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcat-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcat-ssse3.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcat.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchr-sse2-bsf.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchr-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcmp-sse4.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcmp-ssse3.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcpy-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcpy-ssse3.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcspn-c.c Add x86 32-bit SSE4.2 string functions. 2009-08-04 12:13:43 -07:00
strcspn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strlen-sse2-bsf.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strlen-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strlen.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strncase_l-c.c Fix x86 strcasecmp_l (bug 13786). 2012-02-29 22:37:38 +00:00
strncase_l-sse4.S Add SSE4.2 support for strcasecmp and strncasecmp on x86-32 2011-11-14 18:24:35 -05:00
strncase_l-ssse3.S SSSE3 optimized strcasecmp and strncasecmp for x86-32 2011-11-13 09:50:13 -05:00
strncase_l.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strncase-c.c SSSE3 optimized strcasecmp and strncasecmp for x86-32 2011-11-13 09:50:13 -05:00
strncase.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strncat-c.c Improve x86-32 strcat functions with SSE2/SSSE3 2011-08-04 15:33:38 -04:00
strncat-sse2.S Improve x86-32 strcat functions with SSE2/SSSE3 2011-08-04 15:33:38 -04:00
strncat-ssse3.S Improve x86-32 strcat functions with SSE2/SSSE3 2011-08-04 15:33:38 -04:00
strncat.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strncmp-c.c 32bit memcmp/strcmp/strncmp optimized for SSSE3/SSS4.2 2010-02-15 11:17:50 -08:00
strncmp-sse4.S 32bit memcmp/strcmp/strncmp optimized for SSSE3/SSS4.2 2010-02-15 11:17:50 -08:00
strncmp-ssse3.S 32bit memcmp/strcmp/strncmp optimized for SSSE3/SSS4.2 2010-02-15 11:17:50 -08:00
strncmp.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strncpy-c.c Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
strncpy-sse2.S Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
strncpy-ssse3.S Optimized st{r,p}{,n}cpy for SSE2/SSSE3 on x86-32 2011-06-24 14:15:32 -04:00
strncpy.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strnlen-c.c Use libc_hidden_proto / libc_hidden_def with __strnlen. 2015-06-02 20:24:25 +00:00
strnlen-sse2.S Add optimized wcslen and strnlen for x86-32 2011-10-23 15:17:23 -04:00
strnlen.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strpbrk-c.c Add x86 32-bit SSE4.2 string functions. 2009-08-04 12:13:43 -07:00
strpbrk.S Add i686 __libc_ifunc_impl_list 2012-10-11 16:40:02 -07:00
strrchr-sse2-bsf.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strrchr-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strspn-c.c Add x86 32-bit SSE4.2 string functions. 2009-08-04 12:13:43 -07:00
strspn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
test-multiarch.c BZ#14059: Fix AVX and FMA4 detection. 2012-05-17 06:59:28 -07:00
varshift.c Fixup x86 after x86-64 varshift change. 2010-08-27 12:10:11 -07:00
varshift.h Clean up SSE variable shifts 2010-08-24 11:35:01 -07:00
wcschr-c.c powerpc: Fix __wcschr static build 2015-04-15 16:01:48 -03:00
wcschr-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcschr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcscmp-c.c Fix regcomp wcscoll, wcscmp namespace (bug 18497). 2015-06-09 21:07:30 +00:00
wcscmp-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcscmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcscpy-c.c Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
wcscpy-ssse3.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcscpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcslen-c.c Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
wcslen-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcslen.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcsrchr-c.c Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
wcsrchr-sse2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcsrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wmemcmp-c.c Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
wmemcmp-sse4.S Optimized memcmp and wmemcmp for x86-64 and x86-32 2011-10-15 11:10:08 -04:00
wmemcmp-ssse3.S Optimized memcmp and wmemcmp for x86-64 and x86-32 2011-10-15 11:10:08 -04:00
wmemcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00