diff options
author | Stefan Liebler <stli@linux.ibm.com> | 2019-11-27 12:35:40 +0100 |
---|---|---|
committer | Stefan Liebler <stli@linux.ibm.com> | 2019-11-27 12:35:40 +0100 |
commit | bfdb731438206b0f70fe7afa890681155c30b419 (patch) | |
tree | dd2dd2c6f006217931fccafc792906de6b0638f1 /sysdeps | |
parent | acfe409119f5db9429a2a2235fd2ad1242940cac (diff) | |
download | glibc-bfdb731438206b0f70fe7afa890681155c30b419.tar glibc-bfdb731438206b0f70fe7afa890681155c30b419.tar.gz glibc-bfdb731438206b0f70fe7afa890681155c30b419.tar.bz2 glibc-bfdb731438206b0f70fe7afa890681155c30b419.zip |
S390: Fix handling of needles crossing a page in strstr z15 ifunc-variant. [BZ #25226]
If the specified needle crosses a page-boundary, the s390-z15 ifunc variant of
strstr truncates the needle which results in invalid results.
This is fixed by loading the needle beyond the page boundary to v18 instead of v16.
The bug is sometimes observable in test-strstr.c in check1 and check2 as the
haystack and needle is stored on stack. Thus the needle can be on a page boundary.
check2 is now extended to test haystack / needles located on stack, at end of page
and on two pages.
This bug was introduced with commit 6f47401bd5fc71209219779a0426170a9a7395b0
("S390: Add arch13 strstr ifunc variant.") and is already released in glibc 2.30.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/s390/strstr-arch13.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/s390/strstr-arch13.S b/sysdeps/s390/strstr-arch13.S index 92cafd3850..aefdb499e4 100644 --- a/sysdeps/s390/strstr-arch13.S +++ b/sysdeps/s390/strstr-arch13.S @@ -164,7 +164,7 @@ ENTRY(STRSTR_ARCH13) vfenezb %v19,%v18,%v18 /* Search zero in loaded needle bytes. */ veclb %v19,%v21 /* Zero index <= max loaded byte index? */ jle .Lneedle_loaded /* -> v18 contains full needle. */ - vl %v16,0(%r3) /* Load needle beyond page boundary. */ + vl %v18,0(%r3) /* Load needle beyond page boundary. */ vfenezb %v19,%v18,%v18 j .Lneedle_loaded END(STRSTR_ARCH13) |