Commit Graph

2795 Commits

Author SHA1 Message Date
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
Mike Frysinger
eb202baf41 tests: skip pc.test on s390
The s390 hardware can't support an exact si_addr, and the current kernels
don't handle text addresses correctly at all.  Until that improves, skip
the test on s390.

* tests/pc.c (main): Return 77 on s390 systems.
2015-03-03 01:13:10 +00:00
Mike Frysinger
90c80c46b8 tests: note the kernel configs for -yy options
* tests/net-yy.test: Note CONFIG_INET_TCP_DIAG.
* tests/unix-yy.test: Note CONFIG_UNIX_DIAG.
2015-03-03 01:12:18 +00:00
301c65cbf0 alpha: fix -yy decoding
* socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary.

Reported-and-tested-by: Mike Frysinger <vapier@gentoo.org>
2015-03-02 23:39:41 +00:00
d50949d21c aarch64, x32: fix decoding of compat personality statfs64/fstatfs64
* statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same
attributes as on X86_64.
2015-03-02 21:34:02 +00:00
f677715a9b mips: fix compilation warning
* syscall.c (get_scno) [MIPS]: Fix harmless compilation warning
about comparison between signed and unsigned integer expressions.
2015-03-02 15:06:51 +00:00
822892ba45 x32: fix compilation warnings
* sysinfo.c (sys_sysinfo): Use ll length format modifier
instead of l and cast kernel ulong types to unsigned long long.
2015-03-02 14:59:20 +00:00
d819fe88fb aarch64: add -i option support
* syscall.c (print_pc): Add aarch64 support.
2015-03-02 03:42:21 +00:00
4341373f2c ioctl: use x32 specific ioctl entries on x32 personality
As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h
(by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32
specific ioctl entries on x32 personality.

* linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh.
* linux/x86_64/ioctlent2.h: Remove.
* linux/x86_64/ioctls_arch2.h: New file.
* linux/x86_64/ioctls_inc2.h: New file.
* Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add
linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h.
2015-03-02 02:55:14 +00:00
77e0d2dccc tests/uid16: skip if real uid is larger than 16bit
* tests/uid16.c (main): Skip if the uid returned by getuid matches
/proc/sys/kernel/overflowuid.
2015-03-02 02:26:02 +00:00
3a15bc8adf tests: fix uid tests on big endian architectures
* tests/uid.c (main): Ignore uids returned by getresuid to avoid
16bit vs 32bit issues on big endian architectures.
Change real UID instead of effective UID in setresuid test.
* tests/uid16.c (main): Likewise.
* tests/uid32.c (main): Change real UID instead of effective UID
in setresuid test to match uid.c
* tests/uid.awk: Update setresuid regexp.

Reported-by: Mike Frysinger <vapier@gentoo.org>
2015-03-02 02:23:55 +00:00
Mike Frysinger
a8dcf253fa tests/getdents: handle older getdents calls
If the tools we use call older getdents syscalls where d_type isn't
passed back, or the arch is old (like Alpha) and can't pass back in
either version, make sure we don't fail.

* tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN.
2015-03-01 21:42:08 +00:00
d93d9f8d7f Fix multiple personalities support in decoding syscall return values
* syscall.c (trace_syscall_exiting): When current personality is 32bit,
print 32bit return code.
2015-02-28 23:58:08 +00:00
a4c9512294 Update generic 64-bit ioctlent from linux v3.19
* linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh.
2015-02-28 18:52:02 +00:00
24b8eb0dee sparc, sparc64: fix rt_sigaction decoding
Fix regression introduced by commit v4.9-9-gc3a5c01.

* signal.c (HAVE_SA_RESTORER): New macro.
[HPPA || IA64]: Do not undefine SA_RESTORER.
(old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER
instead of SA_RESTORER to check whether to define sa_restorer.
(decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in
addition to SA_RESTORER to check whether to use sa_restorer.
2015-02-28 17:55:25 +00:00
1dbd39e85f Fix stack buffer overflow when specified command is too long
* strace.c (startup_child): Check that the length of the command strace
is going to execute does not exceed PATH_MAX limit.

Reported-by: Cheolung Lee <chpie@grayhash.com>
2015-02-28 14:50:09 +00:00
7211dbcb2f build: include ptrace.h after regs.h
Restore the order of including <sys/reg.h> and <linux/ptrace.h>
headers that was inadvertently changed by commit v4.9-280-g5503dd2.

This should fix build on platforms like m68k where some constants
are defined simultaneously as enums by <sys/reg.h> and as macros
by <asm/ptrace.h>.

* process.c: Include "ptrace.h" after "regs.h".
* signal.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.
2015-02-28 12:20:21 +00:00
e61086ff77 x32: fix decoding of timeval, timespec, and timex structures
As time_t is a 64-bit type in x32 personality, it is not correct to
treat it as a long int type.

* time.c (current_time_t_is_compat): New macro.
(sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it.
(tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t
when printing tv_sec/tv_usec.
(tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex
members of type kernel_long_t.
2015-02-28 12:10:39 +00:00
Mike Frysinger
4ed340bae6 tests/ipc_sem: detect broken kernels
When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc
logic wrongly returns errors.  Detect that and throw an error.

* tests/ipc_sem.c: Return 99 when errno is EFAULT.
* tests/ipc_sem.test: Save output to $OUT and show it when failing.
Handle exit status 99 to throw an ERROR.
2015-02-28 12:10:39 +00:00
856b7596b8 build: do not link strace with -ldl
* configure.ac: Fix dladdr check.
2015-02-27 05:01:25 +00:00
Mike Frysinger
d32e1b9dde Handle broken PTRACE_EVENT_STOP values
For a few linux releases (3.1 through 3.3), this define in the exported
headers were broken.  Redefine if that's the case.

* ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7.
2015-02-27 04:43:11 +00:00
Mike Frysinger
11cb0da472 bootstrap: always set up test dirs
When files get updated, the bootstrap script should make sure the
parallel dirs are kept in sync.

* bootstrap: Always generate the test$m.  Clean up symlinks first.
Don't link in Makefile.in files.
2015-02-27 04:43:11 +00:00
Mike Frysinger
58c7fe9903 Fix cross-compiling of ioctlsort
Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross
compiling.  This way ioctlsort uses the build tools all the time.

* configure.ac: Call AX_PROG_CC_FOR_BUILD.
* Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD.
(ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD.
(ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD.
(ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD.
(ioctlsort_LD): Delete.
(ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT).  Use ioctlsort_CFLAGS.
* m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package.
2015-02-27 04:43:06 +00:00
977550de79 tests: robustify pc.test
* configure.ac: Check for dladdr in -ldl.
* tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS).
* tests/pc.c: Include "config.h" and <dlfcn.h>.
(main): Use dladdr to find the address to unmap.
2015-02-27 04:09:56 +00:00
599819dfd5 tests: drop support for alternative names of select syscall
This mostly reverts commit 4a00fc4867.

* tests/select.awk: Drop _newselect support.
* tests/select.test: Skip if select syscall is not supported.
2015-02-27 01:47:12 +00:00
ddcf54969d Rename _newselect to select
As an exception to the general rules that syscall names should match
__NR_* constants defined in kernel headers, show select as "select"
and old select as "oldselect".

* linux/arm/syscallent.h (82): Change name to oldselect.
* linux/hppa/syscallent.h (142): Change name to select.
* linux/mips/syscallent-n32.h (6022): Likewise.
* linux/mips/syscallent-n64.h (5022): Likewise.
* linux/mips/syscallent-o32.h (4142): Likewise.
* linux/sparc/syscallent.h (230): Likewise.
2015-02-27 01:25:24 +00:00
f4d6b37dfd sparc: sync syscall entries with kernel headers
* linux/sparc/syscallent.h: Fix syscall entries for vmsplice,
inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch,
ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and
sched_setaffinity.
(67, 68, 202, 230): Change syscall names to match __NR_* constants
defined in arch/sparc/include/uapi/asm/unistd.h.
2015-02-27 00:28:12 +00:00
6d9fa80918 s390, s390x: sync syscall entry names with kernel headers
* linux/s390/syscallent.h (1, 180, 181): Change syscall names to match
__NR_* constants defined in arch/s390/include/uapi/asm/unistd.h.
* linux/s390x/syscallent.h: Likewise.
2015-02-26 23:36:26 +00:00
Mike Frysinger
48ceaee384 xlat: avoid fork bombing the build system
When there were fewer xlat headers, this didn't matter as much.
But now with >200, trying to run them all in parallel can easily
fork bomb smaller systems.

* xlat/gen.sh (main): Do not more jobs than # of cpus.
2015-02-26 23:14:04 +00:00
adee242dec arm: sync syscall entry names with kernel
* linux/arm/syscallent.h (82, 90, 180, 181, 327):
Change syscall names to match __NR_* constants defined
in arch/arm/include/uapi/asm/unistd.h.
2015-02-26 23:04:04 +00:00
ff865c67a6 arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries
* linux/arm/syscallent.h (320, 321, 350): Fix names and handlers.
2015-02-26 23:03:10 +00:00
566eb6c847 hppa: sync syscall entry names with kernel
* linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280):
Change syscall names to match __NR_* constants defined in
arch/parisc/include/uapi/asm/unistd.h.
2015-02-26 22:44:17 +00:00
4cd64fe29e subcall.h: add sendmmsg entry
* linux/subcall.h: Add sys_sendmmsg entry.
(SYS_socket_nsubcalls): Update.
2015-02-26 22:07:14 +00:00
d77f742fe6 arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition
* linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall.
2015-02-26 22:05:45 +00:00
f8d75c5267 ia64: parametrize i386 syscallent size check
* linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls)
instead of numeric constant.
2015-02-26 22:03:19 +00:00
407f630374 Cleanup linux/subcall.h
* linux/subcall.h: Use SYS_ipc_subcall.
2015-02-26 21:45:47 +00:00
642447ef6e alpha: fix statfs decoding
* statfs.c (printstatfs) [ALPHA]: Remove faulty code.
2015-02-26 21:09:48 +00:00
19fcb27764 x32: fix build regression
* linux/x32/arch_regs.h: New file.
* Makefile.am (EXTRA_DIST): Add it.
2015-02-26 20:40:43 +00:00
Mike Frysinger
28e3d6fd1c hppa: fix fanotify_mark decoding
The parisc kernel has some legacy baggage here and decodes the 64bit
field in the reverse order.  Handle it in strace too.

* fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits.
2015-02-26 20:02:03 +00:00
Mike Frysinger
761e31a8b4 ia64: fix decoding of getresuid/getresgid/setresgid
Looks like the similarity of these names caused confusion when generating
the syscall table.  getresgid was wired to the wrong output while the other
two were wired up to printargs instead of the real printer.

* linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to
sys_getresgid, and setresgid to sys_setresgid.
2015-02-26 20:02:03 +00:00
Mike Frysinger
cc07f669f3 ia64: fix up builds after 16bit uid support
The ia64 port pulls in the i386 syscall table so it can decode
32bit apps, so we need to enable the 16bit uid parsers for it.

* defs.h (NEED_UID16_PARSERS): Define to 1 for IA64.
* linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings.
2015-02-26 20:01:35 +00:00
Mike Frysinger
bfe6d04d9c v4l2: use uintmax_t for times
There is no guarantee that the backing value for the various time fields
are ints or longs which makes printfs annoying.  Lets cast them to the
uintmax_t type so we can use the j flag and not worry about truncation.

* v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec.
2015-02-26 20:00:03 +00:00
Mike Frysinger
bf8dfe8aaf ignore core/compile files
Newer autotools includes a compile helper script.

* .gitignore: Add /compile and core.
2015-02-26 20:00:03 +00:00
a671a2c7b4 NEWS: Prepare for 4.10 release 2015-02-24 03:36:38 +00:00
23ce9e48b5 Remove support for systems without PTRACE_SETOPTIONS
Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS
and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE
are universally available.

This change removes all code that implemented post-execve SIGTRAP
handling and fork/vfork/clone->CLONE_PTRACE substitution.

* defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros.
(need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations.
* strace.c (need_fork_exec_workarounds,
test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all):
Remove.
(syscall_trap_sig): Set to (SIGTRAP | 0x80).
(ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC).
(detach): Do not test for TCB_BPTSET.
(init): Do not call test_ptrace_setoptions_followfork and
test_ptrace_setoptions_for_all.  Do not test for TCB_BPTSET.
* syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec,
syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove.
(trace_syscall_entering): Do not test for TCB_WAITEXECVE.  Do not call
syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec.
(trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and
syscall_fixup_for_fork_exec.
[IA64] (ia64_ia32mode): Make static.
* linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration.
* util.c: Do not include "syscall.h".
(arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0,
restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt):
Remove.
* tests/ptrace_setoptions.test: Remove.
* tests/Makefile.am (TESTS): Remove it.
2015-02-24 03:36:38 +00:00
1c5feadf75 tests: robustify pc.test
* tests/pc.c (main): Unmap larger memory region.
Dump process map for debug purposes.
* tests/pc.test: Update regexps to take CLD_DUMPED child process
into account.
2015-02-24 03:36:36 +00:00