import CS valgrind-3.24.0-3.el9
This commit is contained in:
parent
6943d0c759
commit
6dc6ae194f
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/valgrind-3.23.0.tar.bz2
|
||||
SOURCES/valgrind-3.24.0.tar.bz2
|
||||
|
@ -1 +1 @@
|
||||
ec410c75d3920d4f9249a5cfa2cac31e1bf6d586 SOURCES/valgrind-3.23.0.tar.bz2
|
||||
6fc0470fedc0d85dae3e042297cabd13c6100749 SOURCES/valgrind-3.24.0.tar.bz2
|
||||
|
@ -1,18 +1,18 @@
|
||||
From 2afcd730a10d61c318289bc4c39c42eebd4b35a6 Mon Sep 17 00:00:00 2001
|
||||
From cc09f61e56e90c9d3a0e7231cc69b2a499d1205f Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon, 29 Apr 2024 15:15:46 +0200
|
||||
Subject: [PATCH 01/11] Prepare NEWS for branch 3.23 fixes
|
||||
Date: Sat, 23 Nov 2024 02:09:27 +0100
|
||||
Subject: [PATCH 01/11] Prepare NEWS for branch 3.24 fixes
|
||||
|
||||
---
|
||||
NEWS | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 11c67410fb6f..8bdd3753f7bb 100644
|
||||
index 49b4647d4295..8362e1d2df41 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,3 +1,14 @@
|
||||
+Branch 3.23
|
||||
+Branch 3.24
|
||||
+~~~~~~~~~~~
|
||||
+
|
||||
+* ==================== FIXED BUGS ====================
|
||||
@ -23,9 +23,9 @@ index 11c67410fb6f..8bdd3753f7bb 100644
|
||||
+ https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
+where XXXXXX is the bug number as listed above.
|
||||
+
|
||||
Release 3.23.0 (26 Apr 2024)
|
||||
Release 3.24.0 (31 Oct 2024)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
--
|
||||
2.45.2
|
||||
2.47.0
|
||||
|
@ -1,83 +0,0 @@
|
||||
From 2e26af756d69c53026bf2d6d61589f754796340d Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Sat, 27 Apr 2024 13:07:07 +0200
|
||||
Subject: [PATCH 02/11] 486180 [MIPS] 'VexGuestArchState' has no member named
|
||||
'guest_IP_AT_SYSCALL'
|
||||
|
||||
(cherry picked from commit 7214886886bce9029f325214156c02dcfff760d5)
|
||||
---
|
||||
NEWS | 2 ++
|
||||
VEX/priv/guest_mips_helpers.c | 4 ++++
|
||||
VEX/pub/libvex_guest_mips32.h | 6 +++---
|
||||
VEX/pub/libvex_guest_mips64.h | 2 ++
|
||||
4 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 8bdd3753f7bb..c40e00cce46b 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,6 +5,8 @@ Branch 3.23
|
||||
|
||||
The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
+486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
+
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
where XXXXXX is the bug number as listed above.
|
||||
diff --git a/VEX/priv/guest_mips_helpers.c b/VEX/priv/guest_mips_helpers.c
|
||||
index 74cfb9c34caa..79197378cc74 100644
|
||||
--- a/VEX/priv/guest_mips_helpers.c
|
||||
+++ b/VEX/priv/guest_mips_helpers.c
|
||||
@@ -187,6 +187,8 @@ void LibVEX_GuestMIPS32_initialise( /*OUT*/ VexGuestMIPS32State * vex_state)
|
||||
vex_state->guest_w1.w64[1] = 0;
|
||||
vex_state->guest_w2.w64[0] = 0;
|
||||
vex_state->guest_w2.w64[1] = 0;
|
||||
+
|
||||
+ vex_state->guest_IP_AT_SYSCALL = 0;
|
||||
}
|
||||
|
||||
void LibVEX_GuestMIPS64_initialise ( /*OUT*/ VexGuestMIPS64State * vex_state )
|
||||
@@ -294,6 +296,8 @@ void LibVEX_GuestMIPS64_initialise ( /*OUT*/ VexGuestMIPS64State * vex_state )
|
||||
vex_state->guest_LLaddr = 0xFFFFFFFFFFFFFFFFULL;
|
||||
vex_state->guest_LLdata = 0;
|
||||
|
||||
+ vex_state->guest_IP_AT_SYSCALL = 0;
|
||||
+
|
||||
vex_state->guest_MSACSR = 0;
|
||||
}
|
||||
|
||||
diff --git a/VEX/pub/libvex_guest_mips32.h b/VEX/pub/libvex_guest_mips32.h
|
||||
index 214f63cdbe8c..e769819d75ae 100644
|
||||
--- a/VEX/pub/libvex_guest_mips32.h
|
||||
+++ b/VEX/pub/libvex_guest_mips32.h
|
||||
@@ -188,10 +188,10 @@ typedef
|
||||
|
||||
/* 1016 */ UInt guest_MSACSR;
|
||||
|
||||
- /* 1020 */ UInt _padding3;
|
||||
+ /* 1020 */ UInt guest_IP_AT_SYSCALL;
|
||||
|
||||
- /* 1020 */ ULong guest_LLdata64;
|
||||
- /* 1028 */ ULong _padding4;
|
||||
+ /* 1024 */ ULong guest_LLdata64;
|
||||
+ /* 1032 */ ULong _padding3;
|
||||
} VexGuestMIPS32State;
|
||||
/*---------------------------------------------------------------*/
|
||||
/*--- Utility functions for MIPS32 guest stuff. ---*/
|
||||
diff --git a/VEX/pub/libvex_guest_mips64.h b/VEX/pub/libvex_guest_mips64.h
|
||||
index 657fe6fa3343..a953f0ab86a2 100644
|
||||
--- a/VEX/pub/libvex_guest_mips64.h
|
||||
+++ b/VEX/pub/libvex_guest_mips64.h
|
||||
@@ -184,6 +184,8 @@ typedef
|
||||
/* 1144 */ UInt guest_MSACSR;
|
||||
|
||||
/* 1148 */ UInt _padding2;
|
||||
+ /* 1152 */ ULong guest_IP_AT_SYSCALL;
|
||||
+ /* 1160 */ ULong _padding3;
|
||||
|
||||
} VexGuestMIPS64State;
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,37 @@
|
||||
From 2cb0bee2d7722b57956f66a0795b5b9106f88afc Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Tue, 12 Nov 2024 13:23:03 +0100
|
||||
Subject: [PATCH 02/11] vgdb.c (fork_and_exec_valgrind): Fix off-by-one error
|
||||
write
|
||||
|
||||
commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
|
||||
consistently") introduced an off-by-one issue trying to write back the
|
||||
error from child to parent.
|
||||
|
||||
Instead of +1 it should have been +written (which initially is zero).
|
||||
|
||||
This is in an "should never happen" path, so hopefully didn't really
|
||||
cause issues. But if it did happen the parent would have gotten the
|
||||
wrong error code.
|
||||
|
||||
(cherry picked from commit f4fe5faf3d0f45b3824bbb9070232682df52a582)
|
||||
---
|
||||
coregrind/vgdb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c
|
||||
index 786ead160d34..112f23fe6ba1 100644
|
||||
--- a/coregrind/vgdb.c
|
||||
+++ b/coregrind/vgdb.c
|
||||
@@ -1368,7 +1368,7 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir,
|
||||
// We try to write the result to the parent, but always exit.
|
||||
size_t written = 0;
|
||||
while (written < sizeof (int)) {
|
||||
- ssize_t nrw = write (pipefd[1], ((char *) &err) + 1,
|
||||
+ ssize_t nrw = write (pipefd[1], ((char *) &err) + written,
|
||||
sizeof (int) - written);
|
||||
if (nrw == -1) {
|
||||
if (errno == EINTR || errno == EAGAIN)
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,96 +0,0 @@
|
||||
From 14141bb4a6ea528b4c0b9295aa64348f7a675735 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Wed, 1 May 2024 09:24:14 +0200
|
||||
Subject: [PATCH 03/11] Bug 486293 - memccpy false positives
|
||||
|
||||
(cherry picked from commit 805c020c6e5161966e6eb0099ebe937a510cea9e)
|
||||
---
|
||||
NEWS | 1 +
|
||||
memcheck/tests/memccpy2.c | 20 ++++++++++++++++++++
|
||||
memcheck/tests/memccpy2.stderr.exp | 4 ++--
|
||||
shared/vg_replace_strmem.c | 4 ++--
|
||||
4 files changed, 25 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index c40e00cce46b..f674191a286a 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -6,6 +6,7 @@ Branch 3.23
|
||||
The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
+486293 memccpy false positives
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/memcheck/tests/memccpy2.c b/memcheck/tests/memccpy2.c
|
||||
index a5a1dfc9f0af..947324581715 100644
|
||||
--- a/memcheck/tests/memccpy2.c
|
||||
+++ b/memcheck/tests/memccpy2.c
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
+#include <assert.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@@ -9,5 +11,23 @@ int main(void)
|
||||
memccpy(astring+10, astring, '#', len-10);
|
||||
sprintf(astring, "this is a string # with something to seek");
|
||||
memccpy(astring, astring+10, '#', len);
|
||||
+
|
||||
+ sprintf(astring, "this is a string # with something to seek");
|
||||
+ /*
|
||||
+ * space is earlier than len, no overlap
|
||||
+ * "this " gets copied (up to and including the first ' ')
|
||||
+ * and it overwrites the destination starting with the 's' of "string"
|
||||
+ * so res will point to the 'g' of "string"
|
||||
+ */
|
||||
+ char* res = memccpy(astring+10, astring, ' ', len-10);
|
||||
+ assert(res && *res == 'g');
|
||||
+ sprintf(astring, "this is a string # with something to seek");
|
||||
+ /* length is 0, nothing copied, returns NULL */
|
||||
+ res = memccpy(astring, "abcdefhhijklmnopqrstuvwxy", 'z', 0);
|
||||
+ assert(NULL == res);
|
||||
+ /* 'z' not found so 20 bytes copied, returns NULL */
|
||||
+ res = memccpy(astring, "abcdefhhijklmnopqrstuvwxy", 'z', 20);
|
||||
+ assert(NULL == res);
|
||||
+ free(astring);
|
||||
}
|
||||
|
||||
diff --git a/memcheck/tests/memccpy2.stderr.exp b/memcheck/tests/memccpy2.stderr.exp
|
||||
index 0132ef06c56a..240ce925c182 100644
|
||||
--- a/memcheck/tests/memccpy2.stderr.exp
|
||||
+++ b/memcheck/tests/memccpy2.stderr.exp
|
||||
@@ -1,8 +1,8 @@
|
||||
Source and destination overlap in memccpy(0x........, 0x........, 31)
|
||||
at 0x........: memccpy (vg_replace_strmem.c:...)
|
||||
- by 0x........: main (memccpy2.c:9)
|
||||
+ by 0x........: main (memccpy2.c:11)
|
||||
|
||||
Source and destination overlap in memccpy(0x........, 0x........, 41)
|
||||
at 0x........: memccpy (vg_replace_strmem.c:...)
|
||||
- by 0x........: main (memccpy2.c:11)
|
||||
+ by 0x........: main (memccpy2.c:13)
|
||||
|
||||
diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c
|
||||
index 737abbf67898..ae13a2a5f87a 100644
|
||||
--- a/shared/vg_replace_strmem.c
|
||||
+++ b/shared/vg_replace_strmem.c
|
||||
@@ -2364,9 +2364,9 @@ static inline void my_exit ( int x )
|
||||
\
|
||||
while (i-- > 0) \
|
||||
if ((*d++ = *s++) == x) { \
|
||||
- SizeT srclen = (i < len) ? i : len; \
|
||||
+ SizeT srclen = len - i; \
|
||||
RECORD_COPY(srclen); \
|
||||
- if (is_overlap(dst, src, srclen, srclen)) \
|
||||
+ if (is_overlap(dst, src, len, srclen)) \
|
||||
RECORD_OVERLAP_ERROR("memccpy", dst, src, len); \
|
||||
return d; \
|
||||
} \
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,36 @@
|
||||
From 8b08da73cf3d72439c4f750c96ed2f088ef1bbec Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Tue, 12 Nov 2024 13:34:09 +0100
|
||||
Subject: [PATCH 03/11] vgdb.c (fork_and_exec_valgrind): Fix another off-by-one
|
||||
error write
|
||||
|
||||
commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
|
||||
consistently") introduced another off-by-one issue trying to write
|
||||
back the error from child to parent.
|
||||
|
||||
Instead of +1 it should have been +written (which initially is zero).
|
||||
|
||||
This is when the child needs to do a chdir and that chdir fails. If
|
||||
that happens the parent would have gotten the wrong error code.
|
||||
|
||||
(cherry picked from commit 747ca4eb5fed5dd58a14391a997bb9e658e3b1c8)
|
||||
---
|
||||
coregrind/vgdb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c
|
||||
index 112f23fe6ba1..cc945c8dfafa 100644
|
||||
--- a/coregrind/vgdb.c
|
||||
+++ b/coregrind/vgdb.c
|
||||
@@ -1289,7 +1289,7 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir,
|
||||
// We try to write the result to the parent, but always exit.
|
||||
size_t written = 0;
|
||||
while (written < sizeof (int)) {
|
||||
- int nrw = write (pipefd[1], ((char *)&err) + 1,
|
||||
+ int nrw = write (pipefd[1], ((char *)&err) + written,
|
||||
sizeof (int) - written);
|
||||
if (nrw == -1) {
|
||||
if (errno == EINTR || errno == EAGAIN)
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,138 +0,0 @@
|
||||
From 3795a011eeb9730cda9f0beadce70aab8aa71e68 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Sat, 4 May 2024 15:03:11 +0200
|
||||
Subject: [PATCH 04/11] Bug 486569 - linux inotify_init syscall wrapper missing
|
||||
POST entry in syscall_table
|
||||
|
||||
(cherry picked from commit b38115cc6087f30f872c533f93c7c31a6d73eb24)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_syswrap/syswrap-amd64-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-arm-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-mips32-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-mips64-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-s390x-linux.c | 2 +-
|
||||
coregrind/m_syswrap/syswrap-x86-linux.c | 2 +-
|
||||
9 files changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index f674191a286a..b65f9206679b 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
486293 memccpy false positives
|
||||
+486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
index a59e01826ca2..86a47d9c2811 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
@@ -773,7 +773,7 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_keyctl, sys_keyctl), // 250
|
||||
LINX_(__NR_ioprio_set, sys_ioprio_set), // 251
|
||||
LINX_(__NR_ioprio_get, sys_ioprio_get), // 252
|
||||
- LINX_(__NR_inotify_init, sys_inotify_init), // 253
|
||||
+ LINXY(__NR_inotify_init, sys_inotify_init), // 253
|
||||
LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 254
|
||||
|
||||
LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 255
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
index 217b1c49dc9d..7b536e52cb2e 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
@@ -922,7 +922,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
// LINX_(__NR_ioprio_set, sys_ioprio_set), // 289
|
||||
|
||||
// LINX_(__NR_ioprio_get, sys_ioprio_get), // 290
|
||||
- LINX_(__NR_inotify_init, sys_inotify_init), // 291
|
||||
+ LINXY(__NR_inotify_init, sys_inotify_init), // 291
|
||||
LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 292
|
||||
LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 293
|
||||
// LINX_(__NR_migrate_pages, sys_migrate_pages), // 294
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
index 3f991da0a18d..e2f499eb80f8 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
@@ -1037,7 +1037,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY (__NR_mq_timedreceive, sys_mq_timedreceive), // 274
|
||||
LINX_ (__NR_mq_notify, sys_mq_notify), // 275
|
||||
LINXY (__NR_mq_getsetattr, sys_mq_getsetattr), // 276
|
||||
- LINX_ (__NR_inotify_init, sys_inotify_init), // 275
|
||||
+ LINXY (__NR_inotify_init, sys_inotify_init), // 275
|
||||
LINX_ (__NR_inotify_add_watch, sys_inotify_add_watch), // 276
|
||||
LINX_ (__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277
|
||||
LINXY (__NR_waitid, sys_waitid), // 278
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
index 9899a21cfa78..24f2bcc93956 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
@@ -759,7 +759,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINX_ (__NR_request_key, sys_request_key),
|
||||
LINXY (__NR_keyctl, sys_keyctl),
|
||||
PLAX_ (__NR_set_thread_area, sys_set_thread_area),
|
||||
- LINX_ (__NR_inotify_init, sys_inotify_init),
|
||||
+ LINXY (__NR_inotify_init, sys_inotify_init),
|
||||
LINX_ (__NR_inotify_add_watch, sys_inotify_add_watch),
|
||||
LINX_ (__NR_inotify_rm_watch, sys_inotify_rm_watch),
|
||||
LINXY (__NR_openat, sys_openat),
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
index 0aabfbb179ec..74ba68564cd8 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
@@ -944,7 +944,7 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_ioprio_set, sys_ioprio_set), // 273
|
||||
LINX_(__NR_ioprio_get, sys_ioprio_get), // 274
|
||||
|
||||
- LINX_(__NR_inotify_init, sys_inotify_init), // 275
|
||||
+ LINXY(__NR_inotify_init, sys_inotify_init), // 275
|
||||
LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 276
|
||||
LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277
|
||||
PLAXY(__NR_spu_run, sys_spu_run), // 278
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
index 35e3f8ec4ee4..4609e10df363 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
@@ -928,7 +928,7 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_ioprio_set, sys_ioprio_set), // 273
|
||||
LINX_(__NR_ioprio_get, sys_ioprio_get), // 274
|
||||
|
||||
- LINX_(__NR_inotify_init, sys_inotify_init), // 275
|
||||
+ LINXY(__NR_inotify_init, sys_inotify_init), // 275
|
||||
LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 276
|
||||
LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
index f941bdd1907a..9ed2fa46888f 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
@@ -751,7 +751,7 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_waitid, sys_waitid), // 281
|
||||
LINX_(__NR_ioprio_set, sys_ioprio_set), // 282
|
||||
LINX_(__NR_ioprio_get, sys_ioprio_get), // 283
|
||||
- LINX_(__NR_inotify_init, sys_inotify_init), // 284
|
||||
+ LINXY(__NR_inotify_init, sys_inotify_init), // 284
|
||||
|
||||
LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 285
|
||||
LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 286
|
||||
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
index c6cf682e797c..ea930bafe3ec 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
@@ -1508,7 +1508,7 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINX_(__NR_ioprio_set, sys_ioprio_set), // 289
|
||||
|
||||
LINX_(__NR_ioprio_get, sys_ioprio_get), // 290
|
||||
- LINX_(__NR_inotify_init, sys_inotify_init), // 291
|
||||
+ LINXY(__NR_inotify_init, sys_inotify_init), // 291
|
||||
LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 292
|
||||
LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 293
|
||||
// LINX_(__NR_migrate_pages, sys_migrate_pages), // 294
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 7e79bb6e6b80eb43138cbbb64737433f9e036cd4 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Thu, 21 Nov 2024 08:44:04 +0100
|
||||
Subject: [PATCH 04/11] regtest: add a fdleak filter for write on write on
|
||||
linux arm64
|
||||
|
||||
(cherry picked from commit 9150b3c7cfad2fdbeb7cf707175c359ee12d8f75)
|
||||
---
|
||||
none/tests/filter_fdleak | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/none/tests/filter_fdleak b/none/tests/filter_fdleak
|
||||
index d26937bccd38..72923aa730c8 100755
|
||||
--- a/none/tests/filter_fdleak
|
||||
+++ b/none/tests/filter_fdleak
|
||||
@@ -19,6 +19,8 @@ perl -p -e 's/socket\.c:[1-9][0-9]*/in \/...libc.../' |
|
||||
# arm systems substitute open for creat
|
||||
perl -p -e 's/open \(open64\.c:[1-9][0-9]*\)/creat (in \/...libc...)/' |
|
||||
perl -p -e "s/: open \(/: creat (/" |
|
||||
+# arm64 write resolved to file:line with debuginfo
|
||||
+perl -p -e "s/write\.c:[1-9][0-9]*/in \/...libc.../" |
|
||||
|
||||
# FreeBSD specific fdleak filters
|
||||
perl -p -e 's/ _close / close /;s/ _openat / creat /;s/internet/AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:.../' |
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,491 @@
|
||||
From ba15b8fe7d6fabfb73424a616de18a752a56430a Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat, 23 Nov 2024 21:28:13 +0100
|
||||
Subject: [PATCH 05/11] Add exp and supp patterns for missing main frame for
|
||||
ppc64le
|
||||
|
||||
In some cases on ppc64le we are missing the main frame.
|
||||
Add alternative .exp-ppc64le variants for socket_close_xml,
|
||||
fdleak_cmsg_xml and fdleak_ipv4_xml. And extra suppressions
|
||||
without a main frame for fdleak_cmsg_supp.
|
||||
|
||||
See also commit 04d30049b "Filter away "main" differences in filter_fdleak"
|
||||
|
||||
(cherry picked from commit e6960c2e41b103ab8d393cbe13dc6473fb89bffc)
|
||||
---
|
||||
none/tests/fdleak_cmsg_supp.supp | 47 ++++++
|
||||
none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le | 147 ++++++++++++++++++
|
||||
none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le | 139 +++++++++++++++++
|
||||
.../tests/socket_close_xml.stderr.exp-ppc64le | 98 ++++++++++++
|
||||
4 files changed, 431 insertions(+)
|
||||
create mode 100644 none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le
|
||||
create mode 100644 none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le
|
||||
create mode 100644 none/tests/socket_close_xml.stderr.exp-ppc64le
|
||||
|
||||
diff --git a/none/tests/fdleak_cmsg_supp.supp b/none/tests/fdleak_cmsg_supp.supp
|
||||
index 92fbacabdb78..a169fd888bcc 100644
|
||||
--- a/none/tests/fdleak_cmsg_supp.supp
|
||||
+++ b/none/tests/fdleak_cmsg_supp.supp
|
||||
@@ -12,6 +12,13 @@
|
||||
fun:server
|
||||
fun:main
|
||||
}
|
||||
+{
|
||||
+ sup2-ppc64le
|
||||
+ CoreError:FdNotClosed
|
||||
+ fun:socket
|
||||
+ fun:server
|
||||
+ #fun:main
|
||||
+}
|
||||
{
|
||||
sup3
|
||||
CoreError:FdNotClosed
|
||||
@@ -42,3 +49,43 @@
|
||||
fun:client
|
||||
fun:main
|
||||
}
|
||||
+{
|
||||
+ sup6-ppc64le
|
||||
+ CoreError:FdNotClosed
|
||||
+ fun:socket
|
||||
+ fun:client
|
||||
+ #fun:main
|
||||
+}
|
||||
+{
|
||||
+ sup7
|
||||
+ CoreError:FdNotClosed
|
||||
+ fun:_so_socket
|
||||
+ fun:__xnet_socket
|
||||
+ fun:client
|
||||
+ fun:main
|
||||
+}
|
||||
+{
|
||||
+ sup8
|
||||
+ CoreError:FdNotClosed
|
||||
+ fun:__so_recvmsg
|
||||
+ fun:__xnet_recvmsg
|
||||
+ fun:client
|
||||
+ fun:main
|
||||
+}
|
||||
+{
|
||||
+ sup9
|
||||
+ CoreError:FdNotClosed
|
||||
+ fun:_so_socket
|
||||
+ fun:__xnet_socket
|
||||
+ fun:server
|
||||
+ fun:main
|
||||
+}
|
||||
+{
|
||||
+ sup10
|
||||
+ CoreError:FdNotClosed
|
||||
+ fun:__so_accept
|
||||
+ fun:accept
|
||||
+ fun:server
|
||||
+ fun:main
|
||||
+}
|
||||
+
|
||||
diff --git a/none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le b/none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le
|
||||
new file mode 100644
|
||||
index 000000000000..6294094eb92e
|
||||
--- /dev/null
|
||||
+++ b/none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le
|
||||
@@ -0,0 +1,147 @@
|
||||
+<?xml version="1.0"?>
|
||||
+
|
||||
+<valgrindoutput>
|
||||
+
|
||||
+<protocolversion>5</protocolversion>
|
||||
+<protocoltool>none</protocoltool>
|
||||
+
|
||||
+<preamble>
|
||||
+ <line>Nulgrind, the minimal Valgrind tool</line>
|
||||
+ <line>Copyright...</line>
|
||||
+ <line>Using Valgrind...</line>
|
||||
+ <line>Command: ./fdleak_cmsg</line>
|
||||
+</preamble>
|
||||
+
|
||||
+<pid>...</pid>
|
||||
+<ppid>...</ppid>
|
||||
+<tool>none</tool>
|
||||
+
|
||||
+<args>
|
||||
+ <vargv>
|
||||
+ <exe>...</exe>
|
||||
+ <arg>--command-line-only=yes</arg>
|
||||
+ <arg>--memcheck:leak-check=no</arg>
|
||||
+ <arg>--tool=none</arg>
|
||||
+ <arg>--track-fds=all</arg>
|
||||
+ <arg>--xml=yes</arg>
|
||||
+ <arg>--xml-fd=2</arg>
|
||||
+ <arg>--child-silent-after-fork=yes</arg>
|
||||
+ </vargv>
|
||||
+ <argv>
|
||||
+ <exe>...</exe>
|
||||
+ </argv>
|
||||
+</args>
|
||||
+
|
||||
+<status>
|
||||
+ <state>RUNNING</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+
|
||||
+<status>
|
||||
+ <state>FINISHED</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>5</fd>
|
||||
+ <path>...</path>
|
||||
+ <what>...</what>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_cmsg.c</file>
|
||||
+ <line>133</line>
|
||||
+ </frame>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_cmsg.c</file>
|
||||
+ <line>174</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+</error>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>4</fd>
|
||||
+ <path>...</path>
|
||||
+ <what>...</what>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_cmsg.c</file>
|
||||
+ <line>133</line>
|
||||
+ </frame>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_cmsg.c</file>
|
||||
+ <line>174</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+</error>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>3</fd>
|
||||
+ <what>...</what>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_cmsg.c</file>
|
||||
+ <line>112</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+</error>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>2</fd>
|
||||
+ <path>...</path>
|
||||
+ <what>...</what>
|
||||
+</error>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>1</fd>
|
||||
+ <path>...</path>
|
||||
+ <what>...</what>
|
||||
+</error>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>0</fd>
|
||||
+ <path>...</path>
|
||||
+ <what>...</what>
|
||||
+</error>
|
||||
+
|
||||
+
|
||||
+</valgrindoutput>
|
||||
+
|
||||
diff --git a/none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le b/none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le
|
||||
new file mode 100644
|
||||
index 000000000000..df413b62895c
|
||||
--- /dev/null
|
||||
+++ b/none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le
|
||||
@@ -0,0 +1,139 @@
|
||||
+<?xml version="1.0"?>
|
||||
+
|
||||
+<valgrindoutput>
|
||||
+
|
||||
+<protocolversion>5</protocolversion>
|
||||
+<protocoltool>none</protocoltool>
|
||||
+
|
||||
+<preamble>
|
||||
+ <line>Nulgrind, the minimal Valgrind tool</line>
|
||||
+ <line>Copyright...</line>
|
||||
+ <line>Using Valgrind...</line>
|
||||
+ <line>Command: ./fdleak_ipv4</line>
|
||||
+</preamble>
|
||||
+
|
||||
+<pid>...</pid>
|
||||
+<ppid>...</ppid>
|
||||
+<tool>none</tool>
|
||||
+
|
||||
+<args>
|
||||
+ <vargv>
|
||||
+ <exe>...</exe>
|
||||
+ <arg>--command-line-only=yes</arg>
|
||||
+ <arg>--memcheck:leak-check=no</arg>
|
||||
+ <arg>--tool=none</arg>
|
||||
+ <arg>--track-fds=yes</arg>
|
||||
+ <arg>--xml=yes</arg>
|
||||
+ <arg>--xml-fd=2</arg>
|
||||
+ <arg>--child-silent-after-fork=yes</arg>
|
||||
+ </vargv>
|
||||
+ <argv>
|
||||
+ <exe>...</exe>
|
||||
+ </argv>
|
||||
+</args>
|
||||
+
|
||||
+<status>
|
||||
+ <state>RUNNING</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdBadClose</kind>
|
||||
+ <fd>4</fd>
|
||||
+ <what>...</what>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>70</line>
|
||||
+ </frame>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>90</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+ <auxwhat>Previously closed</auxwhat>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>69</line>
|
||||
+ </frame>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>90</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+ <auxwhat>Originally opened</auxwhat>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>68</line>
|
||||
+ </frame>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>90</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+</error>
|
||||
+
|
||||
+
|
||||
+<status>
|
||||
+ <state>FINISHED</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdNotClosed</kind>
|
||||
+ <fd>3</fd>
|
||||
+ <what>...</what>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>client</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>fdleak_ipv4.c</file>
|
||||
+ <line>51</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+</error>
|
||||
+
|
||||
+<errorcounts>
|
||||
+ <pair>
|
||||
+ <count>1</count>
|
||||
+ <unique>0x........</unique>
|
||||
+ </pair>
|
||||
+</errorcounts>
|
||||
+
|
||||
+<suppcounts>
|
||||
+</suppcounts>
|
||||
+
|
||||
+</valgrindoutput>
|
||||
+
|
||||
diff --git a/none/tests/socket_close_xml.stderr.exp-ppc64le b/none/tests/socket_close_xml.stderr.exp-ppc64le
|
||||
new file mode 100644
|
||||
index 000000000000..2f2bc9831e79
|
||||
--- /dev/null
|
||||
+++ b/none/tests/socket_close_xml.stderr.exp-ppc64le
|
||||
@@ -0,0 +1,98 @@
|
||||
+<?xml version="1.0"?>
|
||||
+
|
||||
+<valgrindoutput>
|
||||
+
|
||||
+<protocolversion>5</protocolversion>
|
||||
+<protocoltool>none</protocoltool>
|
||||
+
|
||||
+<preamble>
|
||||
+ <line>Nulgrind, the minimal Valgrind tool</line>
|
||||
+ <line>Copyright...</line>
|
||||
+ <line>Using Valgrind...</line>
|
||||
+ <line>Command: ./socket_close</line>
|
||||
+</preamble>
|
||||
+
|
||||
+<pid>...</pid>
|
||||
+<ppid>...</ppid>
|
||||
+<tool>none</tool>
|
||||
+
|
||||
+<args>
|
||||
+ <vargv>
|
||||
+ <exe>...</exe>
|
||||
+ <arg>--command-line-only=yes</arg>
|
||||
+ <arg>--memcheck:leak-check=no</arg>
|
||||
+ <arg>--tool=none</arg>
|
||||
+ <arg>-q</arg>
|
||||
+ <arg>--track-fds=yes</arg>
|
||||
+ <arg>--xml=yes</arg>
|
||||
+ <arg>--xml-fd=2</arg>
|
||||
+ </vargv>
|
||||
+ <argv>
|
||||
+ <exe>...</exe>
|
||||
+ </argv>
|
||||
+</args>
|
||||
+
|
||||
+<status>
|
||||
+ <state>RUNNING</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+Open socket 3
|
||||
+close socket_fd 3
|
||||
+and close the socket again 3
|
||||
+<error>
|
||||
+ <unique>0x........</unique>
|
||||
+ <tid>...</tid>
|
||||
+ <kind>FdBadClose</kind>
|
||||
+ <fd>3</fd>
|
||||
+ <what>...</what>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>socket_close.c</file>
|
||||
+ <line>40</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+ <auxwhat>Previously closed</auxwhat>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>main</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>socket_close.c</file>
|
||||
+ <line>36</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+ <auxwhat>Originally opened</auxwhat>
|
||||
+ <stack>
|
||||
+ <frame>
|
||||
+ <ip>0x........</ip>
|
||||
+ <obj>...</obj>
|
||||
+ <fn>open_socket</fn>
|
||||
+ <dir>...</dir>
|
||||
+ <file>socket_close.c</file>
|
||||
+ <line>17</line>
|
||||
+ </frame>
|
||||
+ </stack>
|
||||
+</error>
|
||||
+
|
||||
+
|
||||
+<status>
|
||||
+ <state>FINISHED</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+<errorcounts>
|
||||
+ <pair>
|
||||
+ <count>1</count>
|
||||
+ <unique>0x........</unique>
|
||||
+ </pair>
|
||||
+</errorcounts>
|
||||
+
|
||||
+
|
||||
+</valgrindoutput>
|
||||
+
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,282 +0,0 @@
|
||||
From f5d1c336e9276dd5947ef94c9831d9d53673b75b Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Thu, 9 May 2024 21:01:52 +0200
|
||||
Subject: [PATCH 05/11] aarch64 frinta and frinta vector instructions
|
||||
|
||||
The initial fix for Bug 484426 only corrected frinta and frintn
|
||||
scalar instructions. This adds support for the vector variants.
|
||||
|
||||
(cherry picked from commit 7b66a5b58219ac1a4865da8e371edbdb8d765f32)
|
||||
---
|
||||
NEWS | 1 +
|
||||
VEX/priv/guest_arm64_toIR.c | 47 ++++++----
|
||||
none/tests/arm64/frinta_frintn.cpp | 141 +++++++++++++++++++++++++++++
|
||||
3 files changed, 171 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index b65f9206679b..adb52169dd87 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
486293 memccpy false positives
|
||||
486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
+n-i-bz aarch64 frinta and frinta vector instructions
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c
|
||||
index c7e395b4b63d..27d945d6328d 100644
|
||||
--- a/VEX/priv/guest_arm64_toIR.c
|
||||
+++ b/VEX/priv/guest_arm64_toIR.c
|
||||
@@ -13821,46 +13821,57 @@ Bool dis_AdvSIMD_two_reg_misc(/*MB_OUT*/DisResult* dres, UInt insn)
|
||||
/* -------- 1,1x,11000 (apparently unassigned) (7) -------- */
|
||||
/* -------- 1,1x,11001 FRINTI 2d_2d, 4s_4s, 2s_2s (8) -------- */
|
||||
/* rm plan:
|
||||
- FRINTN: tieeven -- !! FIXME KLUDGED !!
|
||||
+ FRINTN: tieeven
|
||||
FRINTM: -inf
|
||||
FRINTP: +inf
|
||||
FRINTZ: zero
|
||||
- FRINTA: tieaway -- !! FIXME KLUDGED !!
|
||||
+ FRINTA: tieaway
|
||||
FRINTX: per FPCR + "exact = TRUE"
|
||||
FRINTI: per FPCR
|
||||
*/
|
||||
Bool isD = (size & 1) == 1;
|
||||
if (bitQ == 0 && isD) return False; // implied 1d case
|
||||
|
||||
- IRTemp irrmRM = mk_get_IR_rounding_mode();
|
||||
-
|
||||
- UChar ch = '?';
|
||||
- IRTemp irrm = newTemp(Ity_I32);
|
||||
+ UChar ch = '?';
|
||||
+ IROp op = isD ? Iop_RoundF64toInt : Iop_RoundF32toInt;
|
||||
+ Bool isBinop = True;
|
||||
+ IRExpr* irrmE = NULL;
|
||||
switch (ix) {
|
||||
- case 1: ch = 'n'; assign(irrm, mkU32(Irrm_NEAREST)); break;
|
||||
- case 2: ch = 'm'; assign(irrm, mkU32(Irrm_NegINF)); break;
|
||||
- case 3: ch = 'p'; assign(irrm, mkU32(Irrm_PosINF)); break;
|
||||
- case 4: ch = 'z'; assign(irrm, mkU32(Irrm_ZERO)); break;
|
||||
+ case 1: ch = 'n'; isBinop = False; op = isD ? Iop_RoundF64toIntE : Iop_RoundF32toIntE; break;
|
||||
+ case 2: ch = 'm'; irrmE = mkU32(Irrm_NegINF); break;
|
||||
+ case 3: ch = 'p'; irrmE = mkU32(Irrm_PosINF); break;
|
||||
+ case 4: ch = 'z'; irrmE = mkU32(Irrm_ZERO); break;
|
||||
// The following is a kludge. Should be: Irrm_NEAREST_TIE_AWAY_0
|
||||
- case 5: ch = 'a'; assign(irrm, mkU32(Irrm_NEAREST)); break;
|
||||
+ case 5: ch = 'a'; isBinop = False; op = isD ? Iop_RoundF64toIntA0 : Iop_RoundF32toIntA0; break;
|
||||
// I am unsure about the following, due to the "integral exact"
|
||||
// description in the manual. What does it mean? (frintx, that is)
|
||||
- case 6: ch = 'x'; assign(irrm, mkexpr(irrmRM)); break;
|
||||
- case 8: ch = 'i'; assign(irrm, mkexpr(irrmRM)); break;
|
||||
+ case 6: ch = 'x'; irrmE = mkexpr(mk_get_IR_rounding_mode()); break;
|
||||
+ case 8: ch = 'i'; irrmE = mkexpr(mk_get_IR_rounding_mode()); break;
|
||||
default: vassert(0);
|
||||
}
|
||||
|
||||
- IROp opRND = isD ? Iop_RoundF64toInt : Iop_RoundF32toInt;
|
||||
if (isD) {
|
||||
for (UInt i = 0; i < 2; i++) {
|
||||
- putQRegLane(dd, i, binop(opRND, mkexpr(irrm),
|
||||
- getQRegLane(nn, i, Ity_F64)));
|
||||
+ if (isBinop) {
|
||||
+ IRTemp irrm = newTemp(Ity_I32);
|
||||
+ assign(irrm, irrmE);
|
||||
+ putQRegLane(dd, i, binop(op, mkexpr(irrm),
|
||||
+ getQRegLane(nn, i, Ity_F64)));
|
||||
+ } else {
|
||||
+ putQRegLane(dd, i, unop(op, getQRegLane(nn, i, Ity_F64)));
|
||||
+ }
|
||||
}
|
||||
} else {
|
||||
UInt n = bitQ==1 ? 4 : 2;
|
||||
for (UInt i = 0; i < n; i++) {
|
||||
- putQRegLane(dd, i, binop(opRND, mkexpr(irrm),
|
||||
- getQRegLane(nn, i, Ity_F32)));
|
||||
+ if (isBinop) {
|
||||
+ IRTemp irrm = newTemp(Ity_I32);
|
||||
+ assign(irrm, irrmE);
|
||||
+ putQRegLane(dd, i, binop(op, mkexpr(irrm),
|
||||
+ getQRegLane(nn, i, Ity_F32)));
|
||||
+ } else {
|
||||
+ putQRegLane(dd, i, unop(op, getQRegLane(nn, i, Ity_F32)));
|
||||
+ }
|
||||
}
|
||||
if (bitQ == 0)
|
||||
putQRegLane(dd, 1, mkU64(0)); // zero out lanes 2 and 3
|
||||
diff --git a/none/tests/arm64/frinta_frintn.cpp b/none/tests/arm64/frinta_frintn.cpp
|
||||
index 8e13761eb966..c0803688f698 100644
|
||||
--- a/none/tests/arm64/frinta_frintn.cpp
|
||||
+++ b/none/tests/arm64/frinta_frintn.cpp
|
||||
@@ -36,6 +36,55 @@ void test_frinta(T input, T expected)
|
||||
}
|
||||
}
|
||||
|
||||
+template<typename T>
|
||||
+void test_frinta_fullvec(T* input, T* expected)
|
||||
+{
|
||||
+ T result[2*sizeof(double)/sizeof(T)];
|
||||
+ T* rp = result;
|
||||
+ if constexpr (std::is_same_v<double, T> == true)
|
||||
+ {
|
||||
+ __asm__ __volatile__(
|
||||
+ "ldr q23, [%1];\n"
|
||||
+ "frinta v22.2d, v23.2d;\n"
|
||||
+ "str q22, [%0];\n"
|
||||
+ : "+rm" (rp)
|
||||
+ : "r" (input)
|
||||
+ : "memory", "v22", "v23");
|
||||
+ assert(result[0] == expected[0]);
|
||||
+ assert(result[1] == expected[1]);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ __asm__ __volatile__(
|
||||
+ "ldr q23, [%1];\n"
|
||||
+ "frinta v22.4s, v23.4s;\n"
|
||||
+ "str q22, [%0];\n"
|
||||
+ : "+rm" (rp)
|
||||
+ : "r" (input)
|
||||
+ : "memory", "v22", "v23");
|
||||
+ assert(result[0] == expected[0]);
|
||||
+ assert(result[1] == expected[1]);
|
||||
+ assert(result[2] == expected[2]);
|
||||
+ assert(result[3] == expected[3]);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void test_frinta_halfvec(float* input, float* expected)
|
||||
+{
|
||||
+ float result[2];
|
||||
+ float* rp = result;
|
||||
+ __asm__ __volatile__(
|
||||
+ "ldr d23, [%1];\n"
|
||||
+ "frinta v22.2s, v23.2s;\n"
|
||||
+ "str d22, [%0];\n"
|
||||
+ : "+rm" (rp)
|
||||
+ : "r" (input)
|
||||
+ : "memory", "v22", "v23");
|
||||
+ assert(result[0] == expected[0]);
|
||||
+ assert(result[1] == expected[1]);
|
||||
+}
|
||||
+
|
||||
+
|
||||
template<typename T>
|
||||
void test_frintn(T input, T expected)
|
||||
{
|
||||
@@ -66,6 +115,54 @@ void test_frintn(T input, T expected)
|
||||
}
|
||||
}
|
||||
|
||||
+template<typename T>
|
||||
+void test_frintn_fullvec(T* input, T* expected)
|
||||
+{
|
||||
+ T result[2*sizeof(double)/sizeof(T)];
|
||||
+ T* rp = result;
|
||||
+ if constexpr (std::is_same_v<double, T> == true)
|
||||
+ {
|
||||
+ __asm__ __volatile__(
|
||||
+ "ldr q23, [%1];\n"
|
||||
+ "frintn v22.2d, v23.2d;\n"
|
||||
+ "str q22, [%0];\n"
|
||||
+ : "+rm" (rp)
|
||||
+ : "r" (input)
|
||||
+ : "memory", "v22", "v23");
|
||||
+ assert(result[0] == expected[0]);
|
||||
+ assert(result[1] == expected[1]);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ __asm__ __volatile__(
|
||||
+ "ldr q23, [%1];\n"
|
||||
+ "frintn v22.4s, v23.4s;\n"
|
||||
+ "str q22, [%0];\n"
|
||||
+ : "+rm" (rp)
|
||||
+ : "r" (input)
|
||||
+ : "memory", "v22", "v23");
|
||||
+ assert(result[0] == expected[0]);
|
||||
+ assert(result[1] == expected[1]);
|
||||
+ assert(result[2] == expected[2]);
|
||||
+ assert(result[3] == expected[3]);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void test_frintn_halfvec(float* input, float* expected)
|
||||
+{
|
||||
+ float result[2];
|
||||
+ float* rp = result;
|
||||
+ __asm__ __volatile__(
|
||||
+ "ldr d23, [%1];\n"
|
||||
+ "frintn v22.2s, v23.2s;\n"
|
||||
+ "str d22, [%0];\n"
|
||||
+ : "+rm" (rp)
|
||||
+ : "r" (input)
|
||||
+ : "memory", "v22", "v23");
|
||||
+ assert(result[0] == expected[0]);
|
||||
+ assert(result[1] == expected[1]);
|
||||
+}
|
||||
+
|
||||
int main()
|
||||
{
|
||||
// round "away from zero"
|
||||
@@ -78,6 +175,36 @@ int main()
|
||||
test_frinta(-1.5F, -2.0F);
|
||||
test_frinta(-2.5F, -3.0F);
|
||||
|
||||
+ double in1[] = {1.5, 1.5};
|
||||
+ double out1[] = {2.0, 2,0};
|
||||
+ test_frinta_fullvec(in1, out1);
|
||||
+ double in2[] = {2.5, 2.5};
|
||||
+ double out2[] = {3.0, 3,0};
|
||||
+ test_frinta_fullvec(in2, out2);
|
||||
+ double in3[] = {-1.5, -1.5};
|
||||
+ double out3[] = {-2.0, -2,0};
|
||||
+ test_frinta_fullvec(in3, out3);
|
||||
+ double in4[] = {-2.5, -2.5};
|
||||
+ double out4[] = {-3.0, -3,0};
|
||||
+ test_frinta_fullvec(in4, out4);
|
||||
+
|
||||
+ float in1f[] = {1.5F, 1.5F, 1.5F, 1.5F};
|
||||
+ float out1f[] = {2.0F, 2.0F, 2.0F, 2.0F};
|
||||
+ test_frinta_fullvec(in1f, out1f);
|
||||
+ test_frinta_halfvec(in1f, out1f);
|
||||
+ float in2f[] = {2.5F, 2.5F, 2.5F, 2.5F};
|
||||
+ float out2f[] = {3.0F, 3.0F, 3.0F, 3.0F};
|
||||
+ test_frinta_fullvec(in2f, out2f);
|
||||
+ test_frinta_halfvec(in2f, out2f);
|
||||
+ float in3f[] = {-1.5F, -1.5F, -1.5F, -1.5F};
|
||||
+ float out3f[] = {-2.0F, -2.0F, -2.0F, -2.0F};
|
||||
+ test_frinta_fullvec(in3f, out3f);
|
||||
+ test_frinta_halfvec(in3f, out3f);
|
||||
+ float in4f[] = {-2.5F, -2.5F, -2.5F, -2.5F};
|
||||
+ float out4f[] = {-3.0F, -3.0F, -3.0F, -3.0F};
|
||||
+ test_frinta_fullvec(in4f, out4f);
|
||||
+ test_frinta_halfvec(in4f, out4f);
|
||||
+
|
||||
// round "to even"
|
||||
test_frintn(1.5, 2.0);
|
||||
test_frintn(2.5, 2.0);
|
||||
@@ -87,5 +214,19 @@ int main()
|
||||
test_frintn(2.5F, 2.0F);
|
||||
test_frintn(-1.5F, -2.0F);
|
||||
test_frintn(-2.5F, -2.0F);
|
||||
+
|
||||
+ test_frintn_fullvec(in1, out1);
|
||||
+ test_frintn_fullvec(in2, out1);
|
||||
+ test_frintn_fullvec(in3, out3);
|
||||
+ test_frintn_fullvec(in4, out3);
|
||||
+
|
||||
+ test_frintn_fullvec(in1f, out1f);
|
||||
+ test_frintn_halfvec(in1f, out1f);
|
||||
+ test_frintn_fullvec(in2f, out1f);
|
||||
+ test_frintn_halfvec(in2f, out1f);
|
||||
+ test_frintn_fullvec(in3f, out3f);
|
||||
+ test_frintn_halfvec(in3f, out3f);
|
||||
+ test_frintn_fullvec(in4f, out3f);
|
||||
+ test_frintn_halfvec(in4f, out3f);
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 42f196574aebea451c7e4138b476e042ba302745 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Sun, 24 Nov 2024 08:10:51 +0100
|
||||
Subject: [PATCH 06/11] Add additional exp-ppc64le files to EXTRA_DIST
|
||||
|
||||
(cherry picked from commit 7241959ebb88a588eebe5a9fd35d1642db71474b)
|
||||
---
|
||||
none/tests/Makefile.am | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
|
||||
index 59be79e57920..53a6e1f6bc95 100644
|
||||
--- a/none/tests/Makefile.am
|
||||
+++ b/none/tests/Makefile.am
|
||||
@@ -135,6 +135,7 @@ EXTRA_DIST = \
|
||||
faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \
|
||||
fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \
|
||||
fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \
|
||||
+ fdleak_cmsg_xml.stderr.exp-ppc64le \
|
||||
fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \
|
||||
fdleak_cmsg_supp.stderr.exp fdleak_cmsg_supp.supp \
|
||||
fdleak_cmsg_supp.vgtest \
|
||||
@@ -149,6 +150,7 @@ EXTRA_DIST = \
|
||||
fdleak_fcntl.stderr.exp fdleak_fcntl.vgtest \
|
||||
fdleak_fcntl_xml.stderr.exp fdleak_fcntl_xml.vgtest \
|
||||
fdleak_ipv4.stderr.exp fdleak_ipv4.stdout.exp fdleak_ipv4.vgtest \
|
||||
+ fdleak_ipv4_xml.stderr.exp-ppc64le \
|
||||
fdleak_ipv4_xml.stderr.exp fdleak_ipv4_xml.stdout.exp \
|
||||
fdleak_ipv4_xml.vgtest fdleak_ipv4_xml.stderr.exp-nomain \
|
||||
fdleak_open.stderr.exp fdleak_open.vgtest \
|
||||
@@ -248,6 +250,7 @@ EXTRA_DIST = \
|
||||
process_vm_readv_writev.stderr.exp process_vm_readv_writev.vgtest \
|
||||
sigprocmask.stderr.exp sigprocmask.vgtest \
|
||||
socket_close.stderr.exp socket_close.vgtest \
|
||||
+ socket_close_xml.stderr.exp-ppc64le \
|
||||
socket_close_xml.stderr.exp socket_close_xml.vgtest \
|
||||
file_dclose.stderr.exp file_dclose.vgtest \
|
||||
file_dclose_xml.stderr.exp file_dclose_xml.vgtest \
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,169 +0,0 @@
|
||||
From 726f930355ca74b4aa4c656979224c9b7a706244 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksandar Rikalo <arikalo@gmail.com>
|
||||
Date: Fri, 10 May 2024 17:59:28 +0200
|
||||
Subject: [PATCH 06/11] mips: skip using shared syscall numbers for mips32
|
||||
|
||||
mips does not use shared syscall numbers, so we can not use
|
||||
vki-scnums-shared-linux.h.
|
||||
|
||||
This partially fixes KDE #444781.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
|
||||
(cherry picked from commit 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba)
|
||||
---
|
||||
coregrind/m_syswrap/syswrap-mips32-linux.c | 1 +
|
||||
include/pub_tool_vkiscnums_asm.h | 2 -
|
||||
include/vki/vki-scnums-mips32-linux.h | 105 ++++++++++++++++-----
|
||||
3 files changed, 83 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
index e2f499eb80f8..e3498cd96f9b 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
@@ -1110,6 +1110,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINX_ (__NR_pwritev2, sys_pwritev2), // 362
|
||||
//..
|
||||
LINXY(__NR_statx, sys_statx), // 366
|
||||
+ GENX_(__NR_rseq, sys_ni_syscall), // 367
|
||||
|
||||
LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403
|
||||
LINX_(__NR_clock_settime64, sys_clock_settime64), // 404
|
||||
diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h
|
||||
index 8a26f834a93e..d3d7dc19be9d 100644
|
||||
--- a/include/pub_tool_vkiscnums_asm.h
|
||||
+++ b/include/pub_tool_vkiscnums_asm.h
|
||||
@@ -63,8 +63,6 @@
|
||||
# include "vki/vki-scnums-arm64-linux.h"
|
||||
|
||||
#elif defined(VGP_mips32_linux)
|
||||
-# include "vki/vki-scnums-shared-linux.h"
|
||||
-# include "vki/vki-scnums-32bit-linux.h"
|
||||
# include "vki/vki-scnums-mips32-linux.h"
|
||||
|
||||
#elif defined(VGP_nanomips_linux)
|
||||
diff --git a/include/vki/vki-scnums-mips32-linux.h b/include/vki/vki-scnums-mips32-linux.h
|
||||
index e452a2e6c8d0..d4f8de15aac7 100644
|
||||
--- a/include/vki/vki-scnums-mips32-linux.h
|
||||
+++ b/include/vki/vki-scnums-mips32-linux.h
|
||||
@@ -380,35 +380,94 @@
|
||||
#define __NR_setns (__NR_Linux + 343)
|
||||
#define __NR_process_vm_readv (__NR_Linux + 345)
|
||||
#define __NR_process_vm_writev (__NR_Linux + 346)
|
||||
-#define __NR_kcmp (__NR_Linux + 347)
|
||||
-#define __NR_finit_module (__NR_Linux + 348)
|
||||
-#define __NR_sched_setattr (__NR_Linux + 349)
|
||||
-#define __NR_sched_getattr (__NR_Linux + 350)
|
||||
-#define __NR_renameat2 (__NR_Linux + 351)
|
||||
-#define __NR_seccomp (__NR_Linux + 352)
|
||||
-#define __NR_getrandom (__NR_Linux + 353)
|
||||
-#define __NR_memfd_create (__NR_Linux + 354)
|
||||
-#define __NR_bpf (__NR_Linux + 355)
|
||||
-#define __NR_execveat (__NR_Linux + 356)
|
||||
-#define __NR_userfaultfd (__NR_Linux + 357)
|
||||
-#define __NR_membarrier (__NR_Linux + 358)
|
||||
-#define __NR_mlock2 (__NR_Linux + 359)
|
||||
-#define __NR_copy_file_range (__NR_Linux + 360)
|
||||
-#define __NR_preadv2 (__NR_Linux + 361)
|
||||
-#define __NR_pwritev2 (__NR_Linux + 362)
|
||||
-#define __NR_pkey_mprotect (__NR_Linux + 363)
|
||||
-#define __NR_pkey_alloc (__NR_Linux + 364)
|
||||
-#define __NR_pkey_free (__NR_Linux + 365)
|
||||
-#define __NR_statx (__NR_Linux + 366)
|
||||
-
|
||||
+#define __NR_kcmp (__NR_Linux + 347)
|
||||
+#define __NR_finit_module (__NR_Linux + 348)
|
||||
+#define __NR_sched_setattr (__NR_Linux + 349)
|
||||
+#define __NR_sched_getattr (__NR_Linux + 350)
|
||||
+#define __NR_renameat2 (__NR_Linux + 351)
|
||||
+#define __NR_seccomp (__NR_Linux + 352)
|
||||
+#define __NR_getrandom (__NR_Linux + 353)
|
||||
+#define __NR_memfd_create (__NR_Linux + 354)
|
||||
+#define __NR_bpf (__NR_Linux + 355)
|
||||
+#define __NR_execveat (__NR_Linux + 356)
|
||||
+#define __NR_userfaultfd (__NR_Linux + 357)
|
||||
+#define __NR_membarrier (__NR_Linux + 358)
|
||||
+#define __NR_mlock2 (__NR_Linux + 359)
|
||||
+#define __NR_copy_file_range (__NR_Linux + 360)
|
||||
+#define __NR_preadv2 (__NR_Linux + 361)
|
||||
+#define __NR_pwritev2 (__NR_Linux + 362)
|
||||
+#define __NR_pkey_mprotect (__NR_Linux + 363)
|
||||
+#define __NR_pkey_alloc (__NR_Linux + 364)
|
||||
+#define __NR_pkey_free (__NR_Linux + 365)
|
||||
+#define __NR_statx (__NR_Linux + 366)
|
||||
+#define __NR_rseq (__NR_Linux + 367)
|
||||
+#define __NR_io_pgetevents (__NR_Linux + 368)
|
||||
+#define __NR_semget (__NR_Linux + 393)
|
||||
+#define __NR_semctl (__NR_Linux + 394)
|
||||
+#define __NR_shmget (__NR_Linux + 395)
|
||||
+#define __NR_shmctl (__NR_Linux + 396)
|
||||
+#define __NR_shmat (__NR_Linux + 397)
|
||||
+#define __NR_shmdt (__NR_Linux + 398)
|
||||
+#define __NR_msgget (__NR_Linux + 399)
|
||||
+#define __NR_msgsnd (__NR_Linux + 400)
|
||||
+#define __NR_msgrcv (__NR_Linux + 401)
|
||||
+#define __NR_msgctl (__NR_Linux + 402)
|
||||
+#define __NR_clock_gettime64 (__NR_Linux + 403)
|
||||
+#define __NR_clock_settime64 (__NR_Linux + 404)
|
||||
+#define __NR_clock_adjtime64 (__NR_Linux + 405)
|
||||
+#define __NR_clock_getres_time64 (__NR_Linux + 406)
|
||||
+#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
|
||||
+#define __NR_timer_gettime64 (__NR_Linux + 408)
|
||||
+#define __NR_timer_settime64 (__NR_Linux + 409)
|
||||
+#define __NR_timerfd_gettime64 (__NR_Linux + 410)
|
||||
+#define __NR_timerfd_settime64 (__NR_Linux + 411)
|
||||
+#define __NR_utimensat_time64 (__NR_Linux + 412)
|
||||
+#define __NR_pselect6_time64 (__NR_Linux + 413)
|
||||
+#define __NR_ppoll_time64 (__NR_Linux + 414)
|
||||
+#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
|
||||
+#define __NR_recvmmsg_time64 (__NR_Linux + 417)
|
||||
+#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
|
||||
+#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
|
||||
+#define __NR_semtimedop_time64 (__NR_Linux + 420)
|
||||
+#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
|
||||
+#define __NR_futex_time64 (__NR_Linux + 422)
|
||||
+#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
|
||||
+#define __NR_pidfd_send_signal (__NR_Linux + 424)
|
||||
+#define __NR_io_uring_setup (__NR_Linux + 425)
|
||||
+#define __NR_io_uring_enter (__NR_Linux + 426)
|
||||
+#define __NR_io_uring_register (__NR_Linux + 427)
|
||||
+#define __NR_open_tree (__NR_Linux + 428)
|
||||
+#define __NR_move_mount (__NR_Linux + 429)
|
||||
+#define __NR_fsopen (__NR_Linux + 430)
|
||||
+#define __NR_fsconfig (__NR_Linux + 431)
|
||||
+#define __NR_fsmount (__NR_Linux + 432)
|
||||
+#define __NR_fspick (__NR_Linux + 433)
|
||||
+#define __NR_pidfd_open (__NR_Linux + 434)
|
||||
+#define __NR_clone3 (__NR_Linux + 435)
|
||||
+#define __NR_close_range (__NR_Linux + 436)
|
||||
+#define __NR_openat2 (__NR_Linux + 437)
|
||||
+#define __NR_pidfd_getfd (__NR_Linux + 438)
|
||||
+#define __NR_faccessat2 (__NR_Linux + 439)
|
||||
+#define __NR_process_madvise (__NR_Linux + 440)
|
||||
+#define __NR_epoll_pwait2 (__NR_Linux + 441)
|
||||
+#define __NR_mount_setattr (__NR_Linux + 442)
|
||||
+#define __NR_quotactl_fd (__NR_Linux + 443)
|
||||
+#define __NR_landlock_create_ruleset (__NR_Linux + 444)
|
||||
+#define __NR_landlock_add_rule (__NR_Linux + 445)
|
||||
+#define __NR_landlock_restrict_self (__NR_Linux + 446)
|
||||
+#define __NR_process_mrelease (__NR_Linux + 448)
|
||||
+#define __NR_futex_waitv (__NR_Linux + 449)
|
||||
+#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
|
||||
+#define __NR_cachestat (__NR_Linux + 451)
|
||||
+#define __NR_fchmodat2 (__NR_Linux + 452)
|
||||
/*
|
||||
* Offset of the last Linux o32 flavoured syscall
|
||||
*/
|
||||
-#define __NR_Linux_syscalls 366
|
||||
+#define __NR_Linux_syscalls 366
|
||||
|
||||
|
||||
#define __NR_O32_Linux 4000
|
||||
-#define __NR_O32_Linux_syscalls 366
|
||||
+#define __NR_O32_Linux_syscalls 366
|
||||
|
||||
|
||||
#endif /* __VKI_SCNUMS_MIPS32_LINUX_H */
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,358 @@
|
||||
From 3d72dd780be97bd19331403da60908f295712fc7 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Seiderer <ps.report@gmx.net>
|
||||
Date: Mon, 8 Jul 2024 11:05:47 +0200
|
||||
Subject: [PATCH 07/11] Add support for landlock_create_ruleset (444),
|
||||
landlock_add_rule (445) and landlock_restrict_self (446) syscalls
|
||||
|
||||
- add support for landlock_create_ruleset (444) syscall
|
||||
- add support for landlock_add_rule (445) syscall
|
||||
- add support for landlock_restrict_self (446) syscall
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=489913
|
||||
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
|
||||
(cherry picked from commit b1453546fe7396e7d4b4b2fc8ec7e64b71d18611)
|
||||
---
|
||||
NEWS | 2 +
|
||||
coregrind/m_syswrap/priv_syswrap-linux.h | 5 ++
|
||||
coregrind/m_syswrap/syswrap-amd64-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-arm-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-arm64-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-linux.c | 48 ++++++++++++++++++++
|
||||
coregrind/m_syswrap/syswrap-mips32-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-mips64-linux.c | 5 +-
|
||||
coregrind/m_syswrap/syswrap-nanomips-linux.c | 3 ++
|
||||
coregrind/m_syswrap/syswrap-ppc32-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-ppc64-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-s390x-linux.c | 4 ++
|
||||
coregrind/m_syswrap/syswrap-x86-linux.c | 4 ++
|
||||
include/Makefile.am | 3 +-
|
||||
include/pub_tool_vki.h | 1 +
|
||||
include/vki/vki-linux-landlock.h | 37 +++++++++++++++
|
||||
include/vki/vki-scnums-shared-linux.h | 4 ++
|
||||
17 files changed, 138 insertions(+), 2 deletions(-)
|
||||
create mode 100644 include/vki/vki-linux-landlock.h
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 8362e1d2df41..68cd0c6fa603 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,6 +5,8 @@ Branch 3.24
|
||||
|
||||
The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
+489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset)
|
||||
+
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
where XXXXXX is the bug number as listed above.
|
||||
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
index d50cdcc981b9..221439a0ec33 100644
|
||||
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
@@ -328,6 +328,11 @@ DECL_TEMPLATE(linux, sys_pidfd_open);
|
||||
DECL_TEMPLATE(linux, sys_close_range);
|
||||
DECL_TEMPLATE(linux, sys_openat2);
|
||||
|
||||
+// Linux-specific (new in Linux 5.13)
|
||||
+DECL_TEMPLATE(linux, sys_landlock_create_ruleset)
|
||||
+DECL_TEMPLATE(linux, sys_landlock_add_rule)
|
||||
+DECL_TEMPLATE(linux, sys_landlock_restrict_self)
|
||||
+
|
||||
// Linux-specific (new in Linux 5.14)
|
||||
DECL_TEMPLATE(linux, sys_memfd_secret);
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
index 2230baf772b0..9488d3090e80 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
@@ -887,6 +887,10 @@ static SyscallTableEntry syscall_table[] = {
|
||||
|
||||
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
|
||||
|
||||
LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
index d326fdb9eeda..65f64af99bb7 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
@@ -1062,6 +1062,10 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
|
||||
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
};
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
index 05e0e421fa6c..151ae0640b10 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
@@ -840,6 +840,10 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
|
||||
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
|
||||
|
||||
LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index eec8388224ba..70ae837a9454 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -4163,6 +4163,54 @@ POST(sys_memfd_create)
|
||||
}
|
||||
}
|
||||
|
||||
+PRE(sys_landlock_create_ruleset)
|
||||
+{
|
||||
+ PRINT("sys_landlock_create_ruleset ( %#" FMT_REGWORD "x, %lu, %lu )",
|
||||
+ ARG1, ARG2, ARG3);
|
||||
+ PRE_REG_READ3(long, "landlock_create_ruleset",
|
||||
+ const struct vki_landlock_ruleset_attr*, attr,
|
||||
+ vki_size_t, size, vki_uint32_t, flags);
|
||||
+ PRE_MEM_READ( "landlock_create_ruleset(value)", ARG1, ARG2 );
|
||||
+
|
||||
+ /* XXX Alternatively we could always fail with EOPNOTSUPP
|
||||
+ since the rules might interfere with valgrind itself. */
|
||||
+}
|
||||
+
|
||||
+POST(sys_landlock_create_ruleset)
|
||||
+{
|
||||
+ /* Returns either the abi version or a file descriptor. */
|
||||
+ if (ARG3 != VKI_LANDLOCK_CREATE_RULESET_VERSION) {
|
||||
+ if (!ML_(fd_allowed)(RES, "landlock_create_ruleset", tid, True)) {
|
||||
+ VG_(close)(RES);
|
||||
+ SET_STATUS_Failure( VKI_EMFILE );
|
||||
+ } else {
|
||||
+ if (VG_(clo_track_fds))
|
||||
+ ML_(record_fd_open_nameless)(tid, RES);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+PRE(sys_landlock_add_rule)
|
||||
+{
|
||||
+ PRINT("sys_landlock_add_rule ( %ld, %lu, %#" FMT_REGWORD "x, %lu )",
|
||||
+ SARG1, ARG2, ARG3, ARG4);
|
||||
+ PRE_REG_READ4(long, "landlock_add_rule",
|
||||
+ int, ruleset_fd, enum vki_landlock_rule_type, rule_type,
|
||||
+ const void*, rule_attr, vki_uint32_t, flags);
|
||||
+ if (!ML_(fd_allowed)(ARG1, "landlock_add_rule", tid, False))
|
||||
+ SET_STATUS_Failure(VKI_EBADF);
|
||||
+ /* XXX Depending on rule_type we should also check the given rule_attr. */
|
||||
+}
|
||||
+
|
||||
+PRE(sys_landlock_restrict_self)
|
||||
+{
|
||||
+ PRINT("sys_landlock_restrict_self ( %ld, %lu )", SARG1, ARG2);
|
||||
+ PRE_REG_READ2(long, "landlock_create_ruleset",
|
||||
+ int, ruleset_fd, vki_uint32_t, flags);
|
||||
+ if (!ML_(fd_allowed)(ARG1, "landlock_restrict_self", tid, False))
|
||||
+ SET_STATUS_Failure(VKI_EBADF);
|
||||
+}
|
||||
+
|
||||
PRE(sys_memfd_secret)
|
||||
{
|
||||
PRINT("sys_memfd_secret ( %#" FMT_REGWORD "x )", ARG1);
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
index 421344213676..757b637ba986 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
@@ -1147,6 +1147,10 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
|
||||
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
};
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
index e9bb5c54c59c..f0c5f7e04f4e 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
@@ -824,7 +824,10 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY (__NR_openat2, sys_openat2),
|
||||
LINXY (__NR_pidfd_getfd, sys_pidfd_getfd),
|
||||
LINX_ (__NR_faccessat2, sys_faccessat2),
|
||||
- LINXY(__NR_epoll_pwait2, sys_epoll_pwait2),
|
||||
+ LINXY (__NR_epoll_pwait2, sys_epoll_pwait2),
|
||||
+ LINXY (__NR_landlock_create_ruleset, sys_landlock_create_ruleset),
|
||||
+ LINX_ (__NR_landlock_add_rule, sys_landlock_add_rule),
|
||||
+ LINX_ (__NR_landlock_restrict_self, sys_landlock_restrict_self),
|
||||
LINX_ (__NR_fchmodat2, sys_fchmodat2),
|
||||
};
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
index 36a5c0ca002d..f466aca147e0 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
@@ -831,6 +831,9 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_pidfd_getfd, sys_pidfd_getfd),
|
||||
LINX_ (__NR_faccessat2, sys_faccessat2),
|
||||
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2),
|
||||
+ LINXY (__NR_landlock_create_ruleset,sys_landlock_create_ruleset),
|
||||
+ LINX_ (__NR_landlock_add_rule, sys_landlock_add_rule),
|
||||
+ LINX_ (__NR_landlock_restrict_self, sys_landlock_restrict_self),
|
||||
LINX_ (__NR_fchmodat2, sys_fchmodat2),
|
||||
};
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
index f7a90c753060..634f288ce0d1 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
@@ -1069,6 +1069,10 @@ static SyscallTableEntry syscall_table[] = {
|
||||
|
||||
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
};
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
index 8de95624fa7c..2c2def330ad7 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
@@ -1035,6 +1035,10 @@ static SyscallTableEntry syscall_table[] = {
|
||||
|
||||
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
};
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
index 8a1be8cbef54..ca571f0f1a7c 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
@@ -875,6 +875,10 @@ static SyscallTableEntry syscall_table[] = {
|
||||
|
||||
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
|
||||
|
||||
LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
index 31243a0db373..a23743743abe 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
@@ -1656,6 +1656,10 @@ static SyscallTableEntry syscall_table[] = {
|
||||
|
||||
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
|
||||
|
||||
+ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444
|
||||
+ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445
|
||||
+ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446
|
||||
+
|
||||
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
|
||||
|
||||
LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
|
||||
diff --git a/include/Makefile.am b/include/Makefile.am
|
||||
index 8012d73749b3..5d5162a46eb6 100644
|
||||
--- a/include/Makefile.am
|
||||
+++ b/include/Makefile.am
|
||||
@@ -107,4 +107,5 @@ nobase_pkginclude_HEADERS = \
|
||||
vki/vki-xen-xsm.h \
|
||||
vki/vki-xen-x86.h \
|
||||
vki/vki-linux-drm.h \
|
||||
- vki/vki-linux-io_uring.h
|
||||
+ vki/vki-linux-io_uring.h \
|
||||
+ vki/vki-linux-landlock.h
|
||||
diff --git a/include/pub_tool_vki.h b/include/pub_tool_vki.h
|
||||
index 24f99cc09f16..7b6e71e11eb4 100644
|
||||
--- a/include/pub_tool_vki.h
|
||||
+++ b/include/pub_tool_vki.h
|
||||
@@ -47,6 +47,7 @@
|
||||
# include "vki/vki-linux.h"
|
||||
# include "vki/vki-linux-drm.h"
|
||||
# include "vki/vki-linux-io_uring.h"
|
||||
+# include "vki/vki-linux-landlock.h"
|
||||
#elif defined(VGO_darwin)
|
||||
# include "vki/vki-darwin.h"
|
||||
#elif defined(VGO_solaris)
|
||||
diff --git a/include/vki/vki-linux-landlock.h b/include/vki/vki-linux-landlock.h
|
||||
new file mode 100644
|
||||
index 000000000000..e549ae93eff9
|
||||
--- /dev/null
|
||||
+++ b/include/vki/vki-linux-landlock.h
|
||||
@@ -0,0 +1,37 @@
|
||||
+/*
|
||||
+ This file is part of Valgrind, a dynamic binary instrumentation framework.
|
||||
+
|
||||
+ Copyright (C) 2024 Peter Seiderer <ps.report@gmx.net>
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU General Public License as
|
||||
+ published by the Free Software Foundation; either version 2 of the
|
||||
+ License, or (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ The GNU General Public License is contained in the file COPYING.
|
||||
+*/
|
||||
+#ifndef __VKI_LANDLOCK_H
|
||||
+#define __VKI_LANDLOCK_H
|
||||
+
|
||||
+// Derived from linux-6.9.7/include/uapi/linux/landlock.h
|
||||
+struct vki_landlock_ruleset_attr {
|
||||
+ __vki_u64 handled_access_fs;
|
||||
+ __vki_u64 handled_access_net;
|
||||
+};
|
||||
+
|
||||
+enum vki_landlock_rule_type {
|
||||
+ VKI_LANDLOCK_RULE_PATH_BENEATH = 1,
|
||||
+ VKI_LANDLOCK_RULE_NET_PORT,
|
||||
+};
|
||||
+
|
||||
+#define VKI_LANDLOCK_CREATE_RULESET_VERSION 1
|
||||
+
|
||||
+#endif
|
||||
diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h
|
||||
index 068a2cd12bd6..20346ca71678 100644
|
||||
--- a/include/vki/vki-scnums-shared-linux.h
|
||||
+++ b/include/vki/vki-scnums-shared-linux.h
|
||||
@@ -48,6 +48,10 @@
|
||||
|
||||
#define __NR_epoll_pwait2 441
|
||||
|
||||
+#define __NR_landlock_create_ruleset 444
|
||||
+#define __NR_landlock_add_rule 445
|
||||
+#define __NR_landlock_restrict_self 446
|
||||
+
|
||||
#define __NR_memfd_secret 447
|
||||
|
||||
#define __NR_fchmodat2 452
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,45 +0,0 @@
|
||||
From 468933f9765449c1e353c38e88555a2f1603b9ce Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.ibm.com>
|
||||
Date: Wed, 15 May 2024 14:32:42 +0200
|
||||
Subject: [PATCH 07/11] Fix uninitialized `err' in handle_extension()
|
||||
|
||||
In handle_extension(), in the case of a second return from SCHEDSETJMP the
|
||||
variable `err' would be used uninitialized. Fix this by avoiding any
|
||||
access to `err' in this case.
|
||||
|
||||
(cherry picked from commit 94c2e5c6be23c6323f24deacdad5f98fb9f0b1c2)
|
||||
---
|
||||
coregrind/m_scheduler/scheduler.c | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c
|
||||
index fc8cf7c9cb1d..29751bb28283 100644
|
||||
--- a/coregrind/m_scheduler/scheduler.c
|
||||
+++ b/coregrind/m_scheduler/scheduler.c
|
||||
@@ -1233,7 +1233,10 @@ static void handle_extension(ThreadId tid)
|
||||
SCHEDSETJMP(tid, jumped, err = VG_(client_extension)(tid));
|
||||
vg_assert(VG_(is_running_thread)(tid));
|
||||
|
||||
- if (err != ExtErr_OK) {
|
||||
+ if (jumped != (UWord)0) {
|
||||
+ block_signals();
|
||||
+ VG_(poll_signals)(tid);
|
||||
+ } else if (err != ExtErr_OK) {
|
||||
ThreadState* tst = VG_(get_ThreadState)(tid);
|
||||
Addr addr = tst->arch.vex.guest_IP_AT_SYSCALL;
|
||||
switch (err) {
|
||||
@@ -1244,11 +1247,6 @@ static void handle_extension(ThreadId tid)
|
||||
VG_(core_panic)("scheduler: bad return code from extension");
|
||||
}
|
||||
}
|
||||
-
|
||||
- if (jumped != (UWord)0) {
|
||||
- block_signals();
|
||||
- VG_(poll_signals)(tid);
|
||||
- }
|
||||
}
|
||||
|
||||
/* tid just requested a jump to the noredir version of its current
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 40b68ae8d6c869f098493e3a31d66f09170592e3 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.ibm.com>
|
||||
Date: Wed, 15 May 2024 14:32:42 +0200
|
||||
Subject: [PATCH 08/11] Avoid use of guest_IP_AT_SYSCALL in handle_extension()
|
||||
|
||||
The guest state field guest_IP_AT_SYSCALL is referenced in
|
||||
handle_extension(), even though it may not be defined by all
|
||||
architectures. Avoid its use altogether.
|
||||
|
||||
(cherry picked from commit 16249b21456d681b5d98400287b8dbd926050c75)
|
||||
---
|
||||
coregrind/m_scheduler/scheduler.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c
|
||||
index 29751bb28283..cc8d070b7930 100644
|
||||
--- a/coregrind/m_scheduler/scheduler.c
|
||||
+++ b/coregrind/m_scheduler/scheduler.c
|
||||
@@ -1237,8 +1237,7 @@ static void handle_extension(ThreadId tid)
|
||||
block_signals();
|
||||
VG_(poll_signals)(tid);
|
||||
} else if (err != ExtErr_OK) {
|
||||
- ThreadState* tst = VG_(get_ThreadState)(tid);
|
||||
- Addr addr = tst->arch.vex.guest_IP_AT_SYSCALL;
|
||||
+ Addr addr = VG_(get_IP)(tid);
|
||||
switch (err) {
|
||||
case ExtErr_Illop:
|
||||
VG_(synth_sigill)(tid, addr);
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 459fa5b82df0d07cf871fc7359a060410052b82e Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat, 23 Nov 2024 22:37:14 +0100
|
||||
Subject: [PATCH 08/11] helgrind/tests/tc17_sembar.c: Remove bool typedef
|
||||
|
||||
Since C23 bool is a keyword. Also bool wasn't actually used.
|
||||
|
||||
tc17_sembar.c:45:14: error: both 'long' and '_Bool' in declaration specifiers
|
||||
45 | typedef long bool;
|
||||
| ^~~~
|
||||
tc17_sembar.c:45:1: warning: useless type name in empty declaration
|
||||
45 | typedef long bool;
|
||||
| ^~~~~~~
|
||||
|
||||
(cherry picked from commit 932bf2c027579c8d933b57ed80bb5842b390bdb3)
|
||||
---
|
||||
helgrind/tests/tc17_sembar.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/helgrind/tests/tc17_sembar.c b/helgrind/tests/tc17_sembar.c
|
||||
index 36412a07e206..ee40160b082d 100644
|
||||
--- a/helgrind/tests/tc17_sembar.c
|
||||
+++ b/helgrind/tests/tc17_sembar.c
|
||||
@@ -42,7 +42,7 @@ typedef struct
|
||||
sem_t* xxx;
|
||||
} gomp_barrier_t;
|
||||
|
||||
-typedef long bool;
|
||||
+
|
||||
|
||||
void
|
||||
gomp_barrier_init (gomp_barrier_t *bar, unsigned count)
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,38 @@
|
||||
From c08e155fdf6641a569053b3a70c52bfae09dd34c Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat, 23 Nov 2024 22:48:03 +0100
|
||||
Subject: [PATCH 09/11] drd/tests/swapcontext.c: Rename typedef struct
|
||||
thread_local to threadlocal
|
||||
|
||||
Since C23 thread_local is a keyword (thread storage duration).
|
||||
|
||||
swapcontext.c:23:16: error: expected '{' before 'thread_local'
|
||||
23 | typedef struct thread_local {
|
||||
| ^~~~~~~~~~~~
|
||||
swapcontext.c:23:16: warning: 'thread_local' is not at beginning of declaration [-Wold-style-declaration]
|
||||
swapcontext.c:23:16: error: 'thread_local' used with 'typedef'
|
||||
swapcontext.c:26:3: warning: data definition has no type or storage class
|
||||
26 | } thread_local_t;
|
||||
| ^~~~~~~~~~~~~~
|
||||
|
||||
(cherry picked from commit 907b985725805f1537396a6d76539bf490cc6c7e)
|
||||
---
|
||||
drd/tests/swapcontext.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c
|
||||
index 2cb969a5eafa..ec191968cab1 100644
|
||||
--- a/drd/tests/swapcontext.c
|
||||
+++ b/drd/tests/swapcontext.c
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define STACKSIZE (PTHREAD_STACK_MIN + 4096)
|
||||
|
||||
-typedef struct thread_local {
|
||||
+typedef struct threadlocal {
|
||||
ucontext_t uc[3];
|
||||
size_t nrsw;
|
||||
} thread_local_t;
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,66 +0,0 @@
|
||||
From ebe5fd9c0aae97767a4418d2f26f3281065b3e6a Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Arnez <arnez@linux.ibm.com>
|
||||
Date: Wed, 15 May 2024 14:32:42 +0200
|
||||
Subject: [PATCH 09/11] s390x: Minor fixes in extension-s390x.c
|
||||
|
||||
Some tracker names for registers are not consistent with the naming
|
||||
scheme. Also, there is a dead assignment to orig_addr2 and orig_len2.
|
||||
Fix both.
|
||||
|
||||
(cherry picked from commit 76f2218924f85547f670969b1a0b59e5200e22ec)
|
||||
---
|
||||
coregrind/m_extension/extension-s390x.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/coregrind/m_extension/extension-s390x.c b/coregrind/m_extension/extension-s390x.c
|
||||
index fd45c7ee948f..735406e6e4c5 100644
|
||||
--- a/coregrind/m_extension/extension-s390x.c
|
||||
+++ b/coregrind/m_extension/extension-s390x.c
|
||||
@@ -37,9 +37,9 @@
|
||||
|
||||
#undef SYSNO
|
||||
|
||||
-#define READ_FUNCTION_CODE(tst) \
|
||||
+#define READ_FUNCTION_CODE(tst, extname) \
|
||||
({ \
|
||||
- PRE_REG_READ(tst, "func_code", r0, 7, sizeof(UChar)); \
|
||||
+ PRE_REG_READ(tst, extname "(func_code)", r0, 7, sizeof(UChar)); \
|
||||
tst->arch.vex.guest_r0 & 0xff; \
|
||||
})
|
||||
|
||||
@@ -141,10 +141,10 @@ static enum ExtensionError do_extension_PRNO(ThreadState* tst, ULong variant)
|
||||
{
|
||||
UChar r1 = variant & 0xf;
|
||||
UChar r2 = (variant >> 4) & 0xf;
|
||||
- UChar func = READ_FUNCTION_CODE(tst);
|
||||
+ UChar func = READ_FUNCTION_CODE(tst, "PRNO");
|
||||
UChar fc = func & 0x7f;
|
||||
UChar mflag = func & 128;
|
||||
- ULong parms = READ_GPR(tst, "r1", 1);
|
||||
+ ULong parms = READ_GPR(tst, "PRNO(r1)", 1);
|
||||
ULong parms_len;
|
||||
Int cc = 0;
|
||||
ULong orig_addr1 = 0, orig_len1 = 0, orig_addr2 = 0, orig_len2 = 0;
|
||||
@@ -175,8 +175,8 @@ static enum ExtensionError do_extension_PRNO(ThreadState* tst, ULong variant)
|
||||
PRE_MEM_WRITE(tst, "PRNO(op1)", addr1, len1);
|
||||
} else {
|
||||
// Seed operation
|
||||
- addr2 = orig_addr2 = READ_GPR(tst, "PRNO(op2_addr)", r2);
|
||||
- len2 = orig_len2 = READ_GPR(tst, "PRNO(op2_len)", r2 + 1);
|
||||
+ addr2 = READ_GPR(tst, "PRNO(op2_addr)", r2);
|
||||
+ len2 = READ_GPR(tst, "PRNO(op2_len)", r2 + 1);
|
||||
PRE_MEM_READ(tst, "PRNO(op2)", addr2, len2);
|
||||
}
|
||||
PRE_MEM_WRITE(tst, "PRNO(parms)", parms, parms_len);
|
||||
@@ -474,7 +474,7 @@ static enum ExtensionError do_extension_NNPA(ThreadState* tst, ULong variant)
|
||||
{
|
||||
ULong gpr0 = READ_GPR(tst, "NNPA(r0)", 0);
|
||||
UChar fc = gpr0 & 0x7f;
|
||||
- ULong parms_addr = READ_GPR(tst, "r1", 1);
|
||||
+ ULong parms_addr = READ_GPR(tst, "NNPA(r1)", 1);
|
||||
Int cc = 0;
|
||||
ULong parms_len;
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,38 +0,0 @@
|
||||
From 70d765faa162f2f12e7771db51877649637f2c12 Mon Sep 17 00:00:00 2001
|
||||
From: Jesus Checa <jcheca@redhat.com>
|
||||
Date: Sat, 25 May 2024 12:40:30 +0200
|
||||
Subject: [PATCH 10/11] Bug 453044 - gbserver_tests failures in aarch64
|
||||
|
||||
(cherry picked from commit 790abdf7d3f3df0c968605b68ca765310689b7ce)
|
||||
---
|
||||
NEWS | 1 +
|
||||
gdbserver_tests/filter_gdb.in | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index adb52169dd87..c2ad6a207d96 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,6 +5,7 @@ Branch 3.23
|
||||
|
||||
The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
+453044 gbserver_tests failures in aarch64
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
486293 memccpy false positives
|
||||
486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in
|
||||
index 4118063f6bc6..497171732b25 100755
|
||||
--- a/gdbserver_tests/filter_gdb.in
|
||||
+++ b/gdbserver_tests/filter_gdb.in
|
||||
@@ -152,6 +152,7 @@ s/in _select ()/in syscall .../
|
||||
/sysv\/linux\/generic\/select.c/d
|
||||
/return SYSCALL_CANCEL /d
|
||||
/r = SYSCALL_CANCEL /d
|
||||
+/result = SYSCALL_CANCEL /d
|
||||
|
||||
# a more specialised system call select stack trace part
|
||||
# (on 32 bits, we have an int_80, on 64 bits, directly select)
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 53d667789d369042b1fe45f72102ecb5c16e5d12 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sat, 23 Nov 2024 22:59:21 +0100
|
||||
Subject: [PATCH 10/11] none/tests/bug234814.c: sa_handler take an int as
|
||||
argument
|
||||
|
||||
GCC15 will turn this warning into an error:
|
||||
|
||||
bug234814.c: In function 'main':
|
||||
bug234814.c:20:18: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
|
||||
20 | sa.sa_handler = mysigbus;
|
||||
| ^
|
||||
|
||||
(cherry picked from commit 8f6cef269b91739f6a2e7f3b4b1e0a429db3e748)
|
||||
---
|
||||
none/tests/bug234814.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/none/tests/bug234814.c b/none/tests/bug234814.c
|
||||
index 16b561fde6b0..11e0f6779162 100644
|
||||
--- a/none/tests/bug234814.c
|
||||
+++ b/none/tests/bug234814.c
|
||||
@@ -9,7 +9,7 @@ const char kSigbus[] = "I caught the SIGBUS signal!\n";
|
||||
|
||||
int GLOB = 3;
|
||||
|
||||
-void mysigbus() {
|
||||
+void mysigbus(int signum) {
|
||||
write(1, kSigbus, sizeof(kSigbus)-1);
|
||||
GLOB--;
|
||||
return;
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,398 @@
|
||||
From 349b57d3a8c8d2df23128d4b03eca91b629629e1 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Tue, 26 Nov 2024 19:00:34 +0100
|
||||
Subject: [PATCH 11/11] Add open_tree, move_mount, fsopen, fsconfig, fsmount,
|
||||
fspick linux syswraps
|
||||
|
||||
Shared linux syscalls implementing various file system mount tasks.
|
||||
Since linux kernel version 5.2.
|
||||
|
||||
Check arguments and track file descriptors.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=494246
|
||||
|
||||
(cherry picked from commit 4044bcea0427853fc44a3d02a0fc0b2a81935452)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_syswrap/priv_syswrap-linux.h | 8 +
|
||||
coregrind/m_syswrap/syswrap-amd64-linux.c | 6 +
|
||||
coregrind/m_syswrap/syswrap-arm-linux.c | 7 +-
|
||||
coregrind/m_syswrap/syswrap-arm64-linux.c | 7 +-
|
||||
coregrind/m_syswrap/syswrap-linux.c | 146 +++++++++++++++++++
|
||||
coregrind/m_syswrap/syswrap-mips32-linux.c | 7 +-
|
||||
coregrind/m_syswrap/syswrap-mips64-linux.c | 6 +
|
||||
coregrind/m_syswrap/syswrap-nanomips-linux.c | 6 +
|
||||
coregrind/m_syswrap/syswrap-ppc32-linux.c | 7 +-
|
||||
coregrind/m_syswrap/syswrap-ppc64-linux.c | 7 +-
|
||||
coregrind/m_syswrap/syswrap-s390x-linux.c | 7 +-
|
||||
coregrind/m_syswrap/syswrap-x86-linux.c | 7 +-
|
||||
13 files changed, 215 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 68cd0c6fa603..7f1334aa0f07 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -6,6 +6,7 @@ Branch 3.24
|
||||
The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset)
|
||||
+494246 syscall fsopen not wrapped
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
index 221439a0ec33..1bdd9a94ec19 100644
|
||||
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
|
||||
@@ -321,6 +321,14 @@ DECL_TEMPLATE(linux, sys_io_uring_setup);
|
||||
DECL_TEMPLATE(linux, sys_io_uring_enter);
|
||||
DECL_TEMPLATE(linux, sys_io_uring_register);
|
||||
|
||||
+// open_tree and friends (shared linux syscalls)
|
||||
+DECL_TEMPLATE(linux, sys_open_tree);
|
||||
+DECL_TEMPLATE(linux, sys_move_mount);
|
||||
+DECL_TEMPLATE(linux, sys_fsopen);
|
||||
+DECL_TEMPLATE(linux, sys_fsconfig);
|
||||
+DECL_TEMPLATE(linux, sys_fsmount);
|
||||
+DECL_TEMPLATE(linux, sys_fspick);
|
||||
+
|
||||
// Linux-specific (new in Linux 5.3)
|
||||
DECL_TEMPLATE(linux, sys_pidfd_open);
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
index 9488d3090e80..bdba41826ad8 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
|
||||
@@ -877,6 +877,12 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
index 65f64af99bb7..108e1f91e5e9 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
|
||||
@@ -1052,7 +1052,12 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
index 151ae0640b10..23b0b6b51c10 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
|
||||
@@ -830,7 +830,12 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 70ae837a9454..57672f167126 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -13836,6 +13836,152 @@ POST(sys_pidfd_getfd)
|
||||
}
|
||||
}
|
||||
|
||||
+/* int open_tree (int dfd, const char *filename, unsigned int flags) */
|
||||
+PRE(sys_open_tree)
|
||||
+{
|
||||
+ PRINT("sys_open_tree ( %ld, %#" FMT_REGWORD "x(%s), %ld",
|
||||
+ SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3);
|
||||
+ PRE_REG_READ3(long, "open_tree",
|
||||
+ int, dfd, const char *, filename, int, flags);
|
||||
+ PRE_MEM_RASCIIZ( "open_tree(filename)", ARG2);
|
||||
+ /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD,
|
||||
+ filename is relative to cwd. When comparing dfd against AT_FDCWD,
|
||||
+ be sure only to compare the bottom 32 bits. */
|
||||
+ if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 )
|
||||
+ && *(Char *)(Addr)ARG2 != '/'
|
||||
+ && ((Int)ARG1) != ((Int)VKI_AT_FDCWD)
|
||||
+ && !ML_(fd_allowed)(ARG1, "open_tree", tid, False))
|
||||
+ SET_STATUS_Failure( VKI_EBADF );
|
||||
+}
|
||||
+
|
||||
+POST(sys_open_tree)
|
||||
+{
|
||||
+ if (!ML_(fd_allowed)(RES, "open_tree", tid, True)) {
|
||||
+ VG_(close)(RES);
|
||||
+ SET_STATUS_Failure( VKI_EMFILE );
|
||||
+ } else {
|
||||
+ if (VG_(clo_track_fds))
|
||||
+ ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG2);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* int move_mount (int from_dfd, const char *from_pathname,
|
||||
+ int to_dfd, const char *to_pathname,
|
||||
+ unsigned int flags) */
|
||||
+PRE(sys_move_mount)
|
||||
+{
|
||||
+ PRINT("sys_move_mount ( %ld, %#" FMT_REGWORD "x(%s), "
|
||||
+ "%ld, %#" FMT_REGWORD "x(%s), %ld",
|
||||
+ SARG1, ARG2, (HChar*)(Addr)ARG2,
|
||||
+ SARG3, ARG4, (HChar*)(Addr)ARG4, SARG5);
|
||||
+ PRE_REG_READ5(long, "mount_move",
|
||||
+ int, from_dfd, const char *, from_pathname,
|
||||
+ int, to_dfd, const char*, to_pathname, int, flags);
|
||||
+ PRE_MEM_RASCIIZ( "mount_move(from_pathname)", ARG2);
|
||||
+ /* For absolute filenames, from_dfd is ignored. If from_dfd is AT_FDCWD,
|
||||
+ from_pathname is relative to cwd. When comparing from_dfd against
|
||||
+ AT_FDCWD, be sure only to compare the bottom 32 bits. */
|
||||
+ if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 )
|
||||
+ && *(Char *)(Addr)ARG2 != '/'
|
||||
+ && ((Int)ARG1) != ((Int)VKI_AT_FDCWD)
|
||||
+ && !ML_(fd_allowed)(ARG1, "mount_move", tid, False))
|
||||
+ SET_STATUS_Failure( VKI_EBADF );
|
||||
+ PRE_MEM_RASCIIZ( "mount_move(from_pathname)", ARG4);
|
||||
+ /* For absolute filenames, to_dfd is ignored. If to_dfd is AT_FDCWD,
|
||||
+ to_pathname is relative to cwd. When comparing to_dfd against
|
||||
+ AT_FDCWD, be sure only to compare the bottom 32 bits. */
|
||||
+ if (ML_(safe_to_deref)( (void*)(Addr)ARG4, 1 )
|
||||
+ && *(Char *)(Addr)ARG4 != '/'
|
||||
+ && ((Int)ARG4) != ((Int)VKI_AT_FDCWD)
|
||||
+ && !ML_(fd_allowed)(ARG3, "mount_move", tid, False))
|
||||
+ SET_STATUS_Failure( VKI_EBADF );
|
||||
+}
|
||||
+
|
||||
+/* int fsopen (const char *fs_name, unsigned int flags) */
|
||||
+PRE(sys_fsopen)
|
||||
+{
|
||||
+ PRINT("sys_fsopen ( %#" FMT_REGWORD "x(%s), %ld",
|
||||
+ ARG1, (HChar*)(Addr)ARG1, SARG2);
|
||||
+ PRE_REG_READ2(long, "fsopen", const char *, fs_name, int, flags);
|
||||
+ PRE_MEM_RASCIIZ( "fsopen(filename)", ARG1);
|
||||
+}
|
||||
+
|
||||
+POST(sys_fsopen)
|
||||
+{
|
||||
+ if (!ML_(fd_allowed)(RES, "fsopen", tid, True)) {
|
||||
+ VG_(close)(RES);
|
||||
+ SET_STATUS_Failure( VKI_EMFILE );
|
||||
+ } else {
|
||||
+ if (VG_(clo_track_fds))
|
||||
+ ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG1);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* int fsmount (int fd, unsigned int flags, unsigned int ms_flags) */
|
||||
+PRE(sys_fsmount)
|
||||
+{
|
||||
+ PRINT("sys_fsmount ( %ld, %ld, %ld", SARG1, SARG2, SARG3);
|
||||
+ PRE_REG_READ3(long, "fsmount", int, fd, int, flags, int, ms_flags);
|
||||
+ if (!ML_(fd_allowed)(ARG1, "fsmount", tid, False))
|
||||
+ SET_STATUS_Failure( VKI_EBADF );
|
||||
+}
|
||||
+
|
||||
+POST(sys_fsmount)
|
||||
+{
|
||||
+ if (!ML_(fd_allowed)(RES, "fsmount", tid, True)) {
|
||||
+ VG_(close)(RES);
|
||||
+ SET_STATUS_Failure( VKI_EMFILE );
|
||||
+ } else {
|
||||
+ if (VG_(clo_track_fds))
|
||||
+ ML_(record_fd_open_nameless)(tid, RES);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* int fsconfig (int fd, unsigned int cmd, const char *key,
|
||||
+ const void *value, int aux) */
|
||||
+PRE(sys_fsconfig)
|
||||
+{
|
||||
+ PRINT("sys_fsconfig ( %ld, %ld, %#" FMT_REGWORD "x(%s), "
|
||||
+ "%#" FMT_REGWORD "x, %ld )",
|
||||
+ SARG1, SARG2, ARG3, (HChar*)(Addr)ARG3, ARG4, SARG6);
|
||||
+ PRE_REG_READ5(long, "fsconfig", int, fd, int, cmd,
|
||||
+ const char *, key, const void *, value, int, aux);
|
||||
+ if (ARG3)
|
||||
+ PRE_MEM_RASCIIZ( "fsconfig(key)", ARG3);
|
||||
+ if (!ML_(fd_allowed)(ARG1, "fsconfig", tid, False))
|
||||
+ SET_STATUS_Failure( VKI_EBADF );
|
||||
+ /* XXX we could also check the value based on the cmd FSCONFIG_... */
|
||||
+}
|
||||
+
|
||||
+/* int fspick (int dfd, const char *path, unsigned int flags) */
|
||||
+PRE(sys_fspick)
|
||||
+{
|
||||
+ PRINT("sys_fspick ( %ld, %#" FMT_REGWORD "x(%s), %ld",
|
||||
+ SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3);
|
||||
+ PRE_REG_READ3(long, "fspick",
|
||||
+ int, dfd, const char *, filename, int, flags);
|
||||
+ PRE_MEM_RASCIIZ( "fspick(path)", ARG2);
|
||||
+ /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD,
|
||||
+ path is relative to cwd. When comparing dfd against AT_FDCWD,
|
||||
+ be sure only to compare the bottom 32 bits. */
|
||||
+ if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 )
|
||||
+ && *(Char *)(Addr)ARG2 != '/'
|
||||
+ && ((Int)ARG1) != ((Int)VKI_AT_FDCWD)
|
||||
+ && !ML_(fd_allowed)(ARG1, "fspick", tid, False))
|
||||
+ SET_STATUS_Failure( VKI_EBADF );
|
||||
+}
|
||||
+
|
||||
+POST(sys_fspick)
|
||||
+{
|
||||
+ if (!ML_(fd_allowed)(RES, "fspick", tid, True)) {
|
||||
+ VG_(close)(RES);
|
||||
+ SET_STATUS_Failure( VKI_EMFILE );
|
||||
+ } else {
|
||||
+ if (VG_(clo_track_fds))
|
||||
+ ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG2);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#undef PRE
|
||||
#undef POST
|
||||
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
index 757b637ba986..39ba911aa5e4 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
|
||||
@@ -1137,7 +1137,12 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
index f0c5f7e04f4e..d603924c5566 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
@@ -818,6 +818,12 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY (__NR_io_uring_setup, sys_io_uring_setup),
|
||||
LINXY (__NR_io_uring_enter, sys_io_uring_enter),
|
||||
LINXY (__NR_io_uring_register, sys_io_uring_register),
|
||||
+ LINXY (__NR_open_tree, sys_open_tree),
|
||||
+ LINX_ (__NR_move_mount, sys_move_mount),
|
||||
+ LINXY (__NR_fsopen, sys_fsopen),
|
||||
+ LINX_ (__NR_fsconfig, sys_fsconfig),
|
||||
+ LINXY (__NR_fsmount, sys_fsmount),
|
||||
+ LINXY (__NR_fspick, sys_fspick),
|
||||
LINXY (__NR_pidfd_open, sys_pidfd_open),
|
||||
GENX_ (__NR_clone3, sys_ni_syscall),
|
||||
LINXY (__NR_close_range, sys_close_range),
|
||||
diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
index f466aca147e0..853495e981b1 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
|
||||
@@ -824,6 +824,12 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINXY (__NR_io_uring_setup, sys_io_uring_setup),
|
||||
LINXY (__NR_io_uring_enter, sys_io_uring_enter),
|
||||
LINXY (__NR_io_uring_register, sys_io_uring_register),
|
||||
+ LINXY (__NR_open_tree, sys_open_tree),
|
||||
+ LINX_ (__NR_move_mount, sys_move_mount),
|
||||
+ LINXY (__NR_fsopen, sys_fsopen),
|
||||
+ LINX_ (__NR_fsconfig, sys_fsconfig),
|
||||
+ LINXY (__NR_fsmount, sys_fsmount),
|
||||
+ LINXY (__NR_fspick, sys_fspick),
|
||||
LINXY (__NR_pidfd_open, sys_pidfd_open),
|
||||
GENX_ (__NR_clone3, sys_ni_syscall),
|
||||
LINXY (__NR_close_range, sys_close_range),
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
index 634f288ce0d1..24d8eb213190 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
|
||||
@@ -1059,7 +1059,12 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
index 2c2def330ad7..2a3ed8b92481 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
|
||||
@@ -1025,7 +1025,12 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
index ca571f0f1a7c..893306bbdae3 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
|
||||
@@ -865,7 +865,12 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
index a23743743abe..50384817dbe5 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
|
||||
@@ -1646,7 +1646,12 @@ static SyscallTableEntry syscall_table[] = {
|
||||
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
|
||||
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
|
||||
LINXY(__NR_io_uring_register, sys_io_uring_register),// 427
|
||||
-
|
||||
+ LINXY(__NR_open_tree, sys_open_tree), // 428
|
||||
+ LINX_(__NR_move_mount, sys_move_mount), // 429
|
||||
+ LINXY(__NR_fsopen, sys_fsopen), // 430
|
||||
+ LINX_(__NR_fsconfig, sys_fsconfig), // 431
|
||||
+ LINXY(__NR_fsmount, sys_fsmount), // 432
|
||||
+ LINXY(__NR_fspick, sys_fspick), // 433
|
||||
LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
|
||||
GENX_(__NR_clone3, sys_ni_syscall), // 435
|
||||
LINXY(__NR_close_range, sys_close_range), // 436
|
||||
--
|
||||
2.47.0
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 1c2cdfd790b3e26f47e709770bdefd456d83a7cb Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Tue, 4 Jun 2024 12:49:33 +0200
|
||||
Subject: [PATCH 11/11] Linux regtest: reallocarray needs malloc.h
|
||||
|
||||
Seen on Rocky 8.9
|
||||
|
||||
(cherry picked from commit a015ad2e0db40076b4841220c7ab6d6853798936)
|
||||
---
|
||||
memcheck/tests/amd64-linux/reallocarray.c | 1 +
|
||||
memcheck/tests/amd64-linux/reallocarray.stderr.exp | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/memcheck/tests/amd64-linux/reallocarray.c b/memcheck/tests/amd64-linux/reallocarray.c
|
||||
index 8765ca4997cb..ce63b80100da 100644
|
||||
--- a/memcheck/tests/amd64-linux/reallocarray.c
|
||||
+++ b/memcheck/tests/amd64-linux/reallocarray.c
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
+#include <malloc.h>
|
||||
#include "../../memcheck.h"
|
||||
|
||||
int main(void)
|
||||
diff --git a/memcheck/tests/amd64-linux/reallocarray.stderr.exp b/memcheck/tests/amd64-linux/reallocarray.stderr.exp
|
||||
index a1c8439cc9ef..20a1c4e8b4f9 100644
|
||||
--- a/memcheck/tests/amd64-linux/reallocarray.stderr.exp
|
||||
+++ b/memcheck/tests/amd64-linux/reallocarray.stderr.exp
|
||||
@@ -12,19 +12,19 @@ To see them, rerun with: --leak-check=full --show-leak-kinds=all
|
||||
|
||||
realloc() with size 0
|
||||
at 0x........: reallocarray (vg_replace_malloc.c:...)
|
||||
- by 0x........: main (reallocarray.c:13)
|
||||
+ by 0x........: main (reallocarray.c:14)
|
||||
Address 0x........ is 0 bytes inside a block of size 40 alloc'd
|
||||
at 0x........: reallocarray (vg_replace_malloc.c:...)
|
||||
- by 0x........: main (reallocarray.c:11)
|
||||
+ by 0x........: main (reallocarray.c:12)
|
||||
|
||||
All heap blocks were freed -- no leaks are possible
|
||||
|
||||
realloc() with size 0
|
||||
at 0x........: reallocarray (vg_replace_malloc.c:...)
|
||||
- by 0x........: main (reallocarray.c:16)
|
||||
+ by 0x........: main (reallocarray.c:17)
|
||||
Address 0x........ is 0 bytes inside a block of size 10 alloc'd
|
||||
at 0x........: malloc (vg_replace_malloc.c:...)
|
||||
- by 0x........: main (reallocarray.c:15)
|
||||
+ by 0x........: main (reallocarray.c:16)
|
||||
|
||||
All heap blocks were freed -- no leaks are possible
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,184 +0,0 @@
|
||||
From e62c7b4f9ee0a8c20c7211a92ad512f925e9515c Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Sun, 16 Jun 2024 09:25:51 +0200
|
||||
Subject: [PATCH 12/15] Bug 487439 - SIGILL in JDK11, JDK17
|
||||
|
||||
(cherry picked from commit c19d19d34a6dadaf4a9d590f516f813e9cbacdd0)
|
||||
---
|
||||
.gitignore | 1 +
|
||||
NEWS | 1 +
|
||||
VEX/priv/guest_amd64_toIR.c | 2 +-
|
||||
none/tests/amd64/Makefile.am | 3 +
|
||||
none/tests/amd64/bug487439.cpp | 83 +++++++++++++++++++++++++++
|
||||
none/tests/amd64/bug487439.stderr.exp | 0
|
||||
none/tests/amd64/bug487439.stdout.exp | 1 +
|
||||
none/tests/amd64/bug487439.vgtest | 2 +
|
||||
8 files changed, 92 insertions(+), 1 deletion(-)
|
||||
create mode 100644 none/tests/amd64/bug487439.cpp
|
||||
create mode 100644 none/tests/amd64/bug487439.stderr.exp
|
||||
create mode 100644 none/tests/amd64/bug487439.stdout.exp
|
||||
create mode 100644 none/tests/amd64/bug487439.vgtest
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index c2ad6a207d96..fbe0f012ef0c 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -9,6 +9,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
486293 memccpy false positives
|
||||
486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
+487439 SIGILL in JDK11, JDK17
|
||||
n-i-bz aarch64 frinta and frinta vector instructions
|
||||
|
||||
To see details of a given bug, visit
|
||||
diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c
|
||||
index f0b1c5516267..28c37f092211 100644
|
||||
--- a/VEX/priv/guest_amd64_toIR.c
|
||||
+++ b/VEX/priv/guest_amd64_toIR.c
|
||||
@@ -14138,7 +14138,7 @@ Long dis_ESC_0F__SSE2 ( Bool* decode_OK,
|
||||
goto decode_success;
|
||||
}
|
||||
/* 66 0F 73 /6 ib = PSLLQ by immediate */
|
||||
- if (have66noF2noF3(pfx) && sz == 2
|
||||
+ if (have66noF2noF3(pfx) && (sz == 2 || /* ignore redundant REX.W */ sz == 8)
|
||||
&& epartIsReg(getUChar(delta))
|
||||
&& gregLO3ofRM(getUChar(delta)) == 6) {
|
||||
delta = dis_SSE_shiftE_imm( pfx, delta, "psllq", Iop_ShlN64x2 );
|
||||
diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am
|
||||
index dc0498018209..83029c15590c 100644
|
||||
--- a/none/tests/amd64/Makefile.am
|
||||
+++ b/none/tests/amd64/Makefile.am
|
||||
@@ -44,6 +44,7 @@ EXTRA_DIST = \
|
||||
bug156404-amd64.vgtest bug156404-amd64.stdout.exp \
|
||||
bug156404-amd64.stderr.exp \
|
||||
bug485148.vgtest bug485148.stdout.exp bug485148.stderr.exp \
|
||||
+ bug487439.vgtest bug487439.stdout.exp bug487439.stderr.exp \
|
||||
cet_nops.vgtest cet_nops.stdout.exp cet_nops.stderr.exp \
|
||||
clc.vgtest clc.stdout.exp clc.stderr.exp \
|
||||
crc32.vgtest crc32.stdout.exp crc32.stderr.exp \
|
||||
@@ -107,6 +108,7 @@ check_PROGRAMS = \
|
||||
amd64locked \
|
||||
bt_flags \
|
||||
bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \
|
||||
+ bug487439 \
|
||||
cet_nops \
|
||||
clc \
|
||||
cmpxchg \
|
||||
@@ -204,6 +206,7 @@ amd64locked_CFLAGS = $(AM_CFLAGS) -O
|
||||
bug132918_LDADD = -lm
|
||||
bug485148_CXXFLAGS = ${AM_CXXFLAGS} -mfma
|
||||
bug485148_SOURCES = bug485148.cpp
|
||||
+bug487439_SOURCES = bug487439.cpp
|
||||
cmpxchg_CFLAGS = $(AM_CFLAGS) @FLAG_NO_PIE@
|
||||
fb_test_amd64_CFLAGS = $(AM_CFLAGS) -O -fno-strict-aliasing
|
||||
fb_test_amd64_LDADD = -lm
|
||||
diff --git a/none/tests/amd64/bug487439.cpp b/none/tests/amd64/bug487439.cpp
|
||||
new file mode 100644
|
||||
index 000000000000..f86bb65ce9eb
|
||||
--- /dev/null
|
||||
+++ b/none/tests/amd64/bug487439.cpp
|
||||
@@ -0,0 +1,83 @@
|
||||
+// This is more or less a copy/paste from the generated insn_sse2.c
|
||||
+// I didn't want to mess with the perl generator because
|
||||
+// GCC and clang don't agree on the asm syntax
|
||||
+// Using the rex prefix looks like a bug or misfeature in OpenJDK
|
||||
+// so I'm assuming that this is a one-off and not a general issue
|
||||
+
|
||||
+#include <iostream>
|
||||
+#include <csetjmp>
|
||||
+#include <csignal>
|
||||
+
|
||||
+union reg128_t {
|
||||
+ char sb[16];
|
||||
+ unsigned char ub[16];
|
||||
+ short sw[8];
|
||||
+ unsigned short uw[8];
|
||||
+ int sd[4];
|
||||
+ unsigned int ud[4];
|
||||
+ long long int sq[2];
|
||||
+ unsigned long long int uq[2];
|
||||
+ float ps[4];
|
||||
+ double pd[2];
|
||||
+} __attribute__ ((aligned (16)));
|
||||
+
|
||||
+static sigjmp_buf catchpoint;
|
||||
+
|
||||
+static void handle_sigill(int signum)
|
||||
+{
|
||||
+ siglongjmp(catchpoint, 1);
|
||||
+}
|
||||
+
|
||||
+/* with redundant rex.W */
|
||||
+static void psllq_4(void)
|
||||
+{
|
||||
+ reg128_t arg1 = { .uq = { 0x0123456789abcdefULL, 0x0123456789abcdefULL } };
|
||||
+ reg128_t result0;
|
||||
+ char state[108];
|
||||
+
|
||||
+ if (sigsetjmp(catchpoint, 1) == 0)
|
||||
+ {
|
||||
+ asm(
|
||||
+ "ffree %%st(7)\n"
|
||||
+ "ffree %%st(6)\n"
|
||||
+ "ffree %%st(5)\n"
|
||||
+ "ffree %%st(4)\n"
|
||||
+ "movlps %2, %%xmm1\n"
|
||||
+ "movhps %3, %%xmm1\n"
|
||||
+ // only GCC
|
||||
+ //".rex.W psllq $12, %%xmm1\n"
|
||||
+ // only clang
|
||||
+ //"data16 rex64 psllq $12, %mm1\n"
|
||||
+ ".byte 0x66,0x48,0x0f,0x73,0xf1,0x0c\n"
|
||||
+ "movlps %%xmm1, %0\n"
|
||||
+ "movhps %%xmm1, %1\n"
|
||||
+ "cld\n"
|
||||
+ : "=m" (result0.uq[0]), "=m" (result0.uq[1])
|
||||
+ : "m" (arg1.uq[0]), "m" (arg1.uq[1]), "m" (state[0])
|
||||
+ : "xmm1"
|
||||
+ );
|
||||
+
|
||||
+ if (result0.uq[0] == 0x3456789abcdef000ULL && result0.uq[1] == 0x3456789abcdef000ULL )
|
||||
+ {
|
||||
+ std::cout << "psllq_4 ... ok\n";
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ std::cout << "psllq_4 ... not ok\n";
|
||||
+ std::cout << " result0.uq[0] = " << result0.uq[0] << " (expected " << 0x3456789abcdef000ULL << ")\n";
|
||||
+ std::cout << " result0.uq[1] = " << result0.uq[1] << " (expected " << 0x3456789abcdef000ULL << ")\n";
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ std::cout << "psllq_4 ... failed\n";
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ signal(SIGILL, handle_sigill);
|
||||
+ psllq_4();
|
||||
+}
|
||||
diff --git a/none/tests/amd64/bug487439.stderr.exp b/none/tests/amd64/bug487439.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000000..e69de29bb2d1
|
||||
diff --git a/none/tests/amd64/bug487439.stdout.exp b/none/tests/amd64/bug487439.stdout.exp
|
||||
new file mode 100644
|
||||
index 000000000000..065b518a27d7
|
||||
--- /dev/null
|
||||
+++ b/none/tests/amd64/bug487439.stdout.exp
|
||||
@@ -0,0 +1 @@
|
||||
+psllq_4 ... ok
|
||||
diff --git a/none/tests/amd64/bug487439.vgtest b/none/tests/amd64/bug487439.vgtest
|
||||
new file mode 100644
|
||||
index 000000000000..3faa1ed6b014
|
||||
--- /dev/null
|
||||
+++ b/none/tests/amd64/bug487439.vgtest
|
||||
@@ -0,0 +1,2 @@
|
||||
+prog: bug487439
|
||||
+vgopts: -q
|
||||
--
|
||||
2.45.2
|
||||
|
144
SOURCES/0012-Recognize-new-DWARF5-DW_LANG-constants.patch
Normal file
144
SOURCES/0012-Recognize-new-DWARF5-DW_LANG-constants.patch
Normal file
@ -0,0 +1,144 @@
|
||||
From a2c30f44ac39eb36baa4e831b041fe7cdf25e481 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Fri, 6 Dec 2024 15:39:25 +0100
|
||||
Subject: [PATCH 12/14] Recognize new DWARF5 DW_LANG constants
|
||||
|
||||
When using --read-var-info=yes readdwarf3 will try to read and
|
||||
interpret the CU DW_AT_langauge attribute. Since DWARF5 was released a
|
||||
number if new language constants have been introduced. See
|
||||
https://dwarfstd.org/languages.html
|
||||
|
||||
GCC15 might start emitting some of these when switching to C23 by
|
||||
default.
|
||||
|
||||
When valgrind --read-var-info=yes encounters an unknown DW_LANG
|
||||
constant it will produce an error and stop processing any further
|
||||
DWARF.
|
||||
|
||||
Recognize all currently known language constants. In particular
|
||||
recognize DW_LANG_C17, DW_LANG_C23, DW_LANG_C_plus_plus_17,
|
||||
DW_LANG_C_plus_plus_20, DW_LANG_C_plus_plus_23, DW_LANG_Fortran18,
|
||||
DW_LANG_Fortran23, DW_LANG_Ada2005, DW_LANG_Ada2012 and DW_LANG_Rust.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=497130
|
||||
|
||||
(cherry picked from commit 7136316123c54aba37fdab166e1bf860e452a4ae)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_debuginfo/priv_d3basics.h | 31 +++++++++++++++++++++++++++
|
||||
coregrind/m_debuginfo/readdwarf3.c | 27 +++++++++++++++++++++--
|
||||
3 files changed, 57 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 7f1334aa0f07..a25f9b663098 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset)
|
||||
494246 syscall fsopen not wrapped
|
||||
+497130 Recognize new DWARF5 DW_LANG constants
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/coregrind/m_debuginfo/priv_d3basics.h b/coregrind/m_debuginfo/priv_d3basics.h
|
||||
index 3f6e5c72c9e4..34c98728711c 100644
|
||||
--- a/coregrind/m_debuginfo/priv_d3basics.h
|
||||
+++ b/coregrind/m_debuginfo/priv_d3basics.h
|
||||
@@ -179,6 +179,7 @@ typedef enum dwarf_source_language
|
||||
/* DWARF 4. */
|
||||
DW_LANG_Python = 0x0014,
|
||||
/* DWARF 5. */
|
||||
+ DW_LANG_OpenCL = 0x0015,
|
||||
DW_LANG_Go = 0x0016,
|
||||
DW_LANG_Modula3 = 0x0017,
|
||||
DW_LANG_Haskell = 0x0018,
|
||||
@@ -195,6 +196,36 @@ typedef enum dwarf_source_language
|
||||
DW_LANG_Fortran08 = 0x0023,
|
||||
DW_LANG_RenderScript = 0x0024,
|
||||
DW_LANG_BLISS = 0x0025,
|
||||
+ /* Language codes added since DWARF 5.
|
||||
+ https://dwarfstd.org/languages.html */
|
||||
+ DW_LANG_Kotlin = 0x0026,
|
||||
+ DW_LANG_Zig = 0x0027,
|
||||
+ DW_LANG_Crystal = 0x0028,
|
||||
+ DW_LANG_C_plus_plus_17 = 0x002a,
|
||||
+ DW_LANG_C_plus_plus_20 = 0x002b,
|
||||
+ DW_LANG_C17 = 0x002c,
|
||||
+ DW_LANG_Fortran18 = 0x002d,
|
||||
+ DW_LANG_Ada2005 = 0x002e,
|
||||
+ DW_LANG_Ada2012 = 0x002f,
|
||||
+ DW_LANG_HIP = 0x0030,
|
||||
+ DW_LANG_Assembly = 0x0031,
|
||||
+ DW_LANG_C_sharp = 0x0032,
|
||||
+ DW_LANG_Mojo = 0x0033,
|
||||
+ DW_LANG_GLSL = 0x0034,
|
||||
+ DW_LANG_GLSL_ES = 0x0035,
|
||||
+ DW_LANG_HLSL = 0x0036,
|
||||
+ DW_LANG_OpenCL_CPP = 0x0037,
|
||||
+ DW_LANG_CPP_for_OpenCL = 0x0038,
|
||||
+ DW_LANG_SYCL = 0x0039,
|
||||
+ DW_LANG_C_plus_plus_23 = 0x003a,
|
||||
+ DW_LANG_Odin = 0x003b,
|
||||
+ DW_LANG_P4 = 0x003c,
|
||||
+ DW_LANG_Metal = 0x003d,
|
||||
+ DW_LANG_C23 = 0x003e,
|
||||
+ DW_LANG_Fortran23 = 0x003f,
|
||||
+ DW_LANG_Ruby = 0x0040,
|
||||
+ DW_LANG_Move = 0x0041,
|
||||
+ DW_LANG_Hylo = 0x0042,
|
||||
/* MIPS. */
|
||||
DW_LANG_Mips_Assembler = 0x8001,
|
||||
/* UPC. */
|
||||
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
|
||||
index a4b75a8c532b..735896f7c0d3 100644
|
||||
--- a/coregrind/m_debuginfo/readdwarf3.c
|
||||
+++ b/coregrind/m_debuginfo/readdwarf3.c
|
||||
@@ -3972,19 +3972,42 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents,
|
||||
case DW_LANG_C_plus_plus: case DW_LANG_ObjC:
|
||||
case DW_LANG_ObjC_plus_plus: case DW_LANG_UPC:
|
||||
case DW_LANG_Upc: case DW_LANG_C99: case DW_LANG_C11:
|
||||
+ case DW_LANG_C17: case DW_LANG_C23:
|
||||
case DW_LANG_C_plus_plus_11: case DW_LANG_C_plus_plus_14:
|
||||
+ case DW_LANG_C_plus_plus_17: case DW_LANG_C_plus_plus_20:
|
||||
+ case DW_LANG_C_plus_plus_23:
|
||||
parser->language = 'C'; break;
|
||||
case DW_LANG_Fortran77: case DW_LANG_Fortran90:
|
||||
case DW_LANG_Fortran95: case DW_LANG_Fortran03:
|
||||
- case DW_LANG_Fortran08:
|
||||
+ case DW_LANG_Fortran08: case DW_LANG_Fortran18:
|
||||
+ case DW_LANG_Fortran23:
|
||||
parser->language = 'F'; break;
|
||||
case DW_LANG_Ada83: case DW_LANG_Ada95:
|
||||
+ case DW_LANG_Ada2005: case DW_LANG_Ada2012:
|
||||
parser->language = 'A'; break;
|
||||
case DW_LANG_Cobol74:
|
||||
case DW_LANG_Cobol85: case DW_LANG_Pascal83:
|
||||
case DW_LANG_Modula2: case DW_LANG_Java:
|
||||
case DW_LANG_PLI:
|
||||
- case DW_LANG_D: case DW_LANG_Python: case DW_LANG_Go:
|
||||
+ case DW_LANG_D: case DW_LANG_Python:
|
||||
+ case DW_LANG_OpenCL: case DW_LANG_Go:
|
||||
+ case DW_LANG_Modula3: case DW_LANG_Haskell:
|
||||
+ case DW_LANG_OCaml: case DW_LANG_Rust: case DW_LANG_Swift:
|
||||
+ case DW_LANG_Julia: case DW_LANG_Dylan:
|
||||
+ case DW_LANG_RenderScript: case DW_LANG_BLISS:
|
||||
+ case DW_LANG_Kotlin: case DW_LANG_Zig:
|
||||
+ case DW_LANG_Crystal: case DW_LANG_HIP:
|
||||
+ case DW_LANG_Assembly: case DW_LANG_C_sharp:
|
||||
+ case DW_LANG_Mojo: case DW_LANG_GLSL:
|
||||
+ case DW_LANG_GLSL_ES: case DW_LANG_HLSL:
|
||||
+ case DW_LANG_OpenCL_CPP: case DW_LANG_CPP_for_OpenCL:
|
||||
+ case DW_LANG_SYCL:
|
||||
+ case DW_LANG_Odin:
|
||||
+ case DW_LANG_P4:
|
||||
+ case DW_LANG_Metal:
|
||||
+ case DW_LANG_Ruby:
|
||||
+ case DW_LANG_Move:
|
||||
+ case DW_LANG_Hylo:
|
||||
case DW_LANG_Mips_Assembler:
|
||||
parser->language = '?'; break;
|
||||
default:
|
||||
--
|
||||
2.47.1
|
||||
|
@ -0,0 +1,147 @@
|
||||
From febe1ccef09f70777b086f938c03f3e71989a7c8 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Floyd <pjfloyd@wanadoo.fr>
|
||||
Date: Tue, 7 Jan 2025 08:05:20 +0100
|
||||
Subject: [PATCH 13/14] Bug 498317 - FdBadUse is not a valid CoreError type in
|
||||
a suppression even though it's generated by --gen-suppressions=yes
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=498317
|
||||
|
||||
(cherry picked from commit 47bdc4a6f3de8e2071561d349fdd5f830388c489)
|
||||
---
|
||||
NEWS | 2 ++
|
||||
coregrind/m_errormgr.c | 7 +++++--
|
||||
coregrind/m_syswrap/syswrap-freebsd.c | 4 ++++
|
||||
none/tests/freebsd/Makefile.am | 4 +++-
|
||||
none/tests/freebsd/bug498317.c | 7 +++++++
|
||||
none/tests/freebsd/bug498317.stderr.exp | 0
|
||||
none/tests/freebsd/bug498317.supp | 8 ++++++++
|
||||
none/tests/freebsd/bug498317.vgtest | 2 ++
|
||||
9 files changed, 32 insertions(+), 3 deletions(-)
|
||||
create mode 100644 none/tests/freebsd/bug498317.c
|
||||
create mode 100644 none/tests/freebsd/bug498317.stderr.exp
|
||||
create mode 100644 none/tests/freebsd/bug498317.supp
|
||||
create mode 100644 none/tests/freebsd/bug498317.vgtest
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index a25f9b663098..2fb8ce5c724b 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -8,6 +8,8 @@ The following bugs have been fixed or resolved on this branch.
|
||||
489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset)
|
||||
494246 syscall fsopen not wrapped
|
||||
497130 Recognize new DWARF5 DW_LANG constants
|
||||
+498317 FdBadUse is not a valid CoreError type in a suppression
|
||||
+ even though it's generated by --gen-suppressions=yes
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c
|
||||
index 4bbcea02474c..2ce919482f77 100644
|
||||
--- a/coregrind/m_errormgr.c
|
||||
+++ b/coregrind/m_errormgr.c
|
||||
@@ -206,7 +206,8 @@ typedef
|
||||
// example should new core errors ever be added.
|
||||
ThreadSupp = -1, /* Matches ThreadErr */
|
||||
FdBadCloseSupp = -2,
|
||||
- FdNotClosedSupp = -3
|
||||
+ FdNotClosedSupp = -3,
|
||||
+ FdBadUseSupp = -4
|
||||
}
|
||||
CoreSuppKind;
|
||||
|
||||
@@ -1033,7 +1034,7 @@ static Bool core_error_matches_suppression(const Error* err, const Supp* su)
|
||||
return err->ekind == FdBadClose;
|
||||
case FdNotClosedSupp:
|
||||
return err->ekind == FdNotClosed;
|
||||
- case FdBadUse:
|
||||
+ case FdBadUseSupp:
|
||||
return err->ekind == FdBadUse;
|
||||
default:
|
||||
VG_(umsg)("FATAL: unknown core suppression kind: %d\n", su->skind );
|
||||
@@ -1522,6 +1523,8 @@ static void load_one_suppressions_file ( Int clo_suppressions_i )
|
||||
supp->skind = FdBadCloseSupp;
|
||||
else if (VG_STREQ(supp_name, "FdNotClosed"))
|
||||
supp->skind = FdNotClosedSupp;
|
||||
+ else if (VG_STREQ(supp_name, "FdBadUse"))
|
||||
+ supp->skind = FdBadUseSupp;
|
||||
else
|
||||
BOMB("unknown core suppression type");
|
||||
}
|
||||
diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c
|
||||
index 685eb6be076c..a2b79545594e 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-freebsd.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
|
||||
@@ -1400,6 +1400,10 @@ PRE(sys_fcntl)
|
||||
PRINT("sys_fcntl[UNKNOWN] ( %lu, %lu, %lu )", ARG1,ARG2,ARG3);
|
||||
I_die_here;
|
||||
}
|
||||
+
|
||||
+ if (!ML_(fd_allowed)(ARG1, "fcntl", tid, False)) {
|
||||
+ SET_STATUS_Failure (VKI_EBADF);
|
||||
+ }
|
||||
}
|
||||
|
||||
POST(sys_fcntl)
|
||||
diff --git a/none/tests/freebsd/Makefile.am b/none/tests/freebsd/Makefile.am
|
||||
index fe4f8db69824..1ccfefb57fe2 100644
|
||||
--- a/none/tests/freebsd/Makefile.am
|
||||
+++ b/none/tests/freebsd/Makefile.am
|
||||
@@ -11,6 +11,8 @@ EXTRA_DIST = \
|
||||
auxv.stderr.exp-freebsd131 \
|
||||
auxv.stderr.exp-freebsd14 \
|
||||
auxv.stderr.exp-arm64 \
|
||||
+ bug498317.vgtest bug498317.stderr.exp \
|
||||
+ bug498317.supp \
|
||||
cp.vgtest \
|
||||
cp.stderr.exp \
|
||||
osrel.vgtest \
|
||||
@@ -61,7 +63,7 @@ EXTRA_DIST = \
|
||||
usrstack.stdout.exp
|
||||
|
||||
check_PROGRAMS = \
|
||||
- auxv osrel swapcontext hello_world fexecve 452275 usrstack \
|
||||
+ auxv bug498317 osrel swapcontext hello_world fexecve 452275 usrstack \
|
||||
proc_pid_file sanity_level_thread umtx_shm_creat
|
||||
|
||||
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
|
||||
diff --git a/none/tests/freebsd/bug498317.c b/none/tests/freebsd/bug498317.c
|
||||
new file mode 100644
|
||||
index 000000000000..36a1a5a1365e
|
||||
--- /dev/null
|
||||
+++ b/none/tests/freebsd/bug498317.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+#include <fcntl.h>
|
||||
+
|
||||
+int main(void) {
|
||||
+ fcntl(-1, F_GETFD);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
diff --git a/none/tests/freebsd/bug498317.stderr.exp b/none/tests/freebsd/bug498317.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000000..e69de29bb2d1
|
||||
diff --git a/none/tests/freebsd/bug498317.supp b/none/tests/freebsd/bug498317.supp
|
||||
new file mode 100644
|
||||
index 000000000000..b3a99447c2a4
|
||||
--- /dev/null
|
||||
+++ b/none/tests/freebsd/bug498317.supp
|
||||
@@ -0,0 +1,8 @@
|
||||
+{
|
||||
+ test suppression of FdBadUse
|
||||
+ CoreError:FdBadUse
|
||||
+ fun:_fcntl
|
||||
+ fun:fcntl
|
||||
+ fun:main
|
||||
+}
|
||||
+
|
||||
diff --git a/none/tests/freebsd/bug498317.vgtest b/none/tests/freebsd/bug498317.vgtest
|
||||
new file mode 100644
|
||||
index 000000000000..6579ebce8c56
|
||||
--- /dev/null
|
||||
+++ b/none/tests/freebsd/bug498317.vgtest
|
||||
@@ -0,0 +1,2 @@
|
||||
+prog: bug498317
|
||||
+vgopts: -q
|
||||
--
|
||||
2.47.1
|
||||
|
@ -1,226 +0,0 @@
|
||||
From 14cefe7c645a3148165f4b2fa6095d9446e378c7 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun, 16 Jun 2024 21:23:08 +0200
|
||||
Subject: [PATCH 13/15] Don't leave fds created with --log-file, --xml-file or
|
||||
--log-socket open
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
prepare_sink_fd and prepare_sink_socket will create a new file
|
||||
descriptor for the output sink. finalize_sink_fd then copies the fd
|
||||
to the safe range, so it doesn't conflict with any application fds.
|
||||
|
||||
If we created the original fd ourselves, it was a VgLogTo_File or
|
||||
VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it.
|
||||
|
||||
Also close socket when connecting fails in VG_(connect_via_socket).
|
||||
|
||||
Add a testcase for --log-file and --xml-file which prints output to
|
||||
/dev/stderr
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=202770
|
||||
https://bugs.kde.org/show_bug.cgi?id=311655
|
||||
https://bugs.kde.org/show_bug.cgi?id=488379
|
||||
|
||||
Co-authored-by: Alexandra Hájková <ahajkova@redhat.com
|
||||
(cherry picked from commit fbd7596f8342f0b0fbbe088d960da839a8bdb839)
|
||||
---
|
||||
NEWS | 3 ++
|
||||
coregrind/m_libcfile.c | 1 +
|
||||
coregrind/m_libcprint.c | 6 ++++
|
||||
none/tests/Makefile.am | 5 ++-
|
||||
none/tests/filter_xml | 25 +++++++++++++++
|
||||
none/tests/log-track-fds.stderr.exp | 0
|
||||
none/tests/log-track-fds.vgtest | 4 +++
|
||||
none/tests/xml-track-fds.stderr.exp | 47 +++++++++++++++++++++++++++++
|
||||
none/tests/xml-track-fds.vgtest | 5 +++
|
||||
9 files changed, 95 insertions(+), 1 deletion(-)
|
||||
create mode 100755 none/tests/filter_xml
|
||||
create mode 100644 none/tests/log-track-fds.stderr.exp
|
||||
create mode 100644 none/tests/log-track-fds.vgtest
|
||||
create mode 100644 none/tests/xml-track-fds.stderr.exp
|
||||
create mode 100644 none/tests/xml-track-fds.vgtest
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index fbe0f012ef0c..10b5ae3195ca 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,11 +5,14 @@ Branch 3.23
|
||||
|
||||
The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
+202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes
|
||||
+311655 --log-file=FILE leads to apparent fd leak
|
||||
453044 gbserver_tests failures in aarch64
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
486293 memccpy false positives
|
||||
486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
487439 SIGILL in JDK11, JDK17
|
||||
+488379 --track-fds=yes errors that cannot be suppressed with --xml-file=
|
||||
n-i-bz aarch64 frinta and frinta vector instructions
|
||||
|
||||
To see details of a given bug, visit
|
||||
diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c
|
||||
index 6098bc5813a8..9635b80a6869 100644
|
||||
--- a/coregrind/m_libcfile.c
|
||||
+++ b/coregrind/m_libcfile.c
|
||||
@@ -1333,6 +1333,7 @@ Int VG_(connect_via_socket)( const HChar* str )
|
||||
res = my_connect(sd, &servAddr, sizeof(servAddr));
|
||||
if (res < 0) {
|
||||
/* connection failed */
|
||||
+ VG_(close)(sd);
|
||||
return -2;
|
||||
}
|
||||
|
||||
diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c
|
||||
index c802f814038b..593889da9d1b 100644
|
||||
--- a/coregrind/m_libcprint.c
|
||||
+++ b/coregrind/m_libcprint.c
|
||||
@@ -425,6 +425,12 @@ static void finalize_sink_fd(OutputSink *sink, Int new_fd, Bool is_xml)
|
||||
} else {
|
||||
VG_(fcntl)(safe_fd, VKI_F_SETFD, VKI_FD_CLOEXEC);
|
||||
sink->fd = safe_fd;
|
||||
+ /* If we created the new_fd (VgLogTo_File or VgLogTo_Socket), then we
|
||||
+ don't need the original file descriptor open anymore. We only need
|
||||
+ to keep it open if it was an existing fd given by the user (or
|
||||
+ stderr). */
|
||||
+ if (sink->type != VgLogTo_Fd)
|
||||
+ VG_(close)(new_fd);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
|
||||
index 185993f204bb..532cc7632a8f 100644
|
||||
--- a/none/tests/Makefile.am
|
||||
+++ b/none/tests/Makefile.am
|
||||
@@ -86,6 +86,7 @@ dist_noinst_SCRIPTS = \
|
||||
filter_none_discards \
|
||||
filter_stderr \
|
||||
filter_timestamp \
|
||||
+ filter_xml \
|
||||
allexec_prepare_prereq
|
||||
|
||||
noinst_HEADERS = fdleak.h
|
||||
@@ -229,7 +230,9 @@ EXTRA_DIST = \
|
||||
sigprocmask.stderr.exp sigprocmask.vgtest \
|
||||
socket_close.stderr.exp socket_close.vgtest \
|
||||
file_dclose.stderr.exp file_dclose.vgtest \
|
||||
- double_close_range.stderr.exp double_close_range.vgtest
|
||||
+ double_close_range.stderr.exp double_close_range.vgtest \
|
||||
+ log-track-fds.stderr.exp log-track-fds.vgtest \
|
||||
+ xml-track-fds.stderr.exp xml-track-fds.vgtest
|
||||
|
||||
|
||||
check_PROGRAMS = \
|
||||
diff --git a/none/tests/filter_xml b/none/tests/filter_xml
|
||||
new file mode 100755
|
||||
index 000000000000..d1ef570a05b0
|
||||
--- /dev/null
|
||||
+++ b/none/tests/filter_xml
|
||||
@@ -0,0 +1,25 @@
|
||||
+#! /bin/sh
|
||||
+
|
||||
+dir=`dirname $0`
|
||||
+
|
||||
+# FreeBSD adds this one extra line
|
||||
+# but after filter_xml_frames it will just be <path>...<\/path>
|
||||
+# which matches other lines, so get rid of it while we can
|
||||
+# uniquely match it
|
||||
+sed "/<path>internet<\/path>/d" |
|
||||
+
|
||||
+$dir/../../tests/filter_xml_frames |
|
||||
+perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" |
|
||||
+perl -p -e "s/<what>.*<\/what>/<what>...<\/what>/s" |
|
||||
+perl -p -e "s/<path>.*<\/path>/<path>...<\/path>/s" |
|
||||
+perl -p -e "s/<line>Copyright.*<\/line>/<line>Copyright...<\/line>/s" |
|
||||
+perl -p -e "s/<line>Using Valgrind.*<\/line>/<line>Using Valgrind...<\/line>/s" |
|
||||
+sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" |
|
||||
+sed "s/<tid>[0-9]*<\/tid>/<tid>...<\/tid>/" |
|
||||
+sed "s/<pid>[0-9]*<\/pid>/<pid>...<\/pid>/" |
|
||||
+sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" |
|
||||
+sed "s/<exe>.*<\/exe>/<exe>...<\/exe>/" |
|
||||
+sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" |
|
||||
+sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" |
|
||||
+sed "s/<unique>0x[0-9a-fA-F]*<\/unique>/<unique>0x........<\/unique>/" |
|
||||
+sed "s/<ip>0x[0-9a-fA-F]*<\/ip>/<ip>0x........<\/ip>/"
|
||||
diff --git a/none/tests/log-track-fds.stderr.exp b/none/tests/log-track-fds.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000000..e69de29bb2d1
|
||||
diff --git a/none/tests/log-track-fds.vgtest b/none/tests/log-track-fds.vgtest
|
||||
new file mode 100644
|
||||
index 000000000000..dfebb5bf3e8e
|
||||
--- /dev/null
|
||||
+++ b/none/tests/log-track-fds.vgtest
|
||||
@@ -0,0 +1,4 @@
|
||||
+# Simple test to make sure track-fds doesn't error on (internal) log-file
|
||||
+# See https://bugs.kde.org/show_bug.cgi?id=311655
|
||||
+prog: ../../tests/true
|
||||
+vgopts: -q --track-fds=yes --log-file=/dev/stderr
|
||||
diff --git a/none/tests/xml-track-fds.stderr.exp b/none/tests/xml-track-fds.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000000..b06da9d72252
|
||||
--- /dev/null
|
||||
+++ b/none/tests/xml-track-fds.stderr.exp
|
||||
@@ -0,0 +1,47 @@
|
||||
+<?xml version="1.0"?>
|
||||
+
|
||||
+<valgrindoutput>
|
||||
+
|
||||
+<protocolversion>5</protocolversion>
|
||||
+<protocoltool>none</protocoltool>
|
||||
+
|
||||
+<preamble>
|
||||
+ <line>Nulgrind, the minimal Valgrind tool</line>
|
||||
+ <line>Copyright...</line>
|
||||
+ <line>Using Valgrind...</line>
|
||||
+ <line>Command: ./../../tests/true</line>
|
||||
+</preamble>
|
||||
+
|
||||
+<pid>...</pid>
|
||||
+<ppid>...</ppid>
|
||||
+<tool>none</tool>
|
||||
+
|
||||
+<args>
|
||||
+ <vargv>
|
||||
+ <exe>...</exe>
|
||||
+ <arg>--command-line-only=yes</arg>
|
||||
+ <arg>--memcheck:leak-check=no</arg>
|
||||
+ <arg>--tool=none</arg>
|
||||
+ <arg>--track-fds=yes</arg>
|
||||
+ <arg>--xml=yes</arg>
|
||||
+ <arg>--xml-file=/dev/stderr</arg>
|
||||
+ </vargv>
|
||||
+ <argv>
|
||||
+ <exe>...</exe>
|
||||
+ </argv>
|
||||
+</args>
|
||||
+
|
||||
+<status>
|
||||
+ <state>RUNNING</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+
|
||||
+<status>
|
||||
+ <state>FINISHED</state>
|
||||
+ <time>...</time>
|
||||
+</status>
|
||||
+
|
||||
+
|
||||
+</valgrindoutput>
|
||||
+
|
||||
diff --git a/none/tests/xml-track-fds.vgtest b/none/tests/xml-track-fds.vgtest
|
||||
new file mode 100644
|
||||
index 000000000000..50f1a55a82f3
|
||||
--- /dev/null
|
||||
+++ b/none/tests/xml-track-fds.vgtest
|
||||
@@ -0,0 +1,5 @@
|
||||
+# Simple test to make sure track-fds doesn't error on (internal) xml-file
|
||||
+# See https://bugs.kde.org/show_bug.cgi?id=488379
|
||||
+prog: ../../tests/true
|
||||
+vgopts: --track-fds=yes --xml=yes --xml-file=/dev/stderr
|
||||
+stderr_filter: filter_xml
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,138 +0,0 @@
|
||||
From 0ced5269236c527d2e288b773e3684b6b1673ec2 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon, 17 Jun 2024 00:27:12 +0200
|
||||
Subject: [PATCH 14/15] Close both internal pipe fds after VG_(fork) in parent
|
||||
and child
|
||||
|
||||
An VG_fork() creates a pipe between parent and child to syncronize the
|
||||
two processes. The parent wants to register the child pid before the
|
||||
child can run. This is done in register_sigchld_ignore.
|
||||
|
||||
Make sure both the parent and the child close both the read and write
|
||||
file descriptors so none leak.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=479661
|
||||
(cherry picked from commit 1263471efdf8405cb0f1a767c6af73bf2eaf7160)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_libcproc.c | 7 +++++++
|
||||
none/tests/Makefile.am | 3 +++
|
||||
none/tests/track-fds-exec-children.c | 13 +++++++++++++
|
||||
none/tests/track-fds-exec-children.stderr.exp | 0
|
||||
none/tests/track-fds-exec-children.vgtest | 3 +++
|
||||
6 files changed, 27 insertions(+)
|
||||
create mode 100644 none/tests/track-fds-exec-children.c
|
||||
create mode 100644 none/tests/track-fds-exec-children.stderr.exp
|
||||
create mode 100644 none/tests/track-fds-exec-children.vgtest
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 10b5ae3195ca..94789a04ba9e 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes
|
||||
311655 --log-file=FILE leads to apparent fd leak
|
||||
453044 gbserver_tests failures in aarch64
|
||||
+479661 Valgrind leaks file descriptors
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
486293 memccpy false positives
|
||||
486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c
|
||||
index 11dabe768f59..8422e9d1187a 100644
|
||||
--- a/coregrind/m_libcproc.c
|
||||
+++ b/coregrind/m_libcproc.c
|
||||
@@ -905,6 +905,8 @@ static void register_sigchld_ignore ( Int pid, Int fds[2])
|
||||
return;
|
||||
|
||||
if (pid == 0) {
|
||||
+ /* We are the child, close writing fd that we don't use. */
|
||||
+ VG_(close)(fds[1]);
|
||||
/* Before proceeding, ensure parent has recorded child PID in map
|
||||
of SIGCHLD to ignore */
|
||||
while (child_wait == 1)
|
||||
@@ -916,6 +918,7 @@ static void register_sigchld_ignore ( Int pid, Int fds[2])
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Now close reading fd. */
|
||||
VG_(close)(fds[0]);
|
||||
return;
|
||||
}
|
||||
@@ -926,11 +929,15 @@ static void register_sigchld_ignore ( Int pid, Int fds[2])
|
||||
ht_sigchld_ignore = VG_(HT_construct)("ht.sigchld.ignore");
|
||||
VG_(HT_add_node)(ht_sigchld_ignore, n);
|
||||
|
||||
+ /* We are the parent process, close read fd that we don't use. */
|
||||
+ VG_(close)(fds[0]);
|
||||
+
|
||||
child_wait = 0;
|
||||
if (VG_(write)(fds[1], &child_wait, sizeof(Int)) <= 0)
|
||||
VG_(message)(Vg_DebugMsg,
|
||||
"warning: Unable to record PID of internal process (write)\n");
|
||||
|
||||
+ /* Now close writing fd. */
|
||||
VG_(close)(fds[1]);
|
||||
}
|
||||
|
||||
diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
|
||||
index 532cc7632a8f..1751ad3fa2e5 100644
|
||||
--- a/none/tests/Makefile.am
|
||||
+++ b/none/tests/Makefile.am
|
||||
@@ -223,6 +223,7 @@ EXTRA_DIST = \
|
||||
threadederrno.vgtest \
|
||||
timestamp.stderr.exp timestamp.vgtest \
|
||||
tls.vgtest tls.stderr.exp tls.stdout.exp \
|
||||
+ track-fds-exec-children.vgtest track-fds-exec-children.stderr.exp \
|
||||
unit_debuglog.stderr.exp unit_debuglog.vgtest \
|
||||
vgprintf.stderr.exp vgprintf.vgtest \
|
||||
vgprintf_nvalgrind.stderr.exp vgprintf_nvalgrind.vgtest \
|
||||
@@ -276,6 +277,7 @@ check_PROGRAMS = \
|
||||
tls \
|
||||
tls.so \
|
||||
tls2.so \
|
||||
+ track-fds-exec-children \
|
||||
unit_debuglog \
|
||||
valgrind_cpp_test \
|
||||
vgprintf \
|
||||
@@ -414,6 +416,7 @@ if VGCONF_OS_IS_DARWIN
|
||||
else
|
||||
tls2_so_LDFLAGS = -shared
|
||||
endif
|
||||
+track_fds_exec_children_SOURCES = track-fds-exec-children.c
|
||||
|
||||
vgprintf_nvalgrind_SOURCES = vgprintf.c
|
||||
vgprintf_nvalgrind_CFLAGS = ${AM_CFLAGS} -DNVALGRIND
|
||||
diff --git a/none/tests/track-fds-exec-children.c b/none/tests/track-fds-exec-children.c
|
||||
new file mode 100644
|
||||
index 000000000000..7209ee73d5b7
|
||||
--- /dev/null
|
||||
+++ b/none/tests/track-fds-exec-children.c
|
||||
@@ -0,0 +1,13 @@
|
||||
+#include <unistd.h>
|
||||
+#include <sys/wait.h>
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ pid_t pid = fork ();
|
||||
+ if (pid == 0)
|
||||
+ execlp("true", "true", NULL);
|
||||
+
|
||||
+ // Wait till true succeeds
|
||||
+ wait (NULL);
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/none/tests/track-fds-exec-children.stderr.exp b/none/tests/track-fds-exec-children.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000000..e69de29bb2d1
|
||||
diff --git a/none/tests/track-fds-exec-children.vgtest b/none/tests/track-fds-exec-children.vgtest
|
||||
new file mode 100644
|
||||
index 000000000000..aa926a6290ed
|
||||
--- /dev/null
|
||||
+++ b/none/tests/track-fds-exec-children.vgtest
|
||||
@@ -0,0 +1,3 @@
|
||||
+env: DEBUGINFOD_URLS=file:/dev/null
|
||||
+prog: track-fds-exec-children
|
||||
+vgopts: -q --track-fds=yes --trace-children=yes
|
||||
--
|
||||
2.45.2
|
||||
|
60
SOURCES/0014-linux-support-EVIOCGRAB-ioctl.patch
Normal file
60
SOURCES/0014-linux-support-EVIOCGRAB-ioctl.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From b732f86998e39ca8714330f487804428b54c481c Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Wed, 8 Jan 2025 16:52:03 +0100
|
||||
Subject: [PATCH 14/14] linux: support EVIOCGRAB ioctl
|
||||
|
||||
EVIOCGRAB just takes an int argument.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=498143
|
||||
|
||||
(cherry picked from commit 59eb5a4af60d4beb2c6910a1fa6cdf8d1f3a56f2)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_syswrap/syswrap-linux.c | 4 ++++
|
||||
include/vki/vki-linux.h | 3 +++
|
||||
3 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 2fb8ce5c724b..7f9e005c59f4 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -10,6 +10,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
497130 Recognize new DWARF5 DW_LANG constants
|
||||
498317 FdBadUse is not a valid CoreError type in a suppression
|
||||
even though it's generated by --gen-suppressions=yes
|
||||
+498143 False positive on EVIOCGRAB ioctl
|
||||
|
||||
To see details of a given bug, visit
|
||||
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 57672f167126..87ab82e6e342 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -10397,6 +10397,10 @@ PRE(sys_ioctl)
|
||||
break;
|
||||
}
|
||||
|
||||
+ case VKI_EVIOCGRAB:
|
||||
+ /* This just takes an int argument. */
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
/* EVIOC* are variable length and return size written on success */
|
||||
switch (ARG2 & ~(_VKI_IOC_SIZEMASK << _VKI_IOC_SIZESHIFT)) {
|
||||
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
|
||||
index 006f16d92201..d4e1908e1e9c 100644
|
||||
--- a/include/vki/vki-linux.h
|
||||
+++ b/include/vki/vki-linux.h
|
||||
@@ -3226,6 +3226,9 @@ struct vki_getcpu_cache {
|
||||
|
||||
#define VKI_EVIOCGBIT(ev,len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
|
||||
|
||||
+#define VKI_EVIOCGRAB _VKI_IOW('E', 0x90, int)
|
||||
+/* grab device */
|
||||
+
|
||||
/*
|
||||
* Event types
|
||||
*/
|
||||
--
|
||||
2.47.1
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 2272233d23a5431e14b3c9385d2b4b66e0e8f0fd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= <ahajkova@redhat.com>
|
||||
Date: Thu, 20 Jun 2024 07:45:56 -0400
|
||||
Subject: [PATCH 15/15] Don't allow programs calling fnctl on valgrind's own
|
||||
file descriptors
|
||||
|
||||
Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64
|
||||
and block syscalls with EBADF when the file descriptor isn't allowed
|
||||
to be used by the program.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=337388
|
||||
(cherry picked from commit 4b83e3d47daaf5eff2ca96867a8c790e13830eb5)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_syswrap/syswrap-linux.c | 8 ++++++++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 94789a04ba9e..523380a98fe5 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes
|
||||
311655 --log-file=FILE leads to apparent fd leak
|
||||
+337388 fcntl works on Valgrind's own file descriptors
|
||||
453044 gbserver_tests failures in aarch64
|
||||
479661 Valgrind leaks file descriptors
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
|
||||
index 45413fdd9ef5..9f3c51c17948 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-linux.c
|
||||
@@ -6978,6 +6978,10 @@ PRE(sys_fcntl)
|
||||
if (ARG2 == VKI_F_SETLKW)
|
||||
# endif
|
||||
*flags |= SfMayBlock;
|
||||
+
|
||||
+ if (!ML_(fd_allowed)(ARG1, "fcntl", tid, False)) {
|
||||
+ SET_STATUS_Failure (VKI_EBADF);
|
||||
+ }
|
||||
}
|
||||
|
||||
POST(sys_fcntl)
|
||||
@@ -7088,6 +7092,10 @@ PRE(sys_fcntl64)
|
||||
if (ARG2 == VKI_F_SETLKW)
|
||||
# endif
|
||||
*flags |= SfMayBlock;
|
||||
+
|
||||
+ if (!ML_(fd_allowed)(ARG1, "fcntl64", tid, False)) {
|
||||
+ SET_STATUS_Failure (VKI_EBADF);
|
||||
+ }
|
||||
}
|
||||
|
||||
POST(sys_fcntl64)
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,176 +0,0 @@
|
||||
From e1868cb600ce8f93f61c0c4cd692eba77396b492 Mon Sep 17 00:00:00 2001
|
||||
From: Petar Jovanovic <mips32r2@gmail.com>
|
||||
Date: Mon, 24 Jun 2024 10:33:46 +0000
|
||||
Subject: [PATCH 16/21] mips: skip using shared syscall numbers for mips64
|
||||
|
||||
mips does not use shared syscall numbers, so we can not use
|
||||
vki-scnums-shared-linux.h.
|
||||
|
||||
This fixes KDE #444781.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
|
||||
|
||||
(cherry picked from commit efaa17e53a750d5f0f4c138b507b1b104729ed67)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_syswrap/syswrap-mips64-linux.c | 1 +
|
||||
include/pub_tool_vkiscnums_asm.h | 1 -
|
||||
include/vki/vki-scnums-mips64-linux.h | 98 ++++++++++++++++++++++
|
||||
4 files changed, 100 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 523380a98fe5..9f4f69744086 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes
|
||||
311655 --log-file=FILE leads to apparent fd leak
|
||||
337388 fcntl works on Valgrind's own file descriptors
|
||||
+444781 MIPS: wrong syscall numbers used
|
||||
453044 gbserver_tests failures in aarch64
|
||||
479661 Valgrind leaks file descriptors
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
index 24f2bcc93956..b07b7da459e6 100644
|
||||
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
|
||||
@@ -813,6 +813,7 @@ static SyscallTableEntry syscall_main_table[] = {
|
||||
LINX_ (__NR_pwritev2, sys_pwritev2),
|
||||
LINX_ (__NR_syncfs, sys_syncfs),
|
||||
LINXY (__NR_statx, sys_statx),
|
||||
+ GENX_ (__NR_rseq, sys_ni_syscall),
|
||||
LINX_ (__NR_setns, sys_setns),
|
||||
LINXY (__NR_io_uring_setup, sys_io_uring_setup),
|
||||
LINXY (__NR_io_uring_enter, sys_io_uring_enter),
|
||||
diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h
|
||||
index d3d7dc19be9d..f97a3af3a19c 100644
|
||||
--- a/include/pub_tool_vkiscnums_asm.h
|
||||
+++ b/include/pub_tool_vkiscnums_asm.h
|
||||
@@ -70,7 +70,6 @@
|
||||
# include "vki/vki-scnums-shared-linux.h"
|
||||
|
||||
#elif defined(VGP_mips64_linux)
|
||||
-# include "vki/vki-scnums-shared-linux.h"
|
||||
# include "vki/vki-scnums-mips64-linux.h"
|
||||
|
||||
#elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
|
||||
diff --git a/include/vki/vki-scnums-mips64-linux.h b/include/vki/vki-scnums-mips64-linux.h
|
||||
index 1ae7a5dbec7a..c5291e31c654 100644
|
||||
--- a/include/vki/vki-scnums-mips64-linux.h
|
||||
+++ b/include/vki/vki-scnums-mips64-linux.h
|
||||
@@ -362,6 +362,45 @@
|
||||
#define __NR_pkey_alloc (__NR_Linux + 324)
|
||||
#define __NR_pkey_free (__NR_Linux + 325)
|
||||
#define __NR_statx (__NR_Linux + 326)
|
||||
+#define __NR_rseq (__NR_Linux + 327)
|
||||
+#define __NR_io_pgetevents (__NR_Linux + 328)
|
||||
+#define __NR_pidfd_send_signal (__NR_Linux + 424)
|
||||
+#define __NR_io_uring_setup (__NR_Linux + 425)
|
||||
+#define __NR_io_uring_enter (__NR_Linux + 426)
|
||||
+#define __NR_io_uring_register (__NR_Linux + 427)
|
||||
+#define __NR_open_tree (__NR_Linux + 428)
|
||||
+#define __NR_move_mount (__NR_Linux + 429)
|
||||
+#define __NR_fsopen (__NR_Linux + 430)
|
||||
+#define __NR_fsconfig (__NR_Linux + 431)
|
||||
+#define __NR_fsmount (__NR_Linux + 432)
|
||||
+#define __NR_fspick (__NR_Linux + 433)
|
||||
+#define __NR_pidfd_open (__NR_Linux + 434)
|
||||
+#define __NR_clone3 (__NR_Linux + 435)
|
||||
+#define __NR_close_range (__NR_Linux + 436)
|
||||
+#define __NR_openat2 (__NR_Linux + 437)
|
||||
+#define __NR_pidfd_getfd (__NR_Linux + 438)
|
||||
+#define __NR_faccessat2 (__NR_Linux + 439)
|
||||
+#define __NR_process_madvise (__NR_Linux + 440)
|
||||
+#define __NR_epoll_pwait2 (__NR_Linux + 441)
|
||||
+#define __NR_mount_setattr (__NR_Linux + 442)
|
||||
+#define __NR_quotactl_fd (__NR_Linux + 443)
|
||||
+#define __NR_landlock_create_ruleset (__NR_Linux + 444)
|
||||
+#define __NR_landlock_add_rule (__NR_Linux + 445)
|
||||
+#define __NR_landlock_restrict_self (__NR_Linux + 446)
|
||||
+#define __NR_process_mrelease (__NR_Linux + 448)
|
||||
+#define __NR_futex_waitv (__NR_Linux + 449)
|
||||
+#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
|
||||
+#define __NR_cachestat (__NR_Linux + 451)
|
||||
+#define __NR_fchmodat2 (__NR_Linux + 452)
|
||||
+#define __NR_map_shadow_stack (__NR_Linux + 453)
|
||||
+#define __NR_futex_wake (__NR_Linux + 454)
|
||||
+#define __NR_futex_wait (__NR_Linux + 455)
|
||||
+#define __NR_futex_requeue (__NR_Linux + 456)
|
||||
+#define __NR_statmount (__NR_Linux + 457)
|
||||
+#define __NR_listmount (__NR_Linux + 458)
|
||||
+#define __NR_lsm_get_self_attr (__NR_Linux + 459)
|
||||
+#define __NR_lsm_set_self_attr (__NR_Linux + 460)
|
||||
+#define __NR_lsm_list_modules (__NR_Linux + 461)
|
||||
|
||||
#elif defined(VGABI_N32)
|
||||
|
||||
@@ -701,6 +740,65 @@
|
||||
#define __NR_pkey_alloc (__NR_Linux + 328)
|
||||
#define __NR_pkey_free (__NR_Linux + 329)
|
||||
#define __NR_statx (__NR_Linux + 330)
|
||||
+#define __NR_rseq (__NR_Linux + 331)
|
||||
+#define __NR_io_pgetevents (__NR_Linux + 332)
|
||||
+#define __NR_clock_gettime64 (__NR_Linux + 403)
|
||||
+#define __NR_clock_settime64 (__NR_Linux + 404)
|
||||
+#define __NR_clock_adjtime64 (__NR_Linux + 405)
|
||||
+#define __NR_clock_getres_time64 (__NR_Linux + 406)
|
||||
+#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
|
||||
+#define __NR_timer_gettime64 (__NR_Linux + 408)
|
||||
+#define __NR_timer_settime64 (__NR_Linux + 409)
|
||||
+#define __NR_timerfd_gettime64 (__NR_Linux + 410)
|
||||
+#define __NR_timerfd_settime64 (__NR_Linux + 411)
|
||||
+#define __NR_utimensat_time64 (__NR_Linux + 412)
|
||||
+#define __NR_pselect6_time64 (__NR_Linux + 413)
|
||||
+#define __NR_ppoll_time64 (__NR_Linux + 414)
|
||||
+#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
|
||||
+#define __NR_recvmmsg_time64 (__NR_Linux + 417)
|
||||
+#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
|
||||
+#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
|
||||
+#define __NR_semtimedop_time64 (__NR_Linux + 420)
|
||||
+#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
|
||||
+#define __NR_futex_time64 (__NR_Linux + 422)
|
||||
+#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
|
||||
+#define __NR_pidfd_send_signal (__NR_Linux + 424)
|
||||
+#define __NR_io_uring_setup (__NR_Linux + 425)
|
||||
+#define __NR_io_uring_enter (__NR_Linux + 426)
|
||||
+#define __NR_io_uring_register (__NR_Linux + 427)
|
||||
+#define __NR_open_tree (__NR_Linux + 428)
|
||||
+#define __NR_move_mount (__NR_Linux + 429)
|
||||
+#define __NR_fsopen (__NR_Linux + 430)
|
||||
+#define __NR_fsconfig (__NR_Linux + 431)
|
||||
+#define __NR_fsmount (__NR_Linux + 432)
|
||||
+#define __NR_fspick (__NR_Linux + 433)
|
||||
+#define __NR_pidfd_open (__NR_Linux + 434)
|
||||
+#define __NR_clone3 (__NR_Linux + 435)
|
||||
+#define __NR_close_range (__NR_Linux + 436)
|
||||
+#define __NR_openat2 (__NR_Linux + 437)
|
||||
+#define __NR_pidfd_getfd (__NR_Linux + 438)
|
||||
+#define __NR_faccessat2 (__NR_Linux + 439)
|
||||
+#define __NR_process_madvise (__NR_Linux + 440)
|
||||
+#define __NR_epoll_pwait2 (__NR_Linux + 441)
|
||||
+#define __NR_mount_setattr (__NR_Linux + 442)
|
||||
+#define __NR_quotactl_fd (__NR_Linux + 443)
|
||||
+#define __NR_landlock_create_ruleset (__NR_Linux + 444)
|
||||
+#define __NR_landlock_add_rule (__NR_Linux + 445)
|
||||
+#define __NR_landlock_restrict_self (__NR_Linux + 446)
|
||||
+#define __NR_process_mrelease (__NR_Linux + 448)
|
||||
+#define __NR_futex_waitv (__NR_Linux + 449)
|
||||
+#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
|
||||
+#define __NR_cachestat (__NR_Linux + 451)
|
||||
+#define __NR_fchmodat2 (__NR_Linux + 452)
|
||||
+#define __NR_map_shadow_stack (__NR_Linux + 453)
|
||||
+#define __NR_futex_wake (__NR_Linux + 454)
|
||||
+#define __NR_futex_wait (__NR_Linux + 455)
|
||||
+#define __NR_futex_requeue (__NR_Linux + 456)
|
||||
+#define __NR_statmount (__NR_Linux + 457)
|
||||
+#define __NR_listmount (__NR_Linux + 458)
|
||||
+#define __NR_lsm_get_self_attr (__NR_Linux + 459)
|
||||
+#define __NR_lsm_set_self_attr (__NR_Linux + 460)
|
||||
+#define __NR_lsm_list_modules (__NR_Linux + 461)
|
||||
|
||||
#else
|
||||
#error unknown mips64 abi
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,46 +0,0 @@
|
||||
From b48fcb0bff14044caece520611233feb157401bf Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Mon, 24 Jun 2024 14:56:37 +0200
|
||||
Subject: [PATCH 17/21] gdbserver_tests filters remove python rpm module load
|
||||
warning
|
||||
|
||||
gdb on Fedora will warn not being able to load the rpm python module.
|
||||
Unable to load 'rpm' module. Please install the python3-rpm package.
|
||||
Filter out that message so tests don't fail.
|
||||
|
||||
(cherry picked from commit d6c7d47eb4c13a3d83c091d453f527a1b74cf4ef)
|
||||
---
|
||||
gdbserver_tests/filter_gdb.in | 3 +++
|
||||
gdbserver_tests/filter_vgdb.in | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in
|
||||
index 497171732b25..f0400fd18be6 100755
|
||||
--- a/gdbserver_tests/filter_gdb.in
|
||||
+++ b/gdbserver_tests/filter_gdb.in
|
||||
@@ -51,6 +51,9 @@ s/^\[?1034hReading symbols/Reading symbols/
|
||||
# Remove some Suse package manager messages
|
||||
/^Try: zypper install -C/d
|
||||
|
||||
+# Remove python rpm module load warning
|
||||
+/^Unable to load 'rpm' module. Please install the python3-rpm package./d
|
||||
+
|
||||
# Remove vgdb message
|
||||
/relaying data between gdb and process/d
|
||||
|
||||
diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in
|
||||
index 139aea2bcc52..71f1f702537e 100755
|
||||
--- a/gdbserver_tests/filter_vgdb.in
|
||||
+++ b/gdbserver_tests/filter_vgdb.in
|
||||
@@ -47,5 +47,8 @@ $SED -e '/Use.*info auto-load python-scripts.*/d' |
|
||||
$SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' |
|
||||
$SED -e "/Use .info auto-load python .REGEXP.. to list them./d" |
|
||||
|
||||
+# Remove python rpm module load warning
|
||||
+$SED -e "/^Unable to load 'rpm' module. Please install the python3-rpm package./d" |
|
||||
+
|
||||
# and filter out any remaining empty lines
|
||||
$SED -e '/^$/d'
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,318 +0,0 @@
|
||||
From 0ddeadb018a19f4033dbf63aa336561c07074688 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Sun, 30 Jun 2024 20:17:32 +0200
|
||||
Subject: [PATCH 18/21] Implement VMOVQ xmm1, xmm2/m64
|
||||
|
||||
We implemented the memory variant already, but not the reg variant.
|
||||
Add a separate avx-vmovq testcase, because avx-1 is already really big.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=391148
|
||||
https://bugs.kde.org/show_bug.cgi?id=417572
|
||||
https://bugs.kde.org/show_bug.cgi?id=489088
|
||||
|
||||
(cherry picked from commit 10a22445d747817932692b1c1ee3faa726121cb4)
|
||||
---
|
||||
.gitignore | 1 +
|
||||
NEWS | 3 +
|
||||
VEX/priv/guest_amd64_toIR.c | 10 +-
|
||||
none/tests/amd64/Makefile.am | 6 +-
|
||||
none/tests/amd64/avx-vmovq.c | 19 +++
|
||||
none/tests/amd64/avx-vmovq.stderr.exp | 0
|
||||
none/tests/amd64/avx-vmovq.stdout.exp | 162 ++++++++++++++++++++++++++
|
||||
none/tests/amd64/avx-vmovq.vgtest | 3 +
|
||||
8 files changed, 200 insertions(+), 4 deletions(-)
|
||||
create mode 100644 none/tests/amd64/avx-vmovq.c
|
||||
create mode 100644 none/tests/amd64/avx-vmovq.stderr.exp
|
||||
create mode 100644 none/tests/amd64/avx-vmovq.stdout.exp
|
||||
create mode 100644 none/tests/amd64/avx-vmovq.vgtest
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 9f4f69744086..cd89e50829bd 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -8,7 +8,9 @@ The following bugs have been fixed or resolved on this branch.
|
||||
202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes
|
||||
311655 --log-file=FILE leads to apparent fd leak
|
||||
337388 fcntl works on Valgrind's own file descriptors
|
||||
+391148 Unhandled AVX instruction vmovq %xmm9,%xmm1
|
||||
444781 MIPS: wrong syscall numbers used
|
||||
+417572 vex amd64->IR: unhandled instruction bytes: 0xC5 0x79 0xD6 0xED 0xC5
|
||||
453044 gbserver_tests failures in aarch64
|
||||
479661 Valgrind leaks file descriptors
|
||||
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
|
||||
@@ -16,6 +18,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
486569 linux inotify_init syscall wrapper missing POST entry in syscall_table
|
||||
487439 SIGILL in JDK11, JDK17
|
||||
488379 --track-fds=yes errors that cannot be suppressed with --xml-file=
|
||||
+489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5
|
||||
n-i-bz aarch64 frinta and frinta vector instructions
|
||||
|
||||
To see details of a given bug, visit
|
||||
diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c
|
||||
index 28c37f092211..57a8a434b845 100644
|
||||
--- a/VEX/priv/guest_amd64_toIR.c
|
||||
+++ b/VEX/priv/guest_amd64_toIR.c
|
||||
@@ -27015,7 +27015,6 @@ Long dis_ESC_0F__VEX (
|
||||
break;
|
||||
|
||||
case 0xD6:
|
||||
- /* I can't even find any Intel docs for this one. */
|
||||
/* Basically: 66 0F D6 = MOVQ -- move 64 bits from G (lo half
|
||||
xmm) to E (mem or lo half xmm). Looks like L==0(128), W==0
|
||||
(WIG, maybe?) */
|
||||
@@ -27024,8 +27023,15 @@ Long dis_ESC_0F__VEX (
|
||||
UChar modrm = getUChar(delta);
|
||||
UInt rG = gregOfRexRM(pfx,modrm);
|
||||
if (epartIsReg(modrm)) {
|
||||
- /* fall through, awaiting test case */
|
||||
/* dst: lo half copied, hi half zeroed */
|
||||
+ UInt rE = eregOfRexRM(pfx,modrm);
|
||||
+ putXMMRegLane64( rE, 0, getXMMRegLane64( rG, 0 ));
|
||||
+ /* zero bits 255:64 */
|
||||
+ putXMMRegLane64( rE, 1, mkU64(0) );
|
||||
+ putYMMRegLane128( rE, 1, mkV128(0) );
|
||||
+ DIP("vmovq %s,%s\n", nameXMMReg(rG), nameXMMReg(rE));
|
||||
+ delta += 1;
|
||||
+ goto decode_success;
|
||||
} else {
|
||||
addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 );
|
||||
storeLE( mkexpr(addr), getXMMRegLane64( rG, 0 ));
|
||||
diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am
|
||||
index 83029c15590c..e4d907c3dd54 100644
|
||||
--- a/none/tests/amd64/Makefile.am
|
||||
+++ b/none/tests/amd64/Makefile.am
|
||||
@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.tool-tests.am
|
||||
|
||||
dist_noinst_SCRIPTS = filter_cpuid filter_inf_nan filter_stderr gen_insn_test.pl
|
||||
|
||||
-# Used by avx-1.c and avx_estimate_insn.c
|
||||
+# Used by avx-1.c, avx-vmovq and avx_estimate_insn.c
|
||||
noinst_HEADERS = avx_tests.h
|
||||
|
||||
CLEANFILES = $(addsuffix .c,$(INSN_TESTS))
|
||||
@@ -29,6 +29,7 @@ EXTRA_DIST = \
|
||||
avx-1.vgtest avx-1.stdout.exp avx-1.stderr.exp \
|
||||
avx_estimate_insn.vgtest avx_estimate_insn.stderr.exp \
|
||||
avx_estimate_insn.stdout.exp avx_estimate_insn.stdout.exp-amd \
|
||||
+ avx-vmovq.vgtest avx-vmovq.stdout.exp avx-vmovq.stderr.exp \
|
||||
avx2-1.vgtest avx2-1.stdout.exp avx2-1.stderr.exp \
|
||||
asorep.stderr.exp asorep.stdout.exp asorep.vgtest \
|
||||
bmi.stderr.exp bmi.stdout.exp bmi.vgtest \
|
||||
@@ -131,7 +132,8 @@ endif
|
||||
if BUILD_AVX_TESTS
|
||||
if BUILD_VPCLMULQDQ_TESTS
|
||||
check_PROGRAMS += avx-1 \
|
||||
- avx_estimate_insn
|
||||
+ avx_estimate_insn \
|
||||
+ avx-vmovq
|
||||
endif
|
||||
if BUILD_FMA4_TESTS
|
||||
check_PROGRAMS += fma4
|
||||
diff --git a/none/tests/amd64/avx-vmovq.c b/none/tests/amd64/avx-vmovq.c
|
||||
new file mode 100644
|
||||
index 000000000000..da8a1959b34f
|
||||
--- /dev/null
|
||||
+++ b/none/tests/amd64/avx-vmovq.c
|
||||
@@ -0,0 +1,19 @@
|
||||
+#include"avx_tests.h"
|
||||
+
|
||||
+GEN_test_RandM(VMOVQ_XMM_to_XMM_LOW_HIGH,
|
||||
+ "vmovq %%xmm9, %%xmm7",
|
||||
+ "vmovq %%xmm8, (%%rsi)")
|
||||
+
|
||||
+// xmm0 is scratch
|
||||
+GEN_test_RandM(VMOVQ_XMM_to_XMM_LOW_LOW_HIGH,
|
||||
+ "vmovq %%xmm0, %%xmm7; vmovq %%xmm8, %%xmm0",
|
||||
+ "vmovq %%xmm0, (%%rsi); vmovq %%xmm9, %%xmm0")
|
||||
+
|
||||
+int main ( void )
|
||||
+{
|
||||
+ DO_D( VMOVQ_XMM_to_XMM_LOW_HIGH );
|
||||
+ DO_D( VMOVQ_XMM_to_XMM_LOW_LOW_HIGH );
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
diff --git a/none/tests/amd64/avx-vmovq.stderr.exp b/none/tests/amd64/avx-vmovq.stderr.exp
|
||||
new file mode 100644
|
||||
index 000000000000..e69de29bb2d1
|
||||
diff --git a/none/tests/amd64/avx-vmovq.stdout.exp b/none/tests/amd64/avx-vmovq.stdout.exp
|
||||
new file mode 100644
|
||||
index 000000000000..f5b45e54de79
|
||||
--- /dev/null
|
||||
+++ b/none/tests/amd64/avx-vmovq.stdout.exp
|
||||
@@ -0,0 +1,162 @@
|
||||
+VMOVQ_XMM_to_XMM_LOW_HIGH(reg)
|
||||
+ before
|
||||
+ 7d6528c5fa956a0d.69c3e9a6af27d13b.5175e39d19c9ca1e.98f24a4984175700
|
||||
+ b6d2fb5aa7bc5127.fe9915e556a044b2.60b160857d45c484.47b8d8c0eeef1e50
|
||||
+ 065d77195d623e6b.842adc6450659e17.19a348215c3a67fd.399182c2dbcc2d38
|
||||
+ cb509970b8136c85.d740b80eb7839b97.d89998df5035ed36.4a4bc43968bc40e5
|
||||
+ 56b01a12b0ca1583
|
||||
+ after
|
||||
+ 0000000000000000.0000000000000000.0000000000000000.4a4bc43968bc40e5
|
||||
+ b6d2fb5aa7bc5127.fe9915e556a044b2.60b160857d45c484.47b8d8c0eeef1e50
|
||||
+ 065d77195d623e6b.842adc6450659e17.19a348215c3a67fd.399182c2dbcc2d38
|
||||
+ cb509970b8136c85.d740b80eb7839b97.d89998df5035ed36.4a4bc43968bc40e5
|
||||
+ 56b01a12b0ca1583
|
||||
+VMOVQ_XMM_to_XMM_LOW_HIGH(mem)
|
||||
+ before
|
||||
+ 398e0039cf03663d.5ff85bc9535c191f.d3a727d1a705f65d.f9dd4a29f8c093db
|
||||
+ cfaff39be272ef40.20a1bb92cbc97fe8.542da4983df76c96.d8bc5c6dee699597
|
||||
+ f4e06e2205236eb7.6897b536bbe4da8a.369dab4f9465b86e.d182c916cebc2e17
|
||||
+ 84ededbc53239dcf.95264321bf3b68b2.55c2b9e2c95c9810.407b8d9035449b06
|
||||
+ 81f2a547be8d1811
|
||||
+ after
|
||||
+ 398e0039cf03663d.5ff85bc9535c191f.d3a727d1a705f65d.d8bc5c6dee699597
|
||||
+ cfaff39be272ef40.20a1bb92cbc97fe8.542da4983df76c96.d8bc5c6dee699597
|
||||
+ f4e06e2205236eb7.6897b536bbe4da8a.369dab4f9465b86e.d182c916cebc2e17
|
||||
+ 84ededbc53239dcf.95264321bf3b68b2.55c2b9e2c95c9810.407b8d9035449b06
|
||||
+ 81f2a547be8d1811
|
||||
+
|
||||
+VMOVQ_XMM_to_XMM_LOW_HIGH(reg)
|
||||
+ before
|
||||
+ f0350ca70523e0e4.5ba1ec54e87d39b3.019963bf7459630b.8d69483df7e8c6a9
|
||||
+ e98ebd1ca893312a.54cae7d5e13dfe91.0a3e0f7c75cb0842.b95ed64d3b13ff64
|
||||
+ c84ab71340684590.4d325b2d5a70a792.0a5f45c55f1c9202.b76ddefcb0ebfe6e
|
||||
+ e9b5f3f66b2e58c1.21a6c3476d21f1e5.5f490104ced83ff8.6262dd37727c80f3
|
||||
+ 96084deb9ed0411e
|
||||
+ after
|
||||
+ 0000000000000000.0000000000000000.0000000000000000.6262dd37727c80f3
|
||||
+ e98ebd1ca893312a.54cae7d5e13dfe91.0a3e0f7c75cb0842.b95ed64d3b13ff64
|
||||
+ c84ab71340684590.4d325b2d5a70a792.0a5f45c55f1c9202.b76ddefcb0ebfe6e
|
||||
+ e9b5f3f66b2e58c1.21a6c3476d21f1e5.5f490104ced83ff8.6262dd37727c80f3
|
||||
+ 96084deb9ed0411e
|
||||
+VMOVQ_XMM_to_XMM_LOW_HIGH(mem)
|
||||
+ before
|
||||
+ 2e2dac0350f6fd1c.a81b6e33c572a86a.acf29b0f395c98b4.63483da65c8c49d0
|
||||
+ 089b756aa3f77018.61c82534e9bf6f37.c9e25f72d82e582b.73a8f718a8c3ec35
|
||||
+ ff1f240eb3e1553f.6f07136773a2ead3.56428c5a66a2ec77.ecb42ac54b0966d4
|
||||
+ ee8536da9dbf68bc.3026343700a654eb.2ddd9db4ffc411c4.28bad218e4ebf159
|
||||
+ 8404eb7f0cf4ca6f
|
||||
+ after
|
||||
+ 2e2dac0350f6fd1c.a81b6e33c572a86a.acf29b0f395c98b4.73a8f718a8c3ec35
|
||||
+ 089b756aa3f77018.61c82534e9bf6f37.c9e25f72d82e582b.73a8f718a8c3ec35
|
||||
+ ff1f240eb3e1553f.6f07136773a2ead3.56428c5a66a2ec77.ecb42ac54b0966d4
|
||||
+ ee8536da9dbf68bc.3026343700a654eb.2ddd9db4ffc411c4.28bad218e4ebf159
|
||||
+ 8404eb7f0cf4ca6f
|
||||
+
|
||||
+VMOVQ_XMM_to_XMM_LOW_HIGH(reg)
|
||||
+ before
|
||||
+ 5cdf726562b02dc2.b39925ba7d9d67bc.ff6f850f2c57ea2a.2c810e6dc1a1833d
|
||||
+ 0c9761367fac55ff.28276f9a6e880c6b.372f015d9242e83d.2ef85b6fc544fd0f
|
||||
+ f078b65e01737fd2.2bfa8f668c8b14f4.36b2a38dcef18acf.0e0f01a829ba3c66
|
||||
+ 65ce6d498492e7e7.96df010bf4b23b84.57436a097df30b8d.aa927a03090dfc6d
|
||||
+ dc4c446c804bf950
|
||||
+ after
|
||||
+ 0000000000000000.0000000000000000.0000000000000000.aa927a03090dfc6d
|
||||
+ 0c9761367fac55ff.28276f9a6e880c6b.372f015d9242e83d.2ef85b6fc544fd0f
|
||||
+ f078b65e01737fd2.2bfa8f668c8b14f4.36b2a38dcef18acf.0e0f01a829ba3c66
|
||||
+ 65ce6d498492e7e7.96df010bf4b23b84.57436a097df30b8d.aa927a03090dfc6d
|
||||
+ dc4c446c804bf950
|
||||
+VMOVQ_XMM_to_XMM_LOW_HIGH(mem)
|
||||
+ before
|
||||
+ 810bdacfab80ee3d.c5e48064a393c8e9.47a34273c10a3c47.f5304f3e3ad1a923
|
||||
+ 769ab818a5b7985e.6d08ed19fa045f84.1810cd8c109ed568.6ec34f98a2199d3c
|
||||
+ 95c45b338afcb3df.b984aed62671e865.e6f21d40fc7bc013.1c4a678450562685
|
||||
+ bc563e0c775bfaed.05a5c205c3659f38.8e17b17da2acb976.5d0f926ce1157eaa
|
||||
+ 8b5fccbef0e1e256
|
||||
+ after
|
||||
+ 810bdacfab80ee3d.c5e48064a393c8e9.47a34273c10a3c47.6ec34f98a2199d3c
|
||||
+ 769ab818a5b7985e.6d08ed19fa045f84.1810cd8c109ed568.6ec34f98a2199d3c
|
||||
+ 95c45b338afcb3df.b984aed62671e865.e6f21d40fc7bc013.1c4a678450562685
|
||||
+ bc563e0c775bfaed.05a5c205c3659f38.8e17b17da2acb976.5d0f926ce1157eaa
|
||||
+ 8b5fccbef0e1e256
|
||||
+
|
||||
+VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg)
|
||||
+ before
|
||||
+ 048612e51a468e36.c51cdd8f87e12ab4.acb722146c6cbfa9.ea4a022e1d3d7dbb
|
||||
+ 22cf5e4cfad1bdf5.8de2b4a9d799ff5f.0c05cb6ebd128663.d7568e3e8a3ac80e
|
||||
+ 4288ae612c0dad40.f0733f448390351b.80ddba7e53e42d12.3208cf9b04b0569c
|
||||
+ c1fbfd8f4d8698c2.cb9dfb4ea5d18713.6489eab2c96df363.d52c4330a7aae391
|
||||
+ 9d8e66ea90352a18
|
||||
+ after
|
||||
+ 0000000000000000.0000000000000000.0000000000000000.2525252525252525
|
||||
+ 22cf5e4cfad1bdf5.8de2b4a9d799ff5f.0c05cb6ebd128663.d7568e3e8a3ac80e
|
||||
+ 4288ae612c0dad40.f0733f448390351b.80ddba7e53e42d12.3208cf9b04b0569c
|
||||
+ c1fbfd8f4d8698c2.cb9dfb4ea5d18713.6489eab2c96df363.d52c4330a7aae391
|
||||
+ 9d8e66ea90352a18
|
||||
+VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem)
|
||||
+ before
|
||||
+ 66fab2b3db5ce85e.f9754842f9c9ba28.f82a63b15c68b274.14575775bc3a1202
|
||||
+ 0c3ca578a32bd88e.474289e7cb61501e.54e7f35bc162726a.ec91fe34c7d6c79a
|
||||
+ 6b1fba2604afb8d5.08aebee85fda964f.bba02737f3c98220.4784d95987cd4ed8
|
||||
+ 5f706da71bf2425f.9605e2b252c1c868.09217c310baca0c3.837be65197abe268
|
||||
+ fbc4208894fdc0f5
|
||||
+ after
|
||||
+ 66fab2b3db5ce85e.f9754842f9c9ba28.f82a63b15c68b274.2525252525252525
|
||||
+ 0c3ca578a32bd88e.474289e7cb61501e.54e7f35bc162726a.ec91fe34c7d6c79a
|
||||
+ 6b1fba2604afb8d5.08aebee85fda964f.bba02737f3c98220.4784d95987cd4ed8
|
||||
+ 5f706da71bf2425f.9605e2b252c1c868.09217c310baca0c3.837be65197abe268
|
||||
+ fbc4208894fdc0f5
|
||||
+
|
||||
+VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg)
|
||||
+ before
|
||||
+ 0aaa836b194e242c.c5fc3ae904033357.4e92f1b240a12214.1a366d352714867e
|
||||
+ 0e780c65c22b4ab8.778d9ed6d9eb46ea.8ca3e752c306df00.caab752f630ff07e
|
||||
+ 627bb6e12d1f6d46.51ef145cb9b83843.ac82c1007a7d3cd8.f54b130cdaa89cef
|
||||
+ 61ff7d4df3b6ca81.31f01866bd76c58f.0a7c7a27fe917447.77e3c0b6a9ec44fc
|
||||
+ 2c3ffa1aebe6a4d2
|
||||
+ after
|
||||
+ 0000000000000000.0000000000000000.0000000000000000.2525252525252525
|
||||
+ 0e780c65c22b4ab8.778d9ed6d9eb46ea.8ca3e752c306df00.caab752f630ff07e
|
||||
+ 627bb6e12d1f6d46.51ef145cb9b83843.ac82c1007a7d3cd8.f54b130cdaa89cef
|
||||
+ 61ff7d4df3b6ca81.31f01866bd76c58f.0a7c7a27fe917447.77e3c0b6a9ec44fc
|
||||
+ 2c3ffa1aebe6a4d2
|
||||
+VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem)
|
||||
+ before
|
||||
+ f02b3b25bca27a9c.69505d14b27d9d16.f25b26e0042fa9fa.02dd0e32eecfc5fa
|
||||
+ 9f7301c1392d8087.d4ba52a206ff21b1.70fbbab6a7f19faf.f0f1798fe3c1699c
|
||||
+ 15e3c8dc7e9273bf.0088596389c893fd.879d51d4c5c764db.3004b7a97cf69dda
|
||||
+ 2d460a61a5dd0f6f.47086cc3da642fa7.130d662777beb4a9.1e61c5ec52f79c60
|
||||
+ 16559ec50352a3d9
|
||||
+ after
|
||||
+ f02b3b25bca27a9c.69505d14b27d9d16.f25b26e0042fa9fa.2525252525252525
|
||||
+ 9f7301c1392d8087.d4ba52a206ff21b1.70fbbab6a7f19faf.f0f1798fe3c1699c
|
||||
+ 15e3c8dc7e9273bf.0088596389c893fd.879d51d4c5c764db.3004b7a97cf69dda
|
||||
+ 2d460a61a5dd0f6f.47086cc3da642fa7.130d662777beb4a9.1e61c5ec52f79c60
|
||||
+ 16559ec50352a3d9
|
||||
+
|
||||
+VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg)
|
||||
+ before
|
||||
+ 742c3e9e2b92eef2.c569453ccd1b0fc4.0784892e9360315b.f0177599dbe14b46
|
||||
+ 9432a2e46543b956.b819f459105730e9.9a49ac115048d4c4.f987fa170d3ce4dd
|
||||
+ d2b3c4044ef23fb2.e22093a48a9d2e0b.5da3cfd6aea6558e.0c28728e28dc3c9c
|
||||
+ 89fba268812abdb2.1e4a9e0958fac555.adddf0eb4808f067.04c857e949cc0fac
|
||||
+ bc3127138b19183c
|
||||
+ after
|
||||
+ 0000000000000000.0000000000000000.0000000000000000.2525252525252525
|
||||
+ 9432a2e46543b956.b819f459105730e9.9a49ac115048d4c4.f987fa170d3ce4dd
|
||||
+ d2b3c4044ef23fb2.e22093a48a9d2e0b.5da3cfd6aea6558e.0c28728e28dc3c9c
|
||||
+ 89fba268812abdb2.1e4a9e0958fac555.adddf0eb4808f067.04c857e949cc0fac
|
||||
+ bc3127138b19183c
|
||||
+VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem)
|
||||
+ before
|
||||
+ 12305efa0acd1475.1755377e9a786f01.4a6592749579b0f4.e4450ababbfae0f9
|
||||
+ e1917689e3f6bf86.d70f7fb13667914c.413cead25e27ac14.5f2619b1a20662f0
|
||||
+ 0420edac31a0d599.2573776df1835e3e.de9a220dce0e75e0.7acb193b9abab2f9
|
||||
+ 59a93d4f11d611db.5cce191e65591384.ff4cb613013cc685.918107c43ea20cc0
|
||||
+ 0194ddb82b49abf0
|
||||
+ after
|
||||
+ 12305efa0acd1475.1755377e9a786f01.4a6592749579b0f4.2525252525252525
|
||||
+ e1917689e3f6bf86.d70f7fb13667914c.413cead25e27ac14.5f2619b1a20662f0
|
||||
+ 0420edac31a0d599.2573776df1835e3e.de9a220dce0e75e0.7acb193b9abab2f9
|
||||
+ 59a93d4f11d611db.5cce191e65591384.ff4cb613013cc685.918107c43ea20cc0
|
||||
+ 0194ddb82b49abf0
|
||||
+
|
||||
diff --git a/none/tests/amd64/avx-vmovq.vgtest b/none/tests/amd64/avx-vmovq.vgtest
|
||||
new file mode 100644
|
||||
index 000000000000..ba4f5caaf2ad
|
||||
--- /dev/null
|
||||
+++ b/none/tests/amd64/avx-vmovq.vgtest
|
||||
@@ -0,0 +1,3 @@
|
||||
+prog: avx-vmovq
|
||||
+prereq: test -x avx-vmovq && ../../../tests/x86_amd64_features amd64-avx
|
||||
+vgopts: -q
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,258 +0,0 @@
|
||||
From 323a62b56b828d59eece2336af9ee6abf473d712 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu@mailbox.org>
|
||||
Date: Thu, 27 Jun 2024 22:51:09 +0200
|
||||
Subject: [PATCH 19/21] arm64: Fix fcvtas instruction.
|
||||
|
||||
(cherry picked from commit de4c79ffbcd2d5e89495cee8feadf77d5f3a6ef2)
|
||||
---
|
||||
NEWS | 1 +
|
||||
VEX/priv/guest_arm64_toIR.c | 74 ++++++++++++++++++++-----------------
|
||||
VEX/priv/host_arm64_defs.c | 23 +++++++-----
|
||||
VEX/priv/host_arm64_defs.h | 3 +-
|
||||
VEX/priv/host_arm64_isel.c | 12 +++---
|
||||
5 files changed, 65 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index cd89e50829bd..d1419b9d3c12 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -19,6 +19,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
487439 SIGILL in JDK11, JDK17
|
||||
488379 --track-fds=yes errors that cannot be suppressed with --xml-file=
|
||||
489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5
|
||||
+489338 arm64: Instruction fcvtas should round 322.5 to 323, but result is 322.
|
||||
n-i-bz aarch64 frinta and frinta vector instructions
|
||||
|
||||
To see details of a given bug, visit
|
||||
diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c
|
||||
index 27d945d6328d..750383e1eb0f 100644
|
||||
--- a/VEX/priv/guest_arm64_toIR.c
|
||||
+++ b/VEX/priv/guest_arm64_toIR.c
|
||||
@@ -15533,7 +15533,7 @@ Bool dis_AdvSIMD_fp_to_from_int_conv(/*MB_OUT*/DisResult* dres, UInt insn)
|
||||
} else {
|
||||
vassert(op == BITS3(1,0,0) || op == BITS3(1,0,1));
|
||||
switch (rm) {
|
||||
- case BITS2(0,0): ch = 'a'; irrm = Irrm_NEAREST; break;
|
||||
+ case BITS2(0,0): ch = 'a'; irrm = Irrm_NEAREST_TIE_AWAY_0; break;
|
||||
default: vassert(0);
|
||||
}
|
||||
}
|
||||
@@ -15557,45 +15557,53 @@ Bool dis_AdvSIMD_fp_to_from_int_conv(/*MB_OUT*/DisResult* dres, UInt insn)
|
||||
IROp iop = iops[ix];
|
||||
// A bit of ATCery: bounce all cases we haven't seen an example of.
|
||||
if (/* F32toI32S */
|
||||
- (iop == Iop_F32toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Sn */
|
||||
- || (iop == Iop_F32toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Sn */
|
||||
- || (iop == Iop_F32toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Sn */
|
||||
- || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST)/* FCVT{A,N}S W,S */
|
||||
+ (iop == Iop_F32toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Sn */
|
||||
+ || (iop == Iop_F32toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Sn */
|
||||
+ || (iop == Iop_F32toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Sn */
|
||||
+ || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST) /* FCVTNS W,S */
|
||||
+ || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS W,S */
|
||||
/* F32toI32U */
|
||||
- || (iop == Iop_F32toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Sn */
|
||||
- || (iop == Iop_F32toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Sn */
|
||||
- || (iop == Iop_F32toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Sn */
|
||||
- || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST)/* FCVT{A,N}U W,S */
|
||||
+ || (iop == Iop_F32toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Sn */
|
||||
+ || (iop == Iop_F32toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Sn */
|
||||
+ || (iop == Iop_F32toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Sn */
|
||||
+ || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST) /* FCVTNU W,S */
|
||||
+ || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU W,S */
|
||||
/* F32toI64S */
|
||||
- || (iop == Iop_F32toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Sn */
|
||||
- || (iop == Iop_F32toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Sn */
|
||||
- || (iop == Iop_F32toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Sn */
|
||||
- || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST)/* FCVT{A,N}S X,S */
|
||||
+ || (iop == Iop_F32toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Sn */
|
||||
+ || (iop == Iop_F32toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Sn */
|
||||
+ || (iop == Iop_F32toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Sn */
|
||||
+ || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST) /* FCVTNS X,S */
|
||||
+ || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS X,S */
|
||||
/* F32toI64U */
|
||||
- || (iop == Iop_F32toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Sn */
|
||||
- || (iop == Iop_F32toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Sn */
|
||||
- || (iop == Iop_F32toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Sn */
|
||||
- || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST)/* FCVT{A,N}U X,S */
|
||||
+ || (iop == Iop_F32toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Sn */
|
||||
+ || (iop == Iop_F32toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Sn */
|
||||
+ || (iop == Iop_F32toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Sn */
|
||||
+ || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST) /* FCVTNU X,S */
|
||||
+ || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU X,S */
|
||||
/* F64toI32S */
|
||||
- || (iop == Iop_F64toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Dn */
|
||||
- || (iop == Iop_F64toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Dn */
|
||||
- || (iop == Iop_F64toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Dn */
|
||||
- || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST)/* FCVT{A,N}S W,D */
|
||||
+ || (iop == Iop_F64toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Dn */
|
||||
+ || (iop == Iop_F64toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Dn */
|
||||
+ || (iop == Iop_F64toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Dn */
|
||||
+ || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST) /* FCVTNS W,D */
|
||||
+ || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS W,D */
|
||||
/* F64toI32U */
|
||||
- || (iop == Iop_F64toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Dn */
|
||||
- || (iop == Iop_F64toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Dn */
|
||||
- || (iop == Iop_F64toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Dn */
|
||||
- || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST)/* FCVT{A,N}U W,D */
|
||||
+ || (iop == Iop_F64toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Dn */
|
||||
+ || (iop == Iop_F64toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Dn */
|
||||
+ || (iop == Iop_F64toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Dn */
|
||||
+ || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST) /* FCVTNU W,D */
|
||||
+ || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU W,D */
|
||||
/* F64toI64S */
|
||||
- || (iop == Iop_F64toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Dn */
|
||||
- || (iop == Iop_F64toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Dn */
|
||||
- || (iop == Iop_F64toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Dn */
|
||||
- || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST)/* FCVT{A,N}S X,D */
|
||||
+ || (iop == Iop_F64toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Dn */
|
||||
+ || (iop == Iop_F64toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Dn */
|
||||
+ || (iop == Iop_F64toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Dn */
|
||||
+ || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST) /* FCVTNS X,D */
|
||||
+ || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS X,D */
|
||||
/* F64toI64U */
|
||||
- || (iop == Iop_F64toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Dn */
|
||||
- || (iop == Iop_F64toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Dn */
|
||||
- || (iop == Iop_F64toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Dn */
|
||||
- || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST)/* FCVT{A,N}U X,D */
|
||||
+ || (iop == Iop_F64toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Dn */
|
||||
+ || (iop == Iop_F64toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Dn */
|
||||
+ || (iop == Iop_F64toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Dn */
|
||||
+ || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST) /* FCVTNU X,D */
|
||||
+ || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU X,D */
|
||||
) {
|
||||
/* validated */
|
||||
} else {
|
||||
diff --git a/VEX/priv/host_arm64_defs.c b/VEX/priv/host_arm64_defs.c
|
||||
index 0b59c87cd3bd..dc5d198e0dc3 100644
|
||||
--- a/VEX/priv/host_arm64_defs.c
|
||||
+++ b/VEX/priv/host_arm64_defs.c
|
||||
@@ -1142,13 +1142,14 @@ ARM64Instr* ARM64Instr_VCvtI2F ( ARM64CvtOp how, HReg rD, HReg rS ) {
|
||||
return i;
|
||||
}
|
||||
ARM64Instr* ARM64Instr_VCvtF2I ( ARM64CvtOp how, HReg rD, HReg rS,
|
||||
- UChar armRM ) {
|
||||
+ UChar armRM, Bool tiesToAway ) {
|
||||
ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
|
||||
i->tag = ARM64in_VCvtF2I;
|
||||
i->ARM64in.VCvtF2I.how = how;
|
||||
i->ARM64in.VCvtF2I.rD = rD;
|
||||
i->ARM64in.VCvtF2I.rS = rS;
|
||||
i->ARM64in.VCvtF2I.armRM = armRM;
|
||||
+ i->ARM64in.VCvtF2I.tiesToAway = tiesToAway;
|
||||
vassert(armRM <= 3);
|
||||
return i;
|
||||
}
|
||||
@@ -4463,47 +4464,51 @@ Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc,
|
||||
---------------- 01 -------------- FCVTP-------- (round to +inf)
|
||||
---------------- 10 -------------- FCVTM-------- (round to -inf)
|
||||
---------------- 11 -------------- FCVTZ-------- (round to zero)
|
||||
+ ---------------- 00 100 ---------- FCVTAS------- (nearest, ties away)
|
||||
+ ---------------- 00 101 ---------- FCVTAU------- (nearest, ties away)
|
||||
|
||||
Rd is Xd when sf==1, Wd when sf==0
|
||||
Fn is Dn when x==1, Sn when x==0
|
||||
20:19 carry the rounding mode, using the same encoding as FPCR
|
||||
+ 18 enable translation to FCVTA{S,U}
|
||||
*/
|
||||
UInt rD = iregEnc(i->ARM64in.VCvtF2I.rD);
|
||||
UInt rN = dregEnc(i->ARM64in.VCvtF2I.rS);
|
||||
ARM64CvtOp how = i->ARM64in.VCvtF2I.how;
|
||||
UChar armRM = i->ARM64in.VCvtF2I.armRM;
|
||||
+ UChar bit18 = i->ARM64in.VCvtF2I.tiesToAway ? 4 : 0;
|
||||
/* Just handle cases as they show up. */
|
||||
switch (how) {
|
||||
case ARM64cvt_F64_I32S: /* FCVTxS Wd, Dn */
|
||||
- *p++ = X_3_5_8_6_5_5(X000, X11110, X01100000 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X000, X11110, X01100000 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F64_I32U: /* FCVTxU Wd, Dn */
|
||||
- *p++ = X_3_5_8_6_5_5(X000, X11110, X01100001 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X000, X11110, X01100001 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F64_I64S: /* FCVTxS Xd, Dn */
|
||||
- *p++ = X_3_5_8_6_5_5(X100, X11110, X01100000 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X100, X11110, X01100000 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F64_I64U: /* FCVTxU Xd, Dn */
|
||||
- *p++ = X_3_5_8_6_5_5(X100, X11110, X01100001 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X100, X11110, X01100001 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F32_I32S: /* FCVTxS Wd, Sn */
|
||||
- *p++ = X_3_5_8_6_5_5(X000, X11110, X00100000 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X000, X11110, X00100000 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F32_I32U: /* FCVTxU Wd, Sn */
|
||||
- *p++ = X_3_5_8_6_5_5(X000, X11110, X00100001 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X000, X11110, X00100001 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F32_I64S: /* FCVTxS Xd, Sn */
|
||||
- *p++ = X_3_5_8_6_5_5(X100, X11110, X00100000 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X100, X11110, X00100000 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
case ARM64cvt_F32_I64U: /* FCVTxU Xd, Sn */
|
||||
- *p++ = X_3_5_8_6_5_5(X100, X11110, X00100001 | (armRM << 3),
|
||||
+ *p++ = X_3_5_8_6_5_5(X100, X11110, X00100001 | (armRM << 3) | bit18,
|
||||
X000000, rN, rD);
|
||||
break;
|
||||
default:
|
||||
diff --git a/VEX/priv/host_arm64_defs.h b/VEX/priv/host_arm64_defs.h
|
||||
index e78d8045ffaa..f24a2f4ba654 100644
|
||||
--- a/VEX/priv/host_arm64_defs.h
|
||||
+++ b/VEX/priv/host_arm64_defs.h
|
||||
@@ -816,6 +816,7 @@ typedef
|
||||
HReg rS; // src, a D or S register
|
||||
UChar armRM; // ARM encoded RM:
|
||||
// 00=nearest, 01=+inf, 10=-inf, 11=zero
|
||||
+ Bool tiesToAway;
|
||||
} VCvtF2I;
|
||||
/* Convert between 32-bit and 64-bit FP values (both ways). (FCVT) */
|
||||
struct {
|
||||
@@ -1062,7 +1063,7 @@ extern ARM64Instr* ARM64Instr_VLdStD ( Bool isLoad, HReg dD, HReg rN,
|
||||
extern ARM64Instr* ARM64Instr_VLdStQ ( Bool isLoad, HReg rQ, HReg rN );
|
||||
extern ARM64Instr* ARM64Instr_VCvtI2F ( ARM64CvtOp how, HReg rD, HReg rS );
|
||||
extern ARM64Instr* ARM64Instr_VCvtF2I ( ARM64CvtOp how, HReg rD, HReg rS,
|
||||
- UChar armRM );
|
||||
+ UChar armRM, Bool tiesToAway );
|
||||
extern ARM64Instr* ARM64Instr_VCvtSD ( Bool sToD, HReg dst, HReg src );
|
||||
extern ARM64Instr* ARM64Instr_VCvtHS ( Bool hToS, HReg dst, HReg src );
|
||||
extern ARM64Instr* ARM64Instr_VCvtHD ( Bool hToD, HReg dst, HReg src );
|
||||
diff --git a/VEX/priv/host_arm64_isel.c b/VEX/priv/host_arm64_isel.c
|
||||
index 645358586f34..34c526559010 100644
|
||||
--- a/VEX/priv/host_arm64_isel.c
|
||||
+++ b/VEX/priv/host_arm64_isel.c
|
||||
@@ -1921,17 +1921,19 @@ static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e )
|
||||
UInt irrm = arg1con->Ico.U32;
|
||||
/* Find the ARM-encoded equivalent for |irrm|. */
|
||||
UInt armrm = 4; /* impossible */
|
||||
+ Bool tiesToAway = False;
|
||||
switch (irrm) {
|
||||
- case Irrm_NEAREST: armrm = 0; break;
|
||||
- case Irrm_NegINF: armrm = 2; break;
|
||||
- case Irrm_PosINF: armrm = 1; break;
|
||||
- case Irrm_ZERO: armrm = 3; break;
|
||||
+ case Irrm_NEAREST: armrm = 0; break;
|
||||
+ case Irrm_NegINF: armrm = 2; break;
|
||||
+ case Irrm_PosINF: armrm = 1; break;
|
||||
+ case Irrm_ZERO: armrm = 3; break;
|
||||
+ case Irrm_NEAREST_TIE_AWAY_0: armrm = 0; tiesToAway = True; break;
|
||||
default: goto irreducible;
|
||||
}
|
||||
HReg src = (srcIsD ? iselDblExpr : iselFltExpr)
|
||||
(env, e->Iex.Binop.arg2);
|
||||
HReg dst = newVRegI(env);
|
||||
- addInstr(env, ARM64Instr_VCvtF2I(cvt_op, dst, src, armrm));
|
||||
+ addInstr(env, ARM64Instr_VCvtF2I(cvt_op, dst, src, armrm, tiesToAway));
|
||||
return dst;
|
||||
}
|
||||
} /* local scope */
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,52 +0,0 @@
|
||||
From fdd27bab5f134fda0098f9c3a5c36199e3205fea Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu, 4 Jul 2024 18:04:18 +0200
|
||||
Subject: [PATCH 20/21] gdbserver_tests filters remove more verbose python rpm
|
||||
load warnings
|
||||
|
||||
The rpm python load warnings on Fedora became even more verbose.
|
||||
Filter out all stderr messages related to them so tests don't fail.
|
||||
|
||||
(cherry picked from commit d73a8e745bf09cfc2d44e14f2ddd70fae2893d1d)
|
||||
---
|
||||
gdbserver_tests/filter_gdb.in | 5 ++++-
|
||||
gdbserver_tests/filter_vgdb.in | 7 +++++--
|
||||
2 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in
|
||||
index f0400fd18be6..38a3803eb1f8 100755
|
||||
--- a/gdbserver_tests/filter_gdb.in
|
||||
+++ b/gdbserver_tests/filter_gdb.in
|
||||
@@ -52,7 +52,10 @@ s/^\[?1034hReading symbols/Reading symbols/
|
||||
/^Try: zypper install -C/d
|
||||
|
||||
# Remove python rpm module load warning
|
||||
-/^Unable to load 'rpm' module. Please install the python3-rpm package./d
|
||||
+/^Unable to load /d
|
||||
+/^the RPM suggestions /d
|
||||
+/^installing missing debuginfo /d
|
||||
+/^please install /d
|
||||
|
||||
# Remove vgdb message
|
||||
/relaying data between gdb and process/d
|
||||
diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in
|
||||
index 71f1f702537e..b32be689733b 100755
|
||||
--- a/gdbserver_tests/filter_vgdb.in
|
||||
+++ b/gdbserver_tests/filter_vgdb.in
|
||||
@@ -47,8 +47,11 @@ $SED -e '/Use.*info auto-load python-scripts.*/d' |
|
||||
$SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' |
|
||||
$SED -e "/Use .info auto-load python .REGEXP.. to list them./d" |
|
||||
|
||||
-# Remove python rpm module load warning
|
||||
-$SED -e "/^Unable to load 'rpm' module. Please install the python3-rpm package./d" |
|
||||
+# Remove python rpm module load warnings
|
||||
+$SED -e "/^Unable to load /d" |
|
||||
+$SED -e "/^the RPM suggestions /d" |
|
||||
+$SED -e "/^installing missing debuginfo /d" |
|
||||
+$SED -e "/^please install /d" |
|
||||
|
||||
# and filter out any remaining empty lines
|
||||
$SED -e '/^$/d'
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,74 +0,0 @@
|
||||
From a62058256f2c1bbc00757dfe89d505d5c6eb9906 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Thu, 4 Jul 2024 15:21:39 +0200
|
||||
Subject: [PATCH 21/21] Avoid dev/inode check on btrfs with --sanity-level=3
|
||||
|
||||
With --sanity-level=3 or higher the aspacemgr sanity checks the
|
||||
device/inode numbers from /proc/self/maps to the file stat
|
||||
results. These don't match on btrfs. So detect when a file is on a
|
||||
btrfs volume and ignore the check in that case.
|
||||
|
||||
https://bugs.kde.org/show_bug.cgi?id=317127
|
||||
(cherry picked from commit 3b06d458ffc5cc8de8d701926e5d86979185fa04)
|
||||
---
|
||||
NEWS | 1 +
|
||||
coregrind/m_aspacemgr/aspacemgr-linux.c | 13 +++++++++++++
|
||||
include/vki/vki-linux.h | 6 ++++++
|
||||
3 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index d1419b9d3c12..c5fbc8699db8 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch.
|
||||
|
||||
202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes
|
||||
311655 --log-file=FILE leads to apparent fd leak
|
||||
+317127 Fedora18/x86_64 --sanity-level=3 : aspacem segment mismatch
|
||||
337388 fcntl works on Valgrind's own file descriptors
|
||||
391148 Unhandled AVX instruction vmovq %xmm9,%xmm1
|
||||
444781 MIPS: wrong syscall numbers used
|
||||
diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c
|
||||
index 83875e89b445..fb788e923eb4 100644
|
||||
--- a/coregrind/m_aspacemgr/aspacemgr-linux.c
|
||||
+++ b/coregrind/m_aspacemgr/aspacemgr-linux.c
|
||||
@@ -883,6 +883,19 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot,
|
||||
/* hack apparently needed on MontaVista Linux */
|
||||
if (filename && VG_(strstr)(filename, "/.lib-ro/"))
|
||||
cmp_devino = False;
|
||||
+
|
||||
+ /* On linux systems we want to avoid dev/inode check on btrfs,
|
||||
+ we can use the statfs call for that, except on nanomips
|
||||
+ (which also doesn't have a sys_fstatfs syswrap).
|
||||
+ See https://bugs.kde.org/show_bug.cgi?id=317127 */
|
||||
+#if !defined(VGP_nanomips_linux)
|
||||
+ struct vki_statfs statfs = {0};
|
||||
+ SysRes res = VG_(do_syscall2)(__NR_statfs, (UWord)filename,
|
||||
+ (UWord)&statfs);
|
||||
+ if (!sr_isError(res) && statfs.f_type == VKI_BTRFS_SUPER_MAGIC) {
|
||||
+ cmp_devino = False;
|
||||
+ }
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
/* If we are doing sloppy execute permission checks then we
|
||||
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
|
||||
index be3d76690cee..ccdb808af7a6 100644
|
||||
--- a/include/vki/vki-linux.h
|
||||
+++ b/include/vki/vki-linux.h
|
||||
@@ -5455,6 +5455,12 @@ struct vki_open_how {
|
||||
#define VKI_CLOSE_RANGE_UNSHARE (1U << 1)
|
||||
#define VKI_CLOSE_RANGE_CLOEXEC (1U << 2)
|
||||
|
||||
+//----------------------------------------------------------------------
|
||||
+// From linux/magic.h
|
||||
+//----------------------------------------------------------------------
|
||||
+
|
||||
+#define VKI_BTRFS_SUPER_MAGIC 0x9123683E
|
||||
+
|
||||
/*--------------------------------------------------------------------*/
|
||||
/*--- end ---*/
|
||||
/*--------------------------------------------------------------------*/
|
||||
--
|
||||
2.45.2
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
Summary: Dynamic analysis tools to detect memory or thread bugs and profile
|
||||
Name: %{?scl_prefix}valgrind
|
||||
Version: 3.23.0
|
||||
Release: 4%{?dist}
|
||||
Version: 3.24.0
|
||||
Release: 3%{?dist}
|
||||
Epoch: 1
|
||||
License: GPLv2+
|
||||
URL: https://www.valgrind.org/
|
||||
@ -78,28 +78,21 @@ Patch3: valgrind-3.16.0-some-stack-protector.patch
|
||||
# Add some -Wl,z,now.
|
||||
Patch4: valgrind-3.16.0-some-Wl-z-now.patch
|
||||
|
||||
# Patches from upstream VALGRIND_3_23_BRANCH
|
||||
Patch5: 0001-Prepare-NEWS-for-branch-3.23-fixes.patch
|
||||
Patch6: 0002-486180-MIPS-VexGuestArchState-has-no-member-named-gu.patch
|
||||
Patch7: 0003-Bug-486293-memccpy-false-positives.patch
|
||||
Patch8: 0004-Bug-486569-linux-inotify_init-syscall-wrapper-missin.patch
|
||||
Patch9: 0005-aarch64-frinta-and-frinta-vector-instructions.patch
|
||||
Patch10: 0006-mips-skip-using-shared-syscall-numbers-for-mips32.patch
|
||||
Patch11: 0007-Fix-uninitialized-err-in-handle_extension.patch
|
||||
Patch12: 0008-Avoid-use-of-guest_IP_AT_SYSCALL-in-handle_extension.patch
|
||||
Patch13: 0009-s390x-Minor-fixes-in-extension-s390x.c.patch
|
||||
Patch14: 0010-Bug-453044-gbserver_tests-failures-in-aarch64.patch
|
||||
Patch15: 0011-Linux-regtest-reallocarray-needs-malloc.h.patch
|
||||
Patch16: 0012-Bug-487439-SIGILL-in-JDK11-JDK17.patch
|
||||
Patch17: 0013-Don-t-leave-fds-created-with-log-file-xml-file-or-lo.patch
|
||||
Patch18: 0014-Close-both-internal-pipe-fds-after-VG_-fork-in-paren.patch
|
||||
Patch19: 0015-Don-t-allow-programs-calling-fnctl-on-valgrind-s-own.patch
|
||||
patch20: 0016-mips-skip-using-shared-syscall-numbers-for-mips64.patch
|
||||
patch21: 0017-gdbserver_tests-filters-remove-python-rpm-module-loa.patch
|
||||
patch22: 0018-Implement-VMOVQ-xmm1-xmm2-m64.patch
|
||||
patch23: 0019-arm64-Fix-fcvtas-instruction.patch
|
||||
patch24: 0020-gdbserver_tests-filters-remove-more-verbose-python-r.patch
|
||||
patch25: 0021-Avoid-dev-inode-check-on-btrfs-with-sanity-level-3.patch
|
||||
# VALGRIND_3_24_BRANCH patches
|
||||
Patch5: 0001-Prepare-NEWS-for-branch-3.24-fixes.patch
|
||||
Patch6: 0002-vgdb.c-fork_and_exec_valgrind-Fix-off-by-one-error-w.patch
|
||||
Patch7: 0003-vgdb.c-fork_and_exec_valgrind-Fix-another-off-by-one.patch
|
||||
Patch8: 0004-regtest-add-a-fdleak-filter-for-write-on-write-on-li.patch
|
||||
Patch9: 0005-Add-exp-and-supp-patterns-for-missing-main-frame-for.patch
|
||||
Patch10: 0006-Add-additional-exp-ppc64le-files-to-EXTRA_DIST.patch
|
||||
Patch11: 0007-Add-support-for-landlock_create_ruleset-444-landlock.patch
|
||||
Patch12: 0008-helgrind-tests-tc17_sembar.c-Remove-bool-typedef.patch
|
||||
Patch13: 0009-drd-tests-swapcontext.c-Rename-typedef-struct-thread.patch
|
||||
Patch14: 0010-none-tests-bug234814.c-sa_handler-take-an-int-as-arg.patch
|
||||
Patch15: 0011-Add-open_tree-move_mount-fsopen-fsconfig-fsmount-fsp.patch
|
||||
Patch16: 0012-Recognize-new-DWARF5-DW_LANG-constants.patch
|
||||
Patch17: 0013-Bug-498317-FdBadUse-is-not-a-valid-CoreError-type-in.patch
|
||||
Patch18: 0014-linux-support-EVIOCGRAB-ioctl.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: glibc-devel
|
||||
@ -246,13 +239,6 @@ Valgrind User Manual for details.
|
||||
%patch -P16 -p1
|
||||
%patch -P17 -p1
|
||||
%patch -P18 -p1
|
||||
%patch -P19 -p1
|
||||
%patch -P20 -p1
|
||||
%patch -P21 -p1
|
||||
%patch -P22 -p1
|
||||
%patch -P23 -p1
|
||||
%patch -P24 -p1
|
||||
%patch -P25 -p1
|
||||
|
||||
%build
|
||||
# LTO triggers undefined symbols in valgrind. But valgrind has a
|
||||
@ -480,6 +466,28 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Jan 14 2025 Mark Wielaard <mjw@redhat.com> - 3.24.0-3
|
||||
- Add more VALGRIND_3_24_BRANCH patches
|
||||
0012-Recognize-new-DWARF5-DW_LANG-constants.patch
|
||||
0013-Bug-498317-FdBadUse-is-not-a-valid-CoreError-type-in.patch
|
||||
0014-linux-support-EVIOCGRAB-ioctl.patch
|
||||
* Tue Nov 26 2024 Mark Wielaard <mjw@redhat.com> - 3.24.0-2
|
||||
- Add VALGRIND_3_24_BRANCH patches
|
||||
0001-Prepare-NEWS-for-branch-3.24-fixes.patch
|
||||
0002-vgdb.c-fork_and_exec_valgrind-Fix-off-by-one-error-w.patch
|
||||
0003-vgdb.c-fork_and_exec_valgrind-Fix-another-off-by-one.patch
|
||||
0004-regtest-add-a-fdleak-filter-for-write-on-write-on-li.patch
|
||||
0005-Add-exp-and-supp-patterns-for-missing-main-frame-for.patch
|
||||
0006-Add-additional-exp-ppc64le-files-to-EXTRA_DIST.patch
|
||||
0007-Add-support-for-landlock_create_ruleset-444-landlock.patch
|
||||
0008-helgrind-tests-tc17_sembar.c-Remove-bool-typedef.patch
|
||||
0009-drd-tests-swapcontext.c-Rename-typedef-struct-thread.patch
|
||||
0010-none-tests-bug234814.c-sa_handler-take-an-int-as-arg.patch
|
||||
0011-Add-open_tree-move_mount-fsopen-fsconfig-fsmount-fsp.patch
|
||||
|
||||
* Mon Nov 4 2024 Mark Wielaard <mjw@redhat.com> - 3.24.0-1
|
||||
- Upstream 3.24.0 final
|
||||
|
||||
* Fri Jul 12 2024 Mark Wielaard <mjw@redhat.com> - 3.23.0-4
|
||||
Add upstream VALGRIND_3_23_BRANCH patches
|
||||
0001-Prepare-NEWS-for-branch-3.23-fixes.patch
|
||||
|
Loading…
Reference in New Issue
Block a user