Commit Graph

2840 Commits

Author SHA1 Message Date
6add1b09d6 tests: skip netlink based tests when resources are not available
* tests/netlink_inet_diag.c (main): Return 77 if socket, bind,
or listen syscall fail.
* tests/netlink_unix_diag.c (main): Likewise.
2015-03-18 22:39:20 +00:00
babe7f6a30 aarch64, arm: decode extra padded compat struct statfs64
According to arch/arm/kernel/sys_oabi-compat.c,
struct statfs64 has extra padding with EABI.

* statfs.c [AARCH64 || defined ARM] (COMPAT_STATFS64_PADDED_SIZE):
Define.
(do_statfs64_fstatfs64): New function, factored out from sys_statfs64.
[COMPAT_STATFS64_PADDED_SIZE]: Check it in addition to
sizeof(struct compat_statfs64).
(sys_statfs64, sys_fstatfs64): Use do_statfs64_fstatfs64.

Reported-and-tested-by: Elliott Hughes <enh@google.com>
2015-03-18 17:39:15 +00:00
8f54664d68 tests: factor out common shell code to functions
Factor out shell code used in several tests to common functions.

* tests/fanotify_mark.expected: New file.
* tests/ioctl.expected: New file.
* tests/net-fd.expected: New file.
* tests/net.expected: New file.
* tests/statfs.expected: New file.
* tests/sun_path.expected: New file.
* tests/uio.expected: New file.
* tests/ipc.sh: New file.
* tests/Makefile.am (EXTRA_DIST): Add them.
* tests/init.sh (dump_log_and_fail_with, run_prog,
run_prog_skip_if_failed, run_strace, run_strace_merge,
match_awk, match_diff, match_grep): New functions.
* tests/*.test: Use them.
2015-03-18 02:29:36 +00:00
Elliott Hughes
1b5b5670eb Show f_flags field in printstatfs
printstatfs64 was right, but printstatfs was missing f_flags.
Noticed on aarch64.

* statfs.c (printstatfs) [_STATFS_F_FLAGS]: Print statfs.f_flags.

Signed-off-by: Elliott Hughes <enh@google.com>
2015-03-18 01:31:23 +00:00
68804b3267 tests/uid*: use fchown* instead of chown*
Newer architectures have no chown syscall, so use fchown* syscalls
for testing printuid.

* tests/uid.test: Use fchown instead of chown.
* tests/uid.c: Test __NR_fchown instead of __NR_chown.
(main): Use __NR_fchown instead of __NR_chown.
* tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32.
(main): Use __NR_fchown32 instead of __NR_chown32.
* tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead
of __NR_chown and __NR_chown32.
(main): Use __NR_fchown instead of __NR_chown.
* tests/uid.awk: Update regexp.
2015-03-16 18:20:57 +00:00
f79252f072 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>
2015-03-16 17:39:19 +00:00
Andreas Schwab
71d6ffc6ed aarch64: properly decode generic syscalls
* linux/aarch64/syscallent1.h: Don't override entries 277 to 1023.
2015-03-16 16:25:09 +01:00
Andreas Schwab
33557845ad tests: verify that all patterns match
* tests/ipc_msg.test: Count matches to verify that all patterns match.
* tests/ipc_sem.test: Likewise.
* tests/ipc_shm.test: Likewise.
* tests/stat32-v.test: Likewise.
* tests/stat64-v.test: Likewise.
2015-03-16 16:22:24 +01:00
bce1ff5f88 Fix stat64 st_[acm]time decoding for personalities with 32-bit time_t
STRUCT_STAT.st_[acm]time are declared as unsigned int for some
personalities, while time_t is signed.

* printstat.h (DO_PRINTSTAT): If st_[acm]time have the same size as int,
explicitly cast them to int.
* tests/stat64-v.test: Test that negative time_t is decoded properly.

Reported-by: Andreas Schwab <schwab@suse.de>
2015-03-16 14:23:09 +00:00
499c5aad0c semctl: fix indirect syscall decoding
On architectures where the semctl call is implemented by the ipc syscall
the 4th argument is passed by reference.

* ipc.c (sys_semctl): Handle the indirect ipc subcall case.
* tests/ipc_sem.c (main): Optionally match indirection
in the 4th argument of semctl calls.

Reported-by: Andreas Schwab <schwab@suse.de>
2015-03-16 14:23:09 +00:00
Andreas Schwab
3aa45f3cc2 tests/ipc_*: match IPC_64 flag
* tests/ipc_msg.c (main): Optionally match "IPC_64|" in the third
argument of the ipc call.
* tests/ipc_sem.c (main): Likewise.
* tests/ipc_shm.c (main): Likewise.
2015-03-16 14:26:58 +01:00
Andreas Schwab
fa5ce37246 Fix crash in ipc_sem test
Properly use union semun as argument of semctl.

* tests/ipc_sem.c (main): Properly use union semun as argument of
semctl.  Don't handle EFAULT specially.
* tests/ipc_sem.test: Revert last change.
2015-03-16 12:18:36 +01:00
Andreas Schwab
712f0e12bd m68k: fix sigreturn decoding
* sigreturn.c (sys_sigreturn) [M68K]: Fetch the words of the
signal mask from the proper place.
2015-03-16 10:55:20 +01:00
Andreas Schwab
0e3811d791 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.
2015-03-16 10:15:29 +01:00
Andreas Schwab
95336102eb 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.
2015-03-12 17:22:07 +01:00
Andreas Schwab
64fc9cedc4 Distribute linux/aarch64/arch_regs.h
* Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h.
2015-03-12 14:15:50 +01:00
Andreas Schwab
dbadf7bcc8 Fix decoding of mmap2 for arm
* syscallent.h (mmap2): Decode with sys_mmap_4koff, not
sys_mmap_pgoff.
2015-03-12 10:52:22 +01:00
Andreas Schwab
a897136801 m68k: define HAVE_SA_RESTORER
On m68k the kernel sigaction structure has the sa_restorer member for
historical reasons.

* signal.c (HAVE_SA_RESTORER): Define for M68K.
2015-03-12 10:24:27 +01:00
d76d306952 aarch64: fix rt_sigreturn decoding
* sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check.
2015-03-11 16:34:09 +00:00
91bdbb46ff maint: post-release administrivia
* NEWS: Add header line for next release.
2015-03-09 22:05:40 +00:00
dfabccf997 Prepare for 4.10 release
* NEWS: Update for 4.10 release.
* debian/changelog: 4.10-1.
* strace.spec: 4.10-1.
2015-03-06 13:14:15 +00:00
74219ea36f Move sigreturn/rt_sigreturn parser to a separate file
* sigreturn.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (sprintsigmask_n): New prototype.
(tprintsigmask_addr): New macro.
* signal.c (sprintsigmask_n): Make global.
(tprintsigmask_addr): Remove.
(sys_sigreturn): Move to sigreturn.c.
2015-03-06 02:19:01 +00:00
48f0890953 ia64: use PTRACE_GETREGS to fetch registers
* linux/ia64/arch_regs.h: Stop including <asm/rse.h>.
(ia64_frame_ptr): New declaration.
* signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr.
* syscall.c [IA64]: Include <asm/rse.h>.
[IA64] (ia64_regs, ia64_frame_ptr): New variable.
[IA64] (ARCH_REGS_FOR_GETREGS): New macro.
[IA64] (ia64_ia32mode): Convert to macro.
[IA64] (ia64_r8, ia64_r10): Remove.
(getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]:
Use ia64_regs.
(get_syscall_result) [IA64]: Remove.
2015-03-05 23:37:27 +00:00
20eca8a1c5 s390, s390x: use PTRACE_GETREGSET to fetch registers
* linux/s390/arch_regs.h: New file.
* linux/s390x/arch_regs.h: New file.
* Makefile.am (EXTRA_DIST): Add them.
* signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr.
* syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable.
[S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro.
(print_pc) [S390 || S390X]: Use s390_regset.
(get_scno) [S390 || S390X]: Likewise.
(get_syscall_args) [S390 || S390X]: Likewise.
(get_error) [S390 || S390X]: Likewise.
(get_syscall_result) [S390 || S390X]: Remove.
2015-03-05 22:10:15 +00:00
07d70f03ee qemu_multiarch_testing: update
* qemu_multiarch_testing/README: Update statistics.
2015-03-05 19:36:52 +00:00
da66e25779 tests: robustify unix-yy.test
Implement additional synchronization between parent and child processes
to guarantee that the child starts closing connected socket only after
exiting of the parent's accept() syscall.
This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER
messages from NETLINK_SOCK_DIAG interface.

* tests/net-accept-connect.c: Implement additional synchronization
between parent and child processes.
* tests/unix-yy-connect.awk: Update.
2015-03-05 17:44:32 +00:00
59f63d3106 Use SIGRTMIN from kernel headers
* configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>.
* signal.c: Use ASM_SIGRTMIN instead of constants provided by libc.
* tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value.
Use lower RT_* numbers to support pre-3.18 hppa kernels.
* tests/sigreturn.test: Update regexp.
2015-03-05 05:42:30 +00:00
67dab706cf ppc64: fix compilation warning
Fix compilation warning introduced by commit
577be2593d

* signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal
mask on 32bit personality.
2015-03-05 04:29:37 +00:00
47e289bb9c aarch64: fix compilation warnings
Fix compilation warnings introduced by commit
5b9b7e1d34:

signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare]
syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default]

* syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast.
[AARCH64] (arm_sp_ptr): Change pointer type to unsigned.
* linux/aarch64/arch_regs.h (arm_sp_ptr): Update.

Reported-by: Mike Frysinger <vapier@gentoo.org>
2015-03-05 04:10:52 +00:00
a1c5e0721f i386: simplify sigreturn decoding
* signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define
i386_sigcontext_struct and i386_fpstate structures.
2015-03-05 01:16:52 +00:00
30bcb792cf tests: add a test for sigreturn/rt_sigreturn decoding
Convert test/sigreturn.c into a regular test.

* test/Makefile (PROGS): Remove sigreturn.
* test/.gitignore: Likewise.
* test/sigreturn.c: Rewrite to ...
* tests/sigreturn.c: ... new file.
* tests/sigreturn.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add sigreturn.
(TESTS): Add sigreturn.test.
* tests/.gitignore: Add sigreturn.
2015-03-05 00:05:27 +00:00
f3582cd204 sigreturn: print signal mask as a syscall argument
Although sigreturn takes signal mask via frame pointer,
it's more convenient to display signal mask as a syscall argument
rather than an outstanding object of unknown nature:

Before this change:
    sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0

After this change:
    sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0

* signal.c (sys_sigreturn): Display signal mask as a syscall argument.
2015-03-04 23:55:25 +00:00
5b9b7e1d34 aarch64: implement rt_sigreturn decoding
* linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn
decoding.
* syscall.c [ARM] (arm_regs): Make static.
[ARM] (arm_sp_ptr): New variable.
[AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables.
* linux/aarch64/arch_regs.h: New file.
* linux/arm/arch_regs.h (arm_regs): Remove.
(arm_sp_ptr): New declaration.
* signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr.
[AARCH64]: Print signal mask.
2015-03-04 23:05:53 +00:00
26d16c8ade arm: simplify sigreturn decoding
* signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext
structures, fetch signal mask only, use print_sigset_addr_len.
2015-03-04 22:27:35 +00:00
085411b806 s390: fix sigreturn decoding
* signal.c (sys_sigreturn) [S390]: Fix signal mask decoding.
2015-03-04 21:48:44 +00:00
fd6d2072b1 mips o32: fix sigreturn decoding
* signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask.
[MIPS] Use print_sigset_addr_len to print signal mask.
2015-03-04 21:48:44 +00:00
ccb4fdac43 x86_64, x32: implement rt_sigreturn decoding
* syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable.
* linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration.
* linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn
decoding.
* linux/x32/syscallent.h (513): Likewise.
* signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask
for non-i386 personalities.
2015-03-04 17:54:25 +00:00
db19936861 sparc, sparc64: fix sigreturn decoding
* linux/sparc/arch_regs.h (U_REG_FP): New macro.
* signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding
of upper 32 bits of the sigmask.
2015-03-04 17:54:25 +00:00
577be2593d ppc, ppc64: fix sigreturn decoding
* signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits
of the sigmask.
2015-03-04 16:06:05 +00:00
d46899286e sigreturn: issue a less innocuous warning
* signal.c (sys_sigreturn): Issue a less innocuous warning on
architectures for which signal mask decoding is not implemented yet.
2015-03-04 14:52:56 +00:00
dca5110aaa bootstrap: do not link Makefile* files
* bootstrap: Do not symlink any Makefile* files, not just Makefile.am
and Makefile.in.

Reported-by: Christopher Covington <cov@codeaurora.org>
2015-03-04 14:52:56 +00:00
1e8a454474 ia64: fix sigreturn decoding
* signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask.
Use print_sigset_addr_len to print signal mask.
2015-03-04 12:11:31 +00:00
7abfd29834 ia64: use generic signalent
This complements commit v4.9-321-gfcf7f8d.

* linux/ia64/signalent.h: Remove.
* Makefile.am (EXTRA_DIST): Remove it.
2015-03-04 12:06:26 +00:00
Giedrius Statkevičius
6a63bfa160 Document that -k is available only with libunwind
Without this users might get confused why `man strace` describes
an option that doesn't work.

* strace.1: Note that -k is available only if strace is built
with libunwind.
2015-03-04 00:56:33 +00:00
fde8fac036 debian: update control file
* debian/control (strace, strace-udeb): Add mips64 and mips64el
to architecture list.
Patch by James Cowgill <james410@cowgill.org.uk>

This fixes Debian bug #773375.
2015-03-03 23:12:22 +00:00
f3f136cd4b debian: sync with 4.9-2 package
* debian/changelog: Sync with 4.9-2.
* debian/control: Likewise.
2015-03-03 23:12:22 +00:00
7e6556711e Add arch-specific PTRACE_* constants
* xlat/ptrace_cmds.in: Add arch-specific ptrace commands.
* xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile.
* xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile.

This fixes Debian bug #734554.
2015-03-03 23:12:22 +00:00
Mike Frysinger
600eafb6ed Clarify bootstrap-vs-autoreconf usage
* README-hacking: Tell people to run ./bootstrap.
2015-03-03 01:45:30 +00:00
5a64656da6 mips n32: fix preadv/pwritev offset decoding
In mips n32 abi, like in most of 32-bit architectures, offset
is passed to preadv/pwritev syscalls using two syscall arguments.

* io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove.
2015-03-03 01:36:29 +00:00
Mike Frysinger
d79ed12376 tests: skip ipc_sem.test on broken kernels
Rather than trigger an ERROR which fails `make check`, go with SKIP
instead.  We don't want the testsuite failing due to kernel bugs.

* tests/ipc_sem.c (main): Change 99 to 77.
2015-03-03 01:13:23 +00:00