about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/rawmemchr-avx2.S
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-02-15 20:27:21 -0600
committerNoah Goldstein <goldstein.w.n@gmail.com>2022-02-16 02:11:16 -0600
commite108c02a5e23c8c88ce66d8705d4a24bb6b9a8bf (patch)
treeaa7b3178016dfb0f5a270d900385d889016be1ee /sysdeps/x86_64/multiarch/rawmemchr-avx2.S
parent0281c7a7ec8f3f46d8e6f5f3d7fca548946dbfce (diff)
downloadglibc-e108c02a5e23c8c88ce66d8705d4a24bb6b9a8bf.tar.gz
glibc-e108c02a5e23c8c88ce66d8705d4a24bb6b9a8bf.tar.xz
glibc-e108c02a5e23c8c88ce66d8705d4a24bb6b9a8bf.zip
x86: Fix bug in strncmp-evex and strncmp-avx2 [BZ #28895]
Logic can read before the start of `s1` / `s2` if both `s1` and `s2`
are near the start of a page. To avoid having the result contimated by
these comparisons the `strcmp` variants would mask off these
comparisons. This was missing in the `strncmp` variants causing
the bug. This commit adds the masking to `strncmp` so that out of
range comparisons don't affect the result.

test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass as
well a full xcheck on x86_64 linux.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'sysdeps/x86_64/multiarch/rawmemchr-avx2.S')
0 files changed, 0 insertions, 0 deletions