aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/strcpy.S
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2019-02-01 12:20:06 -0800
committerH.J. Lu <hjl.tools@gmail.com>2019-02-02 06:23:50 -0800
commit689ad968852ec44f5e6b6dd42cda382d08538246 (patch)
treefc7060061c6534e74d24c3e15c2fff2dc4173d0a /sysdeps/x86_64/strcpy.S
parentd057fef28c700258f35b122664609eedc0c2d1f9 (diff)
downloadglibc-689ad968852ec44f5e6b6dd42cda382d08538246.tar
glibc-689ad968852ec44f5e6b6dd42cda382d08538246.tar.gz
glibc-689ad968852ec44f5e6b6dd42cda382d08538246.tar.bz2
glibc-689ad968852ec44f5e6b6dd42cda382d08538246.zip
x86-64 memcpy: Properly handle the length parameter [BZ #24097]
On x32, the size_t parameter may be passed in the lower 32 bits of a 64-bit register with the non-zero upper 32 bits. The string/memory functions written in assembly can only use the lower 32 bits of a 64-bit register as length or must clear the upper 32 bits before using the full 64-bit register for length. This pach fixes memcpy for x32. Tested on x86-64 and x32. On x86-64, libc.so is the same with and withou the fix. [BZ #24097] CVE-2019-6488 * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Use RDX_LP for length. Clear the upper 32 bits of RDX register. * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S: Likewise. * sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Likewise. * sysdeps/x86_64/x32/Makefile (tests): Add tst-size_t-memcpy. tst-size_t-wmemchr. * sysdeps/x86_64/x32/tst-size_t-memcpy.c: New file. (cherry picked from commit 231c56760c1e2ded21ad96bbb860b1f08c556c7a)
Diffstat (limited to 'sysdeps/x86_64/strcpy.S')
0 files changed, 0 insertions, 0 deletions