Commit Graph

719 Commits

Author SHA1 Message Date
769c98af34 hppa: rename ECANCELLED to ECANCELED
hppa seems to be the only architecture that defines ECANCELLED synonym
for ECANCELED constant, other architectures just define ECANCELED.
Change the way how this constant is printed on hppa to be in line
with other architectures.

* linux/hppa/errnoent.h [253]: Rename ECANCELLED to ECANCELED.
2016-04-20 21:36:46 +00:00
126464566d Remove parser of unimplemented timerfd syscall
timerfd syscall was introduced in v2.6.22-rc1, but in v2.6.25-rc1
it was replaced by timerfd_* syscall family.

* linux/avr32/syscallent.h (timerfd): Fix nargs.
* linux/dummy.h (sys_timerfd): Add stub alias.
* time.c (SYS_FUNC(timerfd)): Remove.
2016-04-20 17:15:05 +00:00
ef2007eccc mips o32, powerpc, powerpc64: fix decoding of iopl syscall
* linux/mips/syscallent-o32.h (iopl): Fix nargs.
* linux/powerpc/syscallent.h (iopl): Fix nargs and sys_func.
* linux/powerpc64/syscallent.h (iopl): Likewise.
2016-04-20 01:08:13 +00:00
10c6c3f7b5 alpha: fix decoding of shmat syscall
On alpha, shmat syscall is known as osf_shmat.

* linux/alpha/syscallent.h (osf_shmat): Fix sys_flags and sys_func.
2016-04-20 01:08:12 +00:00
dbc68b7034 avr32: wire up copy_file_range syscall
* linux/avr32/syscallent.h [325]: Add copy_file_range entry.
2016-03-29 00:01:07 +00:00
e17f28dce0 Update generic ioctl entries from linux 4.5
* linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* NEWS: Mention this.
2016-03-27 00:03:27 +00:00
5d6292c167 hppa: wire up copy_file_range syscall
* linux/hppa/syscallent.h [346]: Add copy_file_range entry.
2016-02-21 01:53:31 +00:00
0cb245a76c mips: wire up copy_file_range syscall
* linux/mips/syscallent-n32.h [6324]: Add copy_file_range entry.
* linux/mips/syscallent-n64.h [5320]: Likewise.
* linux/mips/syscallent-o32.h [4360]: Likewise.
2016-02-20 00:37:01 +00:00
1ab6e25585 Replace printargs_lu and printargs_ld with printargs_u and printargs_d
* defs.h (printargs_lu): Rename to printargs_u.
(printargs_ld): Rename to printargs_d.
* syscall.c (printargs_lu): Rename to printargs_u.  Replace %lu with %u.
(printargs_ld): Rename to printargs_d.  Replace %ld with %d.
* linux/dummy.h (sys_getpgrp): Change to printargs.
(sys_alarm): Change to printargs_u.
(sys_getpgid, sys_getsid, sys_nice, sys_setpgid, sys_setpgrp,
sys_timer_delete, sys_timer_getoverrun): Change to printargs_d.
2016-02-14 22:30:27 +00:00
c1f99f569a Implement copy_file_range syscall decoding
* copy_file_range.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/32/syscallent.h (copy_file_range): New entry.
* linux/64/syscallent.h: Likewise.
* linux/arm/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* pathtrace.c (pathtrace_match): Add SEN_copy_file_range.
* NEWS: Mention new syscall parser.
* tests/copy_file_range.c: New file.
* tests/copy_file_range.test: New test.
* tests/.gitignore: Add copy_file_range.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add copy_file_range.test.
2016-02-14 00:36:38 +00:00
4ab20405bc Fix numbers of syscall arguments in syscall tables
This semi-automatic change brings syscall tables in sync with kernel's
include/linux/syscalls.h file.

