Commit Graph

3478 Commits

Author SHA1 Message Date
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
a8b0ceffc2 alpha: update syscall entries
* linux/alpha/syscallent.h [224 ... 228]: Add stub entries.
[100]: Rename "osf_getpriority" to "getpriority".
[255]: Rename "osf_subsysinfo" to "osf_subsys_info".
[303]: Rename "adjtimex32" to "old_adjtimex".
[319]: Rename "sysctl" to "_sysctl".
[320]: Remove.
2015-12-08 21:19:53 +00:00
476ec393c3 Fix mmap syscall entries
Change syscall names to match kernel __NR_* constants.

* linux/avr32/syscallent.h [90]: Rename "mmap" to "mmap2".
* linux/bfin/syscallent.h [90]: Rename "old_mmap" to "mmap".
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* tests/mmap.c (main): Remove old_mmap from expected output.
* tests/mmap.test: Remove old_mmap from the list of mmap syscalls.
2015-12-08 21:19:43 +00:00
69b7307225 Fix select and _newselect syscall entries
Change syscall names to match kernel __NR_* constants.
This reverts commit ddcf54969d.

* linux/arm/syscallent.h [82]: Rename "oldselect" to "select".
[142]: Rename "select" to "_newselect".
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/powerpc/syscallent.h [82]: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/hppa/syscallent.h [142]: Rename "select" to "_newselect".
* linux/mips/syscallent-n32.h [6022]: Rename "select" to "_newselect".
* linux/mips/syscallent-n64.h [5022]: Likewise.
* linux/mips/syscallent-o32.h [4142]: Likewise.
* linux/s390/syscallent.h [142]: Rename "select" to "_newselect".
* linux/sparc/syscallent.h [230]: Rename "select" to "_newselect".
* tests/oldselect.test: Rename oldselect to select.  Convert
from match_grep to match_diff.
* tests/oldselect.expected: Likewise.
* xselect.c: New file, based on select.c.
* tests/_newselect.c: New file.
* tests/select.c: Replace with a wrapper around xselect.c.
* tests/select.test: Parametrize.
* tests/_newselect.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add _newselect.
(TESTS): Add _newselect.test.
(EXTRA_DIST): Add xselect.c.
* tests/.gitignore: Add _newselect.
2015-12-08 21:19:40 +00:00
dd360922d1 Fix exit syscall entries
Change syscall names to match kernel __NR_* constants.

* linux/avr32/syscallent.h [1]: Rename "_exit" to "exit".
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/x32/syscallent.h [60]: Rename "_exit" to "exit".
* linux/x86_64/syscallent.h: Likewise.
2015-12-08 21:19:35 +00:00
5090dde123 Fix pread64 and pwrite64 syscall entries
Change syscall names to match kernel __NR_* constants.

* linux/alpha/syscallent.h [349]: Rename "pread" to "pread64".
[350]: Rename "pwrite" to "pwrite64".
* linux/ia64/syscallent.h [1148]: Rename "pread" to "pread64".
[1149]: Rename "pwrite" to "pwrite64".
* linux/sh/syscallent.h [180]: Rename "pread" to "pread64".
[181]: Rename "pwrite" to "pwrite64".
* linux/sh64/syscallent.h: Likewise.
* linux/x32/syscallent.h [17]: Rename "pread" to "pread64".
[18]: Rename "pwrite" to "pwrite64".
* linux/x86_64/syscallent.h: Likewise.
2015-12-08 21:19:16 +00:00
718990f210 tests: sort the list of tests
* tests/Makefile.am (TESTS): Sort the list of regular tests.
* tests/.gitignore: Sort.
2015-12-08 19:07:24 +00:00
f04eeddbc5 ia64: fix remap_file_pages syscall entry
* linux/ia64/syscallent.h (1125): Set to remap_file_pages.
2015-12-08 04:16:15 +00:00
59281fc8a1 bfin, i386: remove sysentry for nonexistent security syscall
* linux/bfin/syscallent.h (223): Remove.
* linux/i386/syscallent.h: Likewise.
2015-12-08 02:51:02 +00:00
77c0cde116 build: add -D_FILE_OFFSET_BITS=64 to _CPPFLAGS instead of _CFLAGS
* tests/Makefile.am (fstat64_CFLAGS): Rename to fstat64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(fstatat64_CFLAGS): Rename to fstatat64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(ftruncate64_CFLAGS): Rename to ftruncate64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(lstat64_CFLAGS): Rename to lstat64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(mmap64_CFLAGS): Rename to mmap64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(newfstatat_CFLAGS): Rename to newfstatat_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(stat64_CFLAGS): Rename to stat64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(statfs_CFLAGS): Rename to statfs_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(truncate64_CFLAGS): Rename to truncate64_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
(uio_CFLAGS): Rename to uio_CPPFLAGS,
replace $(AM_CFLAGS) with $(AM_CPPFLAGS).
2015-12-08 00:29:42 +00:00
323cc92d60 Move x32 <asm/stat.h> replacement to x32 specific directory
As tests-m*32/Makefile.am files now refer to proper arch specific
directories, it's possible to relocate x32 <asm/stat.h> replacement
to its arch specific directory.

