strace: Add strace-4.10 patches from debian

https://sources.debian.net/src/strace/4.10-3/debian/patches/

Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
This commit is contained in:
Bryan Hundven 2015-09-01 19:38:10 -07:00
parent c5fbb8716b
commit ba77b5dab8
8 changed files with 324 additions and 0 deletions

View File

@ -0,0 +1,21 @@
commit d76d3069526c348e6fe5d40bbbceb2ae4a928d16
Author: Dmitry V. Levin <ldv@altlinux.org>
Date: Wed Mar 11 14:32:25 2015 +0000
aarch64: fix rt_sigreturn decoding
* sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check.
diff --git a/sigreturn.c b/sigreturn.c
index 648bd0a..c253a0c 100644
--- a/sigreturn.c
+++ b/sigreturn.c
@@ -23,7 +23,7 @@ sys_sigreturn(struct tcb *tcp)
# define OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK (5 * 4 + SIZEOF_STRUCT_SIGCONTEXT)
const long addr =
# ifdef AARCH64
- current_personality == 0 ?
+ current_personality == 1 ?
(*aarch64_sp_ptr + SIZEOF_STRUCT_SIGINFO +
offsetof(struct ucontext, uc_sigmask)) :
# endif

View File

@ -0,0 +1,22 @@
commit dbadf7bcc8995612d5ef737047b909e868387e37
Author: Andreas Schwab <schwab@suse.de>
Date: Mon Mar 9 16:55:06 2015 +0100
Fix decoding of mmap2 for arm
* syscallent.h (mmap2): Decode with sys_mmap_4koff, not
sys_mmap_pgoff.
diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h
index 52aed9e..b66a5a2 100644
--- a/linux/arm/syscallent.h
+++ b/linux/arm/syscallent.h
@@ -218,7 +218,7 @@
[189] = { 5, 0, sys_putpmsg, "putpmsg" },
[190] = { 0, TP, sys_vfork, "vfork" },
[191] = { 2, 0, sys_getrlimit, "ugetrlimit" },
-[192] = { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" },
+[192] = { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" },
[193] = { 4, TF, sys_truncate64, "truncate64" },
[194] = { 4, TD, sys_ftruncate64, "ftruncate64" },
[195] = { 2, TF, sys_stat64, "stat64" },

View File

@ -0,0 +1,25 @@
commit 64fc9cedc475b2fc0d940509dc4232b02b5f83ec
Author: Andreas Schwab <schwab@suse.de>
Date: Thu Mar 12 11:54:08 2015 +0100
Distribute linux/aarch64/arch_regs.h
* Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h.
diff --git a/Makefile.am b/Makefile.am
index 2030f9b..48fe1d7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -164,6 +164,7 @@ EXTRA_DIST = \
linux/32/syscallent.h \
linux/64/ioctls_inc.h \
linux/64/syscallent.h \
+ linux/aarch64/arch_regs.h \
linux/aarch64/errnoent1.h \
linux/aarch64/ioctls_arch0.h \
linux/aarch64/ioctls_arch1.h \
--- a/linux/aarch64/arch_regs.h 2015-06-09 03:27:46.170000000 +0000
+++ b/linux/aarch64/arch_regs.h 2015-07-01 21:23:17.025202308 +0000
@@ -0,0 +1,2 @@
+extern uint64_t *const aarch64_sp_ptr;
+extern uint32_t *const arm_sp_ptr;

View File

@ -0,0 +1,87 @@
commit f79252f072a193bdff435afeaa6b6cd6d5c79947
Author: Dmitry V. Levin <ldv@altlinux.org>
Date: Mon Mar 16 17:18:40 2015 +0000
stat64-v.test: add newfstatat syscall support
Newer architectures have no stat syscall, so stat() is implemented there
using newfstatat syscall.
* tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX. Update callers.
[_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support.
(main) [!NR_stat]: Add newfstatat support.
Reported-by: Andreas Schwab <schwab@suse.de>
diff --git a/tests/stat.c b/tests/stat.c
index 21e37fb..2b04010 100644
--- a/tests/stat.c
+++ b/tests/stat.c
@@ -14,22 +14,22 @@
# include <sys/types.h>
#endif
-#undef STAT_FNAME
+#undef STAT_PREFIX
#undef NR_stat
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
# include <sys/stat.h>
-# define STAT_FNAME "stat(64)?"
+# define STAT_PREFIX "(stat(64)?\\(|newfstatat\\(AT_FDCWD, )"
#else
# include <sys/syscall.h>
# if defined __NR_stat
# define NR_stat __NR_stat
-# define STAT_FNAME "stat"
+# define STAT_PREFIX "stat\\("
# elif defined __NR_newstat
# define NR_stat __NR_newstat
-# define STAT_FNAME "newstat"
+# define STAT_PREFIX "newstat\\("
# endif
-# ifdef STAT_FNAME
+# ifdef STAT_PREFIX
/* for S_IFMT */
# define stat libc_stat
# define stat64 libc_stat64
@@ -57,10 +57,10 @@
# define off_t __kernel_off_t
# define loff_t __kernel_loff_t
# include <asm/stat.h>
-# endif /* STAT_FNAME */
+# endif /* STAT_PREFIX */
#endif /* _FILE_OFFSET_BITS */
-#ifdef STAT_FNAME
+#ifdef STAT_PREFIX
static void
print_ftype(unsigned int mode)
@@ -115,7 +115,7 @@ main(int ac, const char **av)
assert(stat(av[1], &stb) == 0);
#endif
- printf(STAT_FNAME "\\(\"%s\", \\{", av[1]);
+ printf(STAT_PREFIX "\"%s\", \\{", av[1]);
printf("st_dev=makedev\\(%u, %u\\)",
(unsigned int) major(stb.st_dev),
(unsigned int) minor(stb.st_dev));
@@ -159,11 +159,15 @@ main(int ac, const char **av)
printf("(, st_flags=[0-9]+)?");
printf("(, st_fstype=[^,]*)?");
printf("(, st_gen=[0-9]+)?");
- printf("\\}\\) += 0\n");
+ printf("\\}");
+#ifndef NR_stat
+ printf("(, 0)?");
+#endif
+ printf("\\) += 0\n");
return 0;
}
-#else /* !STAT_FNAME */
+#else /* !STAT_PREFIX */
int main(void)
{
return 77;

View File

@ -0,0 +1,48 @@
commit 95336102eb836ba69a2b51a3bbe733abd63bbe77
Author: Andreas Schwab <schwab@suse.de>
Date: Thu Mar 12 16:47:38 2015 +0100
tests/select.test: handle architectures using pselect6 syscall
* tests/select.awk (BEGIN): Update regexps to match both select
and pselect6 syscalls.
* tests/select.test: Probe for both select and pselect6 syscall.
diff --git a/tests/select.awk b/tests/select.awk
index 142504a..688cefe 100644
--- a/tests/select.awk
+++ b/tests/select.awk
@@ -1,7 +1,7 @@
BEGIN {
- r[1] = "^select\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL\\) += 1 \\(\\)$"
- r[2] = "^select\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL\\) += -1 "
- r[3] = "^select\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100\\}\\) += 0 \\(Timeout\\)$"
+ r[1] = "^p?select6?\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL(, 0)?\\) += 1 \\(\\)$"
+ r[2] = "^p?select6?\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL(, 0)?\\) += -1 "
+ r[3] = "^p?select6?\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100(000)?\\}(, 0)?\\) += 0 \\(Timeout\\)$"
r[4] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
lines = 4
fail = 0
diff --git a/tests/select.test b/tests/select.test
index bd3066b..5d5fe54 100755
--- a/tests/select.test
+++ b/tests/select.test
@@ -6,13 +6,16 @@
check_prog awk
-$STRACE -eselect -h > /dev/null ||
+syscall=
+$STRACE -epselect6 -h > /dev/null && syscall=$syscall,pselect6
+$STRACE -eselect -h > /dev/null && syscall=$syscall,select
+test -n "$syscall" ||
skip_ 'select syscall is not supported on this architecture'
./select ||
framework_skip_ 'select syscall does not behave as expected'
-args='-eselect ./select'
+args="-e$syscall ./select"
$STRACE -o "$LOG" $args || {
cat "$LOG"
fail_ "$STRACE $args failed"

View File

@ -0,0 +1,39 @@
commit 0e3811d7914f209858cf4e445221fd65644cc94b
Author: Andreas Schwab <schwab@suse.de>
Date: Thu Mar 12 18:07:00 2015 +0100
aarch64: fix ioctl decoding
* linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h.
* linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h.
* linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h.
* linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h.
diff --git a/linux/aarch64/ioctls_arch0.h b/linux/aarch64/ioctls_arch0.h
index 6a674cc..b722d22 100644
--- a/linux/aarch64/ioctls_arch0.h
+++ b/linux/aarch64/ioctls_arch0.h
@@ -1 +1 @@
-/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */
+#include "arm/ioctls_arch0.h"
diff --git a/linux/aarch64/ioctls_arch1.h b/linux/aarch64/ioctls_arch1.h
index b722d22..6a674cc 100644
--- a/linux/aarch64/ioctls_arch1.h
+++ b/linux/aarch64/ioctls_arch1.h
@@ -1 +1 @@
-#include "arm/ioctls_arch0.h"
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */
diff --git a/linux/aarch64/ioctls_inc0.h b/linux/aarch64/ioctls_inc0.h
index f9939fa..46c11b1 100644
--- a/linux/aarch64/ioctls_inc0.h
+++ b/linux/aarch64/ioctls_inc0.h
@@ -1 +1 @@
-#include "64/ioctls_inc.h"
+#include "arm/ioctls_inc0.h"
diff --git a/linux/aarch64/ioctls_inc1.h b/linux/aarch64/ioctls_inc1.h
index 46c11b1..f9939fa 100644
--- a/linux/aarch64/ioctls_inc1.h
+++ b/linux/aarch64/ioctls_inc1.h
@@ -1 +1 @@
-#include "arm/ioctls_inc0.h"
+#include "64/ioctls_inc.h"

View File

@ -0,0 +1,18 @@
--- a/tests/bexecve.test
+++ b/tests/bexecve.test
@@ -24,13 +24,14 @@
}
pattern='Process [1-9][0-9]* detached'
+pattern_personality='\[ Process PID=[1-9][0-9]* runs in .* mode. \]'
LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || {
cat "$LOG"
fail_ "$what: unexpected output"
}
-if LC_ALL=C grep -v -x "$pattern" "$LOG" > /dev/null; then
+if LC_ALL=C grep -E -v -x "($pattern|$pattern_personality)" "$LOG" > /dev/null; then
cat "$LOG"
fail_ "$what: unexpected output"
fi

View File

@ -0,0 +1,64 @@
Index: strace-4.10/linux/mips/syscallent-o32.h
===================================================================
--- strace-4.10.orig/linux/mips/syscallent-o32.h
+++ strace-4.10/linux/mips/syscallent-o32.h
@@ -1,6 +1,6 @@
#if defined LINUX_MIPSO32
/* For an O32 strace, decode the o32 syscalls. */
-[4000] = { MA, 0, printargs, "syscall" }, /* start of Linux o32 */
+[4000] = { MA, 0, sys_syscall, "syscall" }, /* start of Linux o32 */
[4001] = { 1, TP|SE, sys_exit, "exit" },
[4002] = { 0, TP, sys_fork, "fork" },
[4003] = { 3, TD, sys_read, "read" },
Index: strace-4.10/syscall.c
===================================================================
--- strace-4.10.orig/syscall.c
+++ strace-4.10/syscall.c
@@ -606,6 +606,25 @@ decode_ipc_subcall(struct tcb *tcp)
}
#endif
+#ifdef LINUX_MIPSO32
+static void
+decode_mips_subcall(struct tcb *tcp)
+{
+ if (!SCNO_IS_VALID(tcp->u_arg[0]))
+ return;
+ tcp->scno = tcp->u_arg[0];
+ tcp->qual_flg = qual_flags[tcp->scno];
+ tcp->s_ent = &sysent[tcp->scno];
+ memmove(&tcp->u_arg[0], &tcp->u_arg[1],
+ sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
+}
+
+int sys_syscall(struct tcb *tcp)
+{
+ return printargs(tcp);
+}
+#endif
+
int
printargs(struct tcb *tcp)
{
@@ -1774,6 +1793,11 @@ trace_syscall_entering(struct tcb *tcp)
goto ret;
}
+#ifdef LINUX_MIPSO32
+ if (sys_syscall == tcp->s_ent->sys_func)
+ decode_mips_subcall(tcp);
+#endif
+
if ( sys_execve == tcp->s_ent->sys_func
# if defined(SPARC) || defined(SPARC64)
|| sys_execv == tcp->s_ent->sys_func
--- strace-4.10.orig/linux/syscall.h 2015-02-06 01:23:05.000000000 +0000
+++ strace-4.10/linux/syscall.h 2015-07-09 14:36:49.372494628 +0100
@@ -277,6 +277,7 @@
int sys_symlinkat();
int sys_sync_file_range();
int sys_sync_file_range2();
+int sys_syscall();
int sys_sysctl();
int sys_sysinfo();
int sys_syslog();