* linux/aarch64/syscallent.h (recv): Fix nargs.
* linux/alpha/syscallent.h (sigaltstack, init_module,
sched_getscheduler, settimeofday): Likewise.
* linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl,
shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy,
timerfd_create): Likewise.
* linux/bfin/syscallent.h (signal, delete_module): Likewise.
* linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler,
io_cancel, set_tid_address, listxattr, llistxattr, flistxattr,
removexattr, lremovexattr, fremovexattr): Likewise.
* linux/i386/syscallent.h (signal, mmap): Likewise.
* linux/ia64/syscallent.h (init_module, readv, writev,
sched_getscheduler): Likewise.
* linux/m68k/syscallent.h (signal, request_key): Likewise.
* linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice):
Likewise.
* linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module,
delete_module): Likewise.
* linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module,
delete_module): Likewise.
* linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm,
fstatfs64): Likewise.
* linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise.
* linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead,
fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2,
fallocate, preadv, pwritev, fanotify_mark): Likewise.
* linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise.
* linux/s390x/syscallent.h (signal, ipc): Likewise.
* linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice):
Likewise.
* linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt,
shmctl, fstatfs64, vmsplice): Likewise.
* linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise.
* linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64,
readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc,
sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise.
* linux/x32/syscallent.h (64:recvmsg): Likewise.
* linux/xtensa/syscallent.h (mremap, futex, reboot, init_module,
delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat,
futimesat, fchmodat, faccessat): Likewise.
* NEWS: Mention this fix.
2016-02-13 00:57:00 +00:00
f3948fe494 s390: decode fadvise64 and fadvise64_64
* linux/s390/syscallent.h (fadvise64): Set sys_func.
(fadvise64_64): Set nargs and sys_func.
2016-02-13 00:57:00 +00:00
61066ea8e7 mips n64: use the most optimal parser for fadvise64 syscall
* linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64)
with SEN(fadvise64).
2016-02-13 00:57:00 +00:00
1a1661813d ia64: decode fstatfs64 and statfs64
* linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func.
2016-02-13 00:57:00 +00:00
a1e822870e alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments
On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures
pipe syscall does not take arguments.

* linux/alpha/syscallent.h (pipe): Change nargs to 0.
* linux/ia64/syscallent.h (pipe): Likewise.
* linux/mips/syscallent-n32.h (pipe): Likewise.
* linux/mips/syscallent-n64.h (pipe): Likewise.
* linux/mips/syscallent-o32.h (pipe): Likewise.
* linux/sh/syscallent.h (pipe): Likewise.
* linux/sh64/syscallent.h (pipe): Likewise.
2016-02-13 00:57:00 +00:00
3a630751eb avr32: wire up missing syscalls
* linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier,
and mlock2 entries.
2016-02-13 00:57:00 +00:00
1763fa5f62 s390, s390x: fix printing of syscalls unknown to the kernel
On s390/s390x, syscalls with NR up to 255 can be implemented
directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used.
The latter method is allowed for NR < 256, too.

When the syscall number specified directly or indirectly is recognized
by the kernel, i.e. it is less than its NR_syscalls value, it is stored
in %r2 and is available to arch_get_scno via s390_regset.gprs[2].
For syscall numbers >= NR_syscalls this register is set to 0,
but %r1 remains unchanged and could be used by arch_get_scno
via s390_regset.gprs[1] to decide what the syscall number is.

* linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero,
take syscall number from s390_regset.gprs[1].
* NEWS: Mention this fix.

This fixes Debian bug #485979 and Fedora bug #1298294.
2016-01-13 21:27:48 +00:00
e2136d4b89 s390, s390x: print all syscall arguments for syscall number 0
* linux/s390/syscallent.h [0]: Set nargs to MA.
* linux/s390x/syscallent.h: Likewise.
2016-01-13 21:26:26 +00:00
606fcd0878 mips o32: alias sys_syscall to printargs
* linux/dummy.h (sys_syscall): Alias to printargs.
* syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove.
2016-01-13 21:26:26 +00:00
8493dcf6f7 s390: fix sigreturn decoding on recent kernels
Linux kernel commit v4.3-rc1-50-g8d4bd0e corrected uc_sigmask
of the compat signal frame, so remove the old workaround.

* linux/s390/arch_sigreturn.c (arch_sigreturn) [S390]: Remove.
2016-01-12 03:07:39 +00:00
5b87572952 avr32: wire up accept4 syscall
* linux/avr32/syscallent.h [321]: Add accept4 entry.
2016-01-10 21:38:03 +00:00
7de53317ab sparc64: fix names of {s,g}etres{u,g}id syscalls
* linux/sparc64/syscallent.h [108 ... 111]: Use sparc64 syscall names.
2016-01-09 22:54:53 +00:00
b663fd990b sparc64: remove sparc32 syscall entries
* linux/sparc64/syscallent.h [31, 32, 35, 44, 53, 56, 69, 70, 72, 77,
82, 84, 87, 89, 91, 94, 112, 115, 155, 231]: Unassign.
2016-01-09 22:53:33 +00:00
f77c4e6d25 sparc: remove sparc64 syscall entries
* linux/sparc/syscallent.h [52, 163]: Unassign.
2016-01-09 22:47:25 +00:00
f5fb0a7249 sparc64: clone syscallent.h from sparc
* linux/sparc64/syscallent.h: Clone from linux/sparc/syscallent.h.
2016-01-09 22:44:00 +00:00
b1110543d9 sparc: fix mlock2 sysentry, wire up bind, listen, and setsockopt syscalls
* linux/sparc/syscallent.h [353]: Move mlock2 entry to 356.
[353, 354, 355]: Add bind, listen, and setsockopt entries.
* NEWS: Mention this.
2016-01-09 21:58:44 +00:00
2720a61832 alpha: enhance decoding of getxpid, getxuid, and getxgid syscalls
Print the second return value of getxpid, getxuid, and getxgid syscalls
that return a pair of values using the same mechanism as pipe syscall.