* linux/x86_64/asm_stat.h: Move ...
* linux/x32/asm_stat.h: ... here, remove x32 guard.
* Makefile.am (strace_SOURCES): Remove linux/x86_64/asm_stat.h.
2015-12-08 00:14:26 +00:00
860b3a692b build: set arch specific -m switches in tests-m*32/Makefile.am files properly
* tests/Makefile.am (ARCH_MFLAGS, AM_LDFLAGS): New variables.
(AM_CPPFLAGS): Use ARCH_MFLAGS.
* bootstrap: In tests-m32/Makefile.am and tests-mx32/Makefile.am,
add -m32 and -mx32, respectively, to ARCH_MFLAGS instead of AM_CFLAGS.
2015-12-08 00:14:10 +00:00
1e04e57a7a build: initialize ARCH variable in tests-m*32/Makefile.am files properly
* configure.ac (arch_m32): Set to sparc on sparc64, powerpc on
powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases.
(arch_mx32): Set to x32 on x86_64, $arch in other cases.
(AC_SUBST): Add arch_m32 and arch_mx32.
* bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am.
Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am.
2015-12-08 00:13:38 +00:00
08a178366a tests: add umount.test and umount2.test
* tests/umount.c: New file.
* tests/umount2.c: Likewise.
* tests/umount.test: New test.
* tests/umount2.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add umount and umount2.
(TESTS): Add umount.test and umount2.test.
* tests/.gitignore: Add umount and umount2.
2015-12-07 01:23:39 +00:00
6a8095eaed avr32: fix umount2 syscall entry
* linux/avr32/syscallent.h: Rename umount to umount2.
2015-12-07 00:38:43 +00:00
97af1be4c6 Update umount2 flags
* umount.c (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): Move definitions ...
* xlat/umount_flags.in: ... here.  Add UMOUNT_NOFOLLOW.
2015-12-07 00:38:38 +00:00
431d7fd21a Print the first argument of umount2 syscall as a path
* umount.c (SYS_FUNC(umount2)): Use printpath instead of printstr.

This fixes Debian bug #785050.
2015-12-07 00:10:58 +00:00
eb76c4be15 prctl: add PR_CAP_AMBIENT parser
* xlat/pr_cap_ambient.in: New file.
* prctl.c: Include "xlat/pr_cap_ambient.h".
(SYS_FUNC(prctl)): Handle PR_CAP_AMBIENT.
2015-12-06 15:33:53 +00:00
1b283307d1 prctl: finish decoding of several commands on entering syscall
* prctl.c (SYS_FUNC(prctl)): Return RVAL_DECODED after decoding of
PR_GET_DUMPABLE, PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK,
PR_GET_TIMING, and PR_CAPBSET_READ commands.
2015-12-06 15:29:04 +00:00
b165910f98 Fix build on systems that lack EM_FRV definition
* xlat/audit_arch.in: Guard AUDIT_ARCH_FRV with EM_FRV check.
2015-12-06 15:13:01 +00:00
4bbed305da times.test: workaround buggy libc
* tests/times.c: Include <sys/syscall.h>.
(main): On systems where user's and kernel's long types are the same,
prefer direct times syscall over libc's times function because
the latter is more prone to return value truncation.
2015-12-06 07:59:20 +00:00
fc0a22d40b times.test: reduce cpu time consumption, increase struct tms diversity
* tests/times.c (main): Reduce cpu time consumption fourfold,
make the parent process consume less cpu time than the child process
so that members of the structure returned by times syscall would be
more likely to contain different values.
2015-12-06 07:24:16 +00:00
bb509aafb6 mips n32, x32: fix printing of times syscall return value
As times syscall returns kernel's long value, it has to be printed as
RVAL_LUDECIMAL on systems where long type is less than kernel's long.

* times.c (SYS_FUNC(times)) [RVAL_LUDECIMAL && !IN_MPERS]:
Return RVAL_LUDECIMAL instead of RVAL_UDECIMAL.
2015-12-06 07:24:16 +00:00
4f109266ec unix-yy.test: fix portability issue
* tests/unix-yy-connect.awk (r_close_listen): Quote square brackets
that are not part of a bracket expression.
2015-12-06 07:24:16 +00:00
02d92d095c inet-cmsg.test: skip the test when the network is not functional
* tests/inet-cmsg.c (main): Return 77 if inet datagram socket
cannot be bound to INADDR_LOOPBACK.
2015-12-06 01:02:17 +00:00
2154702865 fcntl: skip F_GETLK64, F_SETLK64, and F_SETLKW64 in fcntl syscall parser
As the kernel recognizes F_GETLK64, F_SETLK64, and F_SETLKW64 commands
in fcntl64 syscall only, do not parse their structures in fcntl parser.

