glibc/sysdeps/i386/i686
Adhemerval Zanella 3abeeec5f4 Fix i686 memchr overflow calculation (BZ#21182)
This patch fixes the regression added by 23d2770 for final address
overflow calculation.  The subtraction of the considered size (16)
at line 120 is at wrong place, for sizes less than 16 subsequent
overflow check will not take in consideration an invalid size (since
the subtraction will be negative).  Also, the lea instruction also
does not raise the carry flag (CF) that is used in subsequent jbe
to check for overflow.

The fix is to follow x86_64 logic from 3daef2c where the overflow
is first check and a sub instruction is issued.  In case of resulting
negative size, CF will be set by the sub instruction and a NULL
result will be returned.  The patch also add similar tests reported
in bug report.

Checked on i686-linux-gnu and x86_64-linux-gnu.

	* string/test-memchr.c (do_test): Add BZ#21182 checks for address
	near end of a page.
	* sysdeps/i386/i686/multiarch/memchr-sse2.S (__memchr): Fix
	overflow calculation.
2017-03-29 09:54:14 -03:00
..
fpu Move tests of catan, catanh to auto-libm-test-*. 2017-02-17 18:42:37 +00:00
multiarch Fix i686 memchr overflow calculation (BZ#21182) 2017-03-29 09:54:14 -03:00
nptl Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
add_n.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bcopy.S Optimize 32bit memset/memcpy with SSE2/SSSE3. 2010-01-12 11:22:03 -08:00
bzero.S Replace BZERO_P/PIC with USE_AS_BZERO/SHARED 2015-08-26 08:01:03 -07:00
dl-hash.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ffs.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
hp-timing.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
init-arch.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Makefile Remove remnants of .og patterns 2016-09-20 12:18:13 +02:00
memcmp.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.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mempcpy.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
memusage.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_spin_trylock.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stack-aliasing.h nptl: Remove COLORING_INCREMENT 2017-02-06 15:58:32 -02:00
strcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00