* alpha.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/alpha/syscallent.h [20]: Change SEN(getpid) to SEN(getxpid).
[24]: Change SEN(getuid) to SEN(getxuid).
[47]: Change SEN(getgid) to SEN(getxgid).
* NEWS: Mention this enhancement.
* tests/uid.awk: Update for getxgid output change.
* tests/uid.test: Cleanup.
* tests/getxxid.c: New file.
* tests/getxxid.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add getxxid.
(TESTS): Add getxxid.test.
* tests/.gitignore: Add getxxid.
2016-01-09 00:09:04 +00:00
fbec510297 alpha: alias getdtablesize to printargs
* linux/dummy.h [ALPHA] (sys_getdtablesize): Alias to printargs.
* desc.c [ALPHA] (SYS_FUNC(getdtablesize)): Remove.
2016-01-08 18:53:27 +00:00
aef5e14ba2 Set SYSCALL_NEVER_FAILS flag for getpid, getppid and gettid syscall
* linux/*/syscallent*.h (getpid, getppid, gettid): Set NF flag.
2015-12-29 01:15:20 +00:00
dd039b74ef Set SYSCALL_NEVER_FAILS flag for umask syscall
Linux kernel always ANDs umask argument with 0700 and therefore
this syscall never fails.

* linux/*/syscallent*.h (umask): Set NF flag.
2015-12-29 01:15:06 +00:00
552f2f62fd alpha, ia64, mips, nios2, powerpc, sparc: always check for syscall error
On architectures that use dedicated registers to report syscall errors,
check for syscall error condition regardless of SYSCALL_NEVER_FAILS flag
in the syscall entry.  On architectures that use negated errno
semantics, there is no way to distinguish a syscall error from a valid
return code that looks like a syscall error, and the check for
SYSCALL_NEVER_FAILS flag remains the only way to tell one case
from another.

* linux/alpha/get_error.c (get_error): Ignore check_errno.
* linux/ia64/get_error.c: Likewise.
* linux/mips/get_error.c: Likewise.
* linux/nios2/get_error.c: Likewise.
* linux/powerpc/get_error.c: Likewise.
* linux/sparc/get_error.c: Likewise.
* linux/sparc64/get_error.c: Likewise.
2015-12-27 01:02:53 +00:00
a147bf8500 sh, sh64: fix syscall flags in several syscall entries
* linux/sh/syscallent.h (geteuid32, getegid32, setfsuid32, setfsgid32):
Set SYSCALL_NEVER_FAILS flag.
(fchown32): Set TRACE_DESC flag.
* linux/sh64/syscallent.h: Likewise.
2015-12-25 21:15:59 +00:00
ffb6c55d7d Set SYSCALL_NEVER_FAILS flag for personality syscall
Starting with commit
v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, personality
syscall never fails to set the personality, but before commit
v2.6.35-rc1-372-g485d527 it still could return an error.
Starting with that commit, personality syscall never returns an error.

* linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag in personality
syscall entries.
2015-12-25 00:45:43 +00:00
dd1a80c8d2 arc, metag, nios2, or1k, tile: fix build
Fix build regression introduced by commit
34683e3926.

* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
* linux/nios2/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
* NEWS: Mention this build fix.

Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
2015-12-24 17:36:58 +00:00
23828a5bbf ia64: wire up mlock2 syscall
* linux/ia64/syscallent.h [1346]: Add mlock2 entry.
2015-12-18 20:55:40 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
Szabolcs Nagy
34683e3926 Fix SYS_FUNC and SEN macros for musl
The syscall_name argument was subject to macro expansion because
it was passed down to other macros before it was prefixed.

musl libc defines lfs64 names as macros (e.g. fstat64 as fstat)
so SYS_FUNC(fstat64) was expanded to sys_fstat.

This change adds the prefix before the name is passed to other macros,
i.e. the argument of SYS_FUNC_NAME is already prefixed with sys_.

* defs.h (SYS_FUNC): Add sys_ prefix to SYS_FUNC_NAME's argument.
(SYS_FUNC_NAME): Do not add sys_ prefix to MPERS_FUNC_NAME's argument.
* linux/ia64/syscallent.h (SYS_FUNC_NAME): Do not add sys_ prefix
to MPERS_FUNC_NAME's argument.
* syscall.c (SEN_NAME): Remove.
(SEN): Replace SEN_NAME call with its definition.  Add sys_ prefix
to SYS_FUNC_NAME's argument.
2015-12-16 00:06:59 +00:00
90c7de66b9 aarch64: make arm registers unsigned
Follow the x86_64 example and define registers in arm_pt_regs
as unsigned, to avoid potential sign extension bugs.