* xlat/fcntlcmds.in: Move F_GETLK64, F_SETLK64, and F_SETLKW64 ...
* xlat/fcntl64cmds.in: ... here.
* fcntl.c: Include "xlat/fcntl64cmds.h".
(print_fcntl): Move printing of first two syscall arguments
and handling of F_GETLK64, F_SETLK64, and F_SETLKW64 commands ...
(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): ... here.
* tests/fcntl.c: New file, based on struct_flock.c.
* tests/fcntl64.c: Likewise.
* tests/struct_flock.c (test_flock_einval, create_sample): New functions.
(test_flock): Use test_flock_einval.
(test_flock64, main): Remove.
* tests/fcntl.test: New test.
* tests/fcntl64.test: Likewise.
* tests/struct_flock.test: Remove.
* tests/Makefile.am (check_PROGRAMS): Add fcntl and fcntl64,
remove struct_flock.
(TESTS): Add fcntl.test and fcntl64.test, remove struct_flock.test.
(EXTRA_DIST) Add struct_flock.c.
* tests/.gitignore: Add fcntl and fcntl64, remove struct_flock.
2015-12-05 19:35:51 +00:00
03202dac48 print_fcntl: finish with unrecognized commands on entering syscall
* fcntl.c (print_fcntl): Merge two switch statements.
2015-12-05 17:54:26 +00:00
Elvira Khabirova
211d6ef4b6 fcntl: create a separate parser for fcntl64 syscall
* fcntl.c(print_fcntl): New function, made from SYS_FUNC(fcntl).
(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use it.
* linux/32/syscallent.h: Change parser of fcntl64 to SEN(fcntl64).
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
2015-12-04 23:12:14 +00:00
c9d2501a36 travis-ci: add build matrix 2015-12-05 00:04:12 +00:00
144a9db236 tests: replace old stat tests with stat.test and stat64.test
* tests/stat.c: Replace with a wrapper around lstatx.c
* tests/stat.test: Replace with a wrapper around statx.sh.
* tests/stat32-v.test: Remove.
* tests/stat32.c: Remove.
* tests/stat64-v.test: Remove.
* tests/stat64.c: New file.
* tests/stat64.test: New test.
* tests/Makefile.am (check_PROGRAMS): Replace stat32 with stat64.
(stat_CFLAGS): Rename to stat64_CFLAGS.
(TESTS): Replace stat32-v.test and stat64-v.test with stat64.test.
* tests/.gitignore: Replace stat32 with stat64.
2015-12-05 00:03:49 +00:00
38e37686f2 tests: add lstat.test and lstat64.test
* tests/lstat.c: New file.
* tests/lstat64.c: Likewise.
* tests/lstatx.c: Likewise.
* tests/lstat.test: New test.
* tests/lstat64.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add lstat and lstat64.
(lstat64_CFLAGS): Define.
(TESTS): Add lstat.test and lstat64.test.
(EXTRA_DIST): Add lstatx.c.
* tests/.gitignore: Add lstat and lstat64.
2015-12-05 00:03:02 +00:00
c863827ddb tests: add fstat.test and fstat64.test
* tests/fstat.c: New file.
* tests/fstat64.c: Likewise.
* tests/fstatx.c: Likewise.
* tests/fstat.test: New test.
* tests/fstat64.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add fstat and fstat64.
(fstat64_CFLAGS): Define.
(TESTS): Add fstat.test and fstat64.test.
(EXTRA_DIST): Add fstatx.c.
* tests/.gitignore: Add fstat and fstat64.
2015-12-05 00:02:44 +00:00
cc2baf339f tests: prepare for detailed testing of stat family syscalls
Parametrize code from fstatat.c to support <asm/stat.h>
as an alternative to <sys/stat.h> and move it to a separate file.

* tests/statx.sh: New file, based on fstatat64.test.
* tests/fstatat64.test: Use it.
* tests/newfstatat.test: Likewise.
* tests/xstatx.c: New file, based on fstatat.c.
* tests/fstatat.c: Use it.
* tests/Makefile.am (EXTRA_DIST): Add statx.sh and xstatx.c.
* tests/fstatat64.c (FSTATAT_NAME): Change to TEST_SYSCALL_NAME.
* tests/newfstatat.c: Likewise.
2015-12-05 00:01:56 +00:00
Gabriel Laskar
8b6046a052 ioctl: allow to stop decoding number
For some ioctls, like from drm, the identification of the correct ioctl
is done by custom code.  Specifying IOCTL_NUMBER_STOP_LOOKUP on
return of ioctl_decode_command_number() disables further calls to
ioctl_lookup().

* defs.h (IOCTL_NUMBER_UNKNOWN, IOCTL_NUMBER_HANDLED,
IOCTL_NUMBER_STOP_LOOKUP): Add macros representing ioctl number state
decoding.
* ioctl.c (SYS_FUNC(ioctl)): Skip ioctl_lookup() when
ioctl_decode_command_number() returns a value with
IOCTL_NUMBER_STOP_LOOKUP flag is set.

Suggested-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2015-12-04 18:05:38 +00:00
5421855219 tests: skip restart_syscall.test on x32
The syscall number of restart_syscall returned by the kernel in case
of ERESTART_RESTARTBLOCK is broken on x32 from the beginning, see
https://lkml.org/lkml/2015/11/30/790

Until that improves, skip the test on x32.

* tests/restart_syscall.c (main) [__x86_64__ && __ILP32__]: Return 77.
2015-12-04 16:57:23 +00:00
a5aa080ae6 x32: fix decoding of i386 personality lseek syscall
On x32, tcp->ext_arg is not initialized for i386 personality,
so tcp->u_arg has to be used instead.

* lseek.c (SYS_FUNC(lseek)) [X32]: Handle "current_personality == 1" case.
2015-12-04 16:42:30 +00:00
cfde1e3f0f x86_64, x32: add a replacement for <asm/stat.h>
Some old kernel headers, Ubuntu 14.04 in particular, provide
<asm/stat.h> editions that are completely wrong for x32.
Workaround this issue by providing a replacement.

* linux/x86_64/asm_stat.h: New file.
* linux/x32/asm_stat.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
2015-12-04 15:22:58 +00:00
c31481fc68 Add a wrapper around <asm/stat.h>
* linux/asm_stat.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c: Use it.
2015-12-04 15:03:12 +00:00
5627cf9080 kernel_types.h: protect from double inclusion
* kernel_types.h: Add #include guard.
2015-12-04 14:32:52 +00:00
530d462783 fstatat64.test: lift /proc requirement
While -P option needs /proc to match descriptors, it does not use
/proc to match pathnames.  As this test does not need descriptor
match, the /proc requirement can be safely lifted.

* tests/fstatat64.test: Lift /proc/self/fd/ requirement.
2015-12-03 15:48:43 +00:00
b0e61152ca tests: add fstatat64.test and newfstatat.test
* configure.ac (AC_CHECK_FUNCS): Add fstatat, ftruncate, and futimens.
* tests/fstatat.c: New file.
* tests/fstatat64.c: Likewise.
* tests/newfstatat.c: Likewise.
* tests/fstatat64.test: New test.
* tests/newfstatat.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add fstatat64 and newfstatat.
(fstatat64_CFLAGS, newstatat_CFLAGS): Define.
(TESTS): Add fstatat64.test and newfstatat.test.
(EXTRA_DIST): Add fstatat.c.
* tests/.gitignore: Add fstatat64 and newfstatat.
2015-12-02 01:02:39 +00:00
84940d4892 alpha, ppc, sh, sh64: fix fstatat64 syscall entries
* linux/alpha/syscallent.h (newfstatat): Change sys_name to fstatat64.
* linux/powerpc/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
2015-12-01 11:35:21 +00:00
fdb3544ef2 ppc64: clone syscallent.h from ppc
* linux/powerpc64/syscallent.h: Clone from linux/powerpc/syscallent.h
with entries for numbers 192..197, 204, 226, and 254 unassigned.
2015-12-01 11:28:43 +00:00
9db0797b22 tests: add lseek.test and llseek.test
* tests/llseek.c: New file.
* tests/lseek.c: Likewise.
* tests/llseek.test: New test.
* tests/lseek.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add llseek and lseek.
(TESTS): Add llseek.test and lseek.test.
* tests/.gitignore: Add llseek and lseek.
2015-12-01 08:29:12 +00:00
431d63c13f tests: add ftruncate64.test and truncate64.test
* tests/ftruncate64.c: New file.
* tests/truncate64.c: Likewise.
* tests/ftruncate64.test: New test.
* tests/truncate64.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add ftruncate64 and truncate64.
(ftruncate64_CFLAGS, truncate64_CFLAGS): Define.
(TESTS): Add ftruncate64.test and truncate64.test.
* tests/.gitignore: Add ftruncate64 and truncate64.
2015-12-01 08:28:45 +00:00