]> git.ipfire.org Git - thirdparty/glibc.git/commit
x86-64 memcmp: Use unsigned Jcc instructions on size [BZ #24155]
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 4 Feb 2019 16:55:52 +0000 (08:55 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 4 Feb 2019 18:27:37 +0000 (10:27 -0800)
commit04e767b59b16befce93c6086362acbc1fae63f4e
tree4a2834237cb3079e8ba7770a0b46747e3ca7cbba
parentdc968f557398565d416dab69224f722c1d2beb9b
x86-64 memcmp: Use unsigned Jcc instructions on size [BZ #24155]

Since the size argument is unsigned. we should use unsigned Jcc
instructions, instead of signed, to check size.

Tested on x86-64 and x32, with and without --disable-multi-arch.

[BZ #24155]
CVE-2019-7309
* NEWS: Updated for CVE-2019-7309.
* sysdeps/x86_64/memcmp.S: Use RDX_LP for size.  Clear the
upper 32 bits of RDX register for x32.  Use unsigned Jcc
instructions, instead of signed.
* sysdeps/x86_64/x32/Makefile (tests): Add tst-size_t-memcmp-2.
* sysdeps/x86_64/x32/tst-size_t-memcmp-2.c: New test.

(cherry picked from commit 3f635fb43389b54f682fc9ed2acc0b2aaf4a923d)
ChangeLog
NEWS
sysdeps/x86_64/memcmp.S
sysdeps/x86_64/x32/Makefile
sysdeps/x86_64/x32/tst-size_t-memcmp-2.c [new file with mode: 0644]