This also fixes --enable-gcc-Werror build.

* linux/aarch64/arch_regs.c (arm_pt_regs): Change uregs's type
from int to uint32_t.

Reported-by: Sergey Bolshakov <sbolshakov@altlinux.org>
2015-12-11 10:52:42 +00:00
cdd2f84d8f ia64: print all ia32 syscalls using printargs
Printing of ia32 syscalls on ia64 must have been broken for a long time.
Do not pretend that it works, print ia32 syscalls using printargs
instead.

* linux/ia64/syscallent.h: Remove all redefinitions of sys_* macros.
Stop including"../dummy.h".  Include "../i386/syscallent.h" with
SYS_FUNC_NAME macro temporarily redirected to printargs.
2015-12-09 11:48:52 +00:00
232cf04c83 Fix build on architectures for which arch_sigreturn is not implemented
This complements commit 527b42ff8d.

* linux/arch_sigreturn.c (arch_sigreturn): Define.
2015-12-09 11:46:43 +00:00
c37173f76d aarch64: swap 64-bit and 32-bit personalities
Let native 64-bit personality be personality 0, and 32-bit personality
be personality 1, to follow the traditional layout used for other
architectures.

* defs.h [AARCH64]: Swap PERSONALITY0_WORDSIZE and
PERSONALITY1_WORDSIZE, remove DEFAULT_PERSONALITY.
[AARCH64 && HAVE_M32_MPERS]: Rename PERSONALITY1_* to PERSONALITY0_*.
* file.c [AARCH64 || defined X86_64 || defined X32]: Define
STAT32_PERSONALITY for AARCH64 as well.
* syscall.c (update_personality) [AARCH64]: Adjust PERSONALITY_NAMES.
* linux/aarch64/errnoent1.h: Adjust comment.
* linux/aarch64/get_error.c (get_error): Adjust tcp->currpers check.
* linux/aarch64/get_syscall_args.c (get_syscall_args): Likewise.
* linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Likewise.
* linux/aarch64/get_scno.c (arch_get_scno): Adjust update_personality
invocations.
* linux/aarch64/ioctls_arch0.h: Swap with ...
* linux/aarch64/ioctls_arch1.h: ... this file.
* linux/aarch64/ioctls_inc0.h: Swap with ...
* linux/aarch64/ioctls_inc1.h: ... this file.
* linux/aarch64/syscallent.h: Swap with ...
* linux/aarch64/syscallent1.h: ... this file.
2015-12-09 01:09:11 +00:00
e3a2fe007b mips: fix fadvise64 syscall entries
* linux/mips/syscallent-n32.h [6216]: Change syscall handler
from fadvise64 to fadvise64_64.
* linux/mips/syscallent-n64.h [5215]: Rename from "fadvise64_64"
to "fadvise64"
* linux/mips/syscallent-o32.h [4254]: Likewise.
2015-12-08 22:35:26 +00:00
ebb38bc5bb xtensa: wire up syncfs syscall
* linux/xtensa/syscallent.h [179]: Add syncfs entry.
2015-12-08 21:19:53 +00:00
2b722e20c8 sh, sh64: fix syscall entries
* linux/sh/syscallent.h [322]: Fix timerfd_create entry.
* linux/sh64/syscallent.h [350]: Likewise.
[0]: Fix restart_syscall entry.
2015-12-08 21:19:53 +00:00
57dfe5f814 powerpc, powerpc64: wire up mlock2 syscall
* linux/powerpc/syscallent.h [378]: Add mlock2 entry.
* linux/powerpc64/syscallent.h: Likewise.
2015-12-08 21:19:53 +00:00
b506f78d02 hppa: fix syscall entries
* linux/hppa/syscallent.h: Swap [343] and [344] entries.
2015-12-08 21:19:53 +00:00
19a6d71915 avr32: update syscall entries
* linux/avr32/syscallent.h [0]: Rename from setup to restart_syscall.
[284 ... 320]: New entries.
2015-12-08 21:19:53 +00:00
8e7c92b6b7 m68k: fix syscall names
* linux/m68k/syscallent.h [335]: Rename "atomic_comxchg_32"
to "atomic_cmpxchg_32".
2015-12-08 21:19:53 +00:00
59a1586bcb sparc: update syscall names
* linux/sparc/syscallent.h [160]: Rename "sched_setaffinity"
to "sched_set_affinity".
[161]: Rename "sched_getaffinity" to "sched_get_affinity".
2015-12-08 21:19:53 +00:00
d4bb0ba7e8 powerpc, powerpc64: update syscall names
* linux/powerpc/syscallent.h [201]: Rename "MOL" to "multiplexer".
[225]: Rename "tux" to "tuxcall".
[256]: Rename "debug_setcontext" to "sys_debug_setcontext".
* linux/powerpc64/syscallent.h: Likewise.
2015-12-08 21:19:53 +00:00