2023-10-30 19:37:03 +00:00
|
|
|
diff --git a/memcheck/tests/overlap.vgtest b/memcheck/tests/overlap.vgtest
|
|
|
|
index 54a0baacf..eba65897c 100644
|
|
|
|
--- a/memcheck/tests/overlap.vgtest
|
|
|
|
+++ b/memcheck/tests/overlap.vgtest
|
|
|
|
@@ -1,2 +1,4 @@
|
|
|
|
prog: overlap
|
|
|
|
vgopts: -q
|
|
|
|
+# https://bugs.kde.org/show_bug.cgi?id=402833
|
|
|
|
+prereq: ! ../../tests/arch_test amd64
|
2023-05-05 15:41:30 +00:00
|
|
|
diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c
|
2023-10-30 19:37:03 +00:00
|
|
|
index 8de6a0698..79e640189 100644
|
2023-05-05 15:41:30 +00:00
|
|
|
--- a/shared/vg_replace_strmem.c
|
|
|
|
+++ b/shared/vg_replace_strmem.c
|
2023-10-30 19:37:03 +00:00
|
|
|
@@ -1128,8 +1128,15 @@ static inline void my_exit ( int x )
|
|
|
|
#define MEMMOVE(soname, fnname) \
|
2023-05-05 15:41:30 +00:00
|
|
|
MEMMOVE_OR_MEMCPY(20181, soname, fnname, 0)
|
|
|
|
|
2023-10-30 19:37:03 +00:00
|
|
|
-#define MEMCPY(soname, fnname) \
|
|
|
|
+/* See https://bugs.kde.org/show_bug.cgi?id=402833
|
|
|
|
+ why we disable the overlap check on x86_64. */
|
|
|
|
+#if defined(VGP_amd64_linux)
|
|
|
|
+ #define MEMCPY(soname, fnname) \
|
|
|
|
+ MEMMOVE_OR_MEMCPY(20180, soname, fnname, 0)
|
|
|
|
+#else
|
|
|
|
+ #define MEMCPY(soname, fnname) \
|
|
|
|
MEMMOVE_OR_MEMCPY(20180, soname, fnname, 1)
|
|
|
|
+#endif
|
2023-05-05 15:41:30 +00:00
|
|
|
|
|
|
|
#if defined(VGO_linux)
|
|
|
|
/* For older memcpy we have to use memmove-like semantics and skip
|
2023-10-30 19:37:03 +00:00
|
|
|
@@ -1704,6 +1711,14 @@ static inline void my_exit ( int x )
|
|
|
|
|
|
|
|
/*-------------------- memcpy_chk --------------------*/
|
|
|
|
|
|
|
|
+/* See https://bugs.kde.org/show_bug.cgi?id=402833
|
|
|
|
+ why we disable the overlap check on x86_64. */
|
|
|
|
+#if defined(VGP_amd64_linux)
|
|
|
|
+ #define CHECK_OVERLAP 0
|
|
|
|
+#else
|
|
|
|
+ #define CHECK_OVERLAP 1
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#define GLIBC26___MEMCPY_CHK(soname, fnname) \
|
|
|
|
void* VG_REPLACE_FUNCTION_EZU(20300,soname,fnname) \
|
|
|
|
(void* dst, const void* src, SizeT len, SizeT dstlen ); \
|
|
|
|
@@ -1717,7 +1732,7 @@ static inline void my_exit ( int x )
|
2023-05-30 16:19:52 +00:00
|
|
|
RECORD_COPY(len); \
|
|
|
|
if (len == 0) \
|
|
|
|
return dst; \
|
|
|
|
- if (is_overlap(dst, src, len, len)) \
|
2023-10-30 19:37:03 +00:00
|
|
|
+ if (CHECK_OVERLAP && is_overlap(dst, src, len, len)) \
|
|
|
|
RECORD_OVERLAP_ERROR("memcpy_chk", dst, src, len); \
|
2023-05-30 16:19:52 +00:00
|
|
|
if ( dst > src ) { \
|
|
|
|
d = (HChar *)dst + len - 1; \
|