]>
granicus.if.org Git - strace/log
Dmitry V. Levin [Tue, 19 Apr 2016 22:16:30 +0000 (22:16 +0000)]
tests: adjust rt_sigpending to older kernels
With linux kernels older than v3.9-rc1, compat rt_sigpending syscall
could fail with EFAULT in cases where on later kernels it succeeds.
Adjust the test to handle both cases properly.
* tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending
failed with EFAULT.
Dmitry V. Levin [Tue, 19 Apr 2016 21:10:44 +0000 (21:10 +0000)]
tests: adjust readv/writev and preadv/pwritev tests to older kernels
With linux kernels older than v3.16-rc1, iovec based compat syscalls may
return EINVAL in some cases where on later kernels they return EFAULT.
Adjust tests to handle both cases properly.
* tests/preadv-pwritev.c: Include <errno.h>.
(main): Print either "EINVAL" or "EFAULT" depending on errno.
* tests/pwritev.c: Likewise.
* tests/readv.c: Likewise.
Dmitry V. Levin [Tue, 19 Apr 2016 18:45:25 +0000 (18:45 +0000)]
tests: remove obsolete non-strict uid tests
Recently added strict tests for uid/gid related syscalls
made old uid tests obsolete.
* tests/uid.awk: Remove.
* tests/uid.c: Remove.
* tests/uid.test: Remove.
* tests/uid16.c: Remove.
* tests/uid16.test: Remove.
* tests/uid32.c: Remove.
* tests/uid32.test: Remove.
* tests/.gitignore: Remove uid, uid16, and uid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test.
(EXTRA_DIST): Remove uid.awk.
Dmitry V. Levin [Tue, 19 Apr 2016 18:28:03 +0000 (18:28 +0000)]
tests: extend test coverage of getuid/getgid family syscalls
Add strict tests for getuid, getuid32, getgid, getgid32, geteuid,
geteuid32, getegid, and getegid32 syscalls.
* tests/getegid.c: New file.
* tests/getegid.test: New test.
* tests/getegid32.c: New file.
* tests/getegid32.test: New test.
* tests/geteuid.c: New file.
* tests/geteuid.test: New test.
* tests/geteuid32.c: New file.
* tests/geteuid32.test: New test.
* tests/getgid.c: New file.
* tests/getgid.test: New test.
* tests/getgid32.c: New file.
* tests/getgid32.test: New test.
* tests/getuid.c: New file.
* tests/getuid.test: New test.
* tests/getuid32.c: New file.
* tests/getuid32.test: New test.
* tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid,
* geteuid32, getegid, and getegid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test,
geteuid32.test, getgid.test, getgid32.test, getuid.test,
and getuid32.test.
Dmitry V. Levin [Tue, 19 Apr 2016 17:45:26 +0000 (17:45 +0000)]
tests: extend test coverage of getresgid32 syscall
* tests/getresgid32.c: New file.
* tests/getresgid32.test: New test.
* tests/.gitignore: Add getresgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresgid32.test.
Dmitry V. Levin [Tue, 19 Apr 2016 17:42:51 +0000 (17:42 +0000)]
tests: extend test coverage of getresgid syscall
* tests/getresgid.c: New file.
* tests/getresgid.test: New test.
* tests/.gitignore: Add getresgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresgid.test.
Dmitry V. Levin [Tue, 19 Apr 2016 17:34:00 +0000 (17:34 +0000)]
tests: extend test coverage of getresuid32 syscall
* tests/getresuid32.c: New file.
* tests/getresuid32.test: New test.
* tests/.gitignore: Add getresuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresuid32.test.
Dmitry V. Levin [Tue, 19 Apr 2016 17:30:23 +0000 (17:30 +0000)]
tests: extend test coverage of getresuid syscall
* tests/getresugid.c: New file.
* tests/getresuid.c: New file.
* tests/getresuid.test: New test.
* tests/.gitignore: Add getresuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresuid.test.
(EXTRA_DIST): Add getresugid.c.
Fei Jie [Tue, 19 Apr 2016 07:38:34 +0000 (15:38 +0800)]
tests: add symlinkat.test
* tests/symlinkat.c: New file.
* tests/symlinkat.test: New test.
* tests/.gitignore: Add symlinkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add symlinkat.test.
Fei Jie [Tue, 19 Apr 2016 07:38:33 +0000 (15:38 +0800)]
tests: add iopl.test
* tests/iopl.c: New file.
* tests/iopl.test: New test.
* tests/.gitignore: Add iopl.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add iopl.test.
Dmitry V. Levin [Wed, 20 Apr 2016 00:46:50 +0000 (00:46 +0000)]
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.
Fei Jie [Tue, 19 Apr 2016 07:38:32 +0000 (15:38 +0800)]
tests: add ioperm.test
* tests/ioperm.c: New file.
* tests/ioperm.test: New test.
* tests/.gitignore: Add ioperm.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioperm.test.
Dmitry V. Levin [Tue, 19 Apr 2016 01:59:52 +0000 (01:59 +0000)]
Fix corner cases of getgroups and setgroups syscall decoders
* uid.c (print_groups): New function.
(SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it.
Print first syscall argument using %u format.
* tests/getgroups.c: New file.
* tests/getgroups.test: New test.
* tests/getgroups32.c: New file.
* tests/getgroups32.test: New test.
* tests/setgroups.c: New file.
* tests/setgroups.test: New test.
* tests/setgroups32.c: New file.
* tests/setgroups32.test: New test.
* tests/.gitignore: Add getgroups, getgroups32, setgroups,
and setgroups32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getgroups.test, getgroups32.test,
setgroups.test, and setgroups32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 16:24:48 +0000 (16:24 +0000)]
Cleanup setfsuid syscall decoder
* uid.c (SYS_FUNC(setfsuid)): Remove redundant check.
Dmitry V. Levin [Mon, 18 Apr 2016 16:10:07 +0000 (16:10 +0000)]
tests: check decoding of setfsgid32 syscall
* tests/setfsgid32.c: New file.
* tests/setfsgid32.test: New test.
* tests/.gitignore: Add setfsgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsgid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 16:08:38 +0000 (16:08 +0000)]
tests: check decoding of setfsgid syscall
* tests/setfsugid.c: New file.
* tests/setfsgid.c: New file.
* tests/setfsgid.test: New test.
* tests/.gitignore: Add setfsgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsgid.test.
(EXTRA_DIST): Add setfsugid.c.
Dmitry V. Levin [Mon, 18 Apr 2016 16:03:51 +0000 (16:03 +0000)]
tests: check decoding of setfsuid32 syscall
* tests/setfsuid32.c: New file.
* tests/setfsuid32.test: New test.
* tests/.gitignore: Add setfsuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsuid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 15:59:28 +0000 (15:59 +0000)]
tests: check decoding of setfsuid syscall
* tests/setfsugid.c: New file.
* tests/setfsuid.c: New file.
* tests/setfsuid.test: New test.
* tests/.gitignore: Add setfsuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsuid.test.
(EXTRA_DIST): Add setfsugid.c.
Dmitry V. Levin [Mon, 18 Apr 2016 15:23:56 +0000 (15:23 +0000)]
tests: extend test coverage of setresgid32 syscall
* tests/setresgid32.c: New file.
* tests/setresgid32.test: New test.
* tests/.gitignore: Add setresgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresgid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 15:22:34 +0000 (15:22 +0000)]
tests: extend test coverage of setresgid syscall
* tests/setresgid.c: New file.
* tests/setresgid.test: New test.
* tests/.gitignore: Add setresgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresgid.test.
Dmitry V. Levin [Mon, 18 Apr 2016 15:19:27 +0000 (15:19 +0000)]
tests: extend test coverage of setresuid32 syscall
* tests/setresuid32.c: New file.
* tests/setresuid32.test: New test.
* tests/.gitignore: Add setresuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresuid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 15:16:53 +0000 (15:16 +0000)]
tests: extend test coverage of setresuid syscall
* tests/setresugid.c: New file.
* tests/setresuid.c: New file.
* tests/setresuid.test: New test.
* tests/.gitignore: Add setresuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresuid.test.
(EXTRA_DIST): Add setresugid.c.
Dmitry V. Levin [Mon, 18 Apr 2016 14:38:57 +0000 (14:38 +0000)]
tests: extend test coverage of setregid32 syscall
* tests/setregid32.c: New file.
* tests/setregid32.test: New test.
* tests/.gitignore: Add setregid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setregid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 14:38:04 +0000 (14:38 +0000)]
tests: extend test coverage of setregid syscall
* tests/setregid.c: New file.
* tests/setregid.test: New test.
* tests/.gitignore: Add setregid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setregid.test.
Dmitry V. Levin [Mon, 18 Apr 2016 14:36:42 +0000 (14:36 +0000)]
tests: extend test coverage of setreuid32 syscall
* tests/setreuid32.c: New file.
* tests/setreuid32.test: New test.
* tests/.gitignore: Add setreuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setreuid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 14:34:31 +0000 (14:34 +0000)]
tests: extend test coverage of setreuid syscall
* tests/setreugid.c: New file.
* tests/setreuid.c: New file.
* tests/setreuid.test: New test.
* tests/.gitignore: Add setreuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setreuid.test.
(EXTRA_DIST): Add setreugid.c.
Dmitry V. Levin [Mon, 18 Apr 2016 13:46:47 +0000 (13:46 +0000)]
tests: extend test coverage of setgid32 syscall
* tests/setgid32.c: New file.
* tests/setgid32.test: New test.
* tests/.gitignore: Add setgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setgid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 13:45:36 +0000 (13:45 +0000)]
tests: extend test coverage of setgid syscall
* tests/setgid.c: New file.
* tests/setgid.test: New test.
* tests/.gitignore: Add setgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setgid.test.
Dmitry V. Levin [Mon, 18 Apr 2016 13:41:25 +0000 (13:41 +0000)]
tests: extend test coverage of setuid32 syscall
* tests/setuid32.c: New file.
* tests/setuid32.test: New test.
* tests/.gitignore: Add setuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setuid32.test.
Dmitry V. Levin [Mon, 18 Apr 2016 13:24:26 +0000 (13:24 +0000)]
tests: extend test coverage of setuid syscall
* tests/setugid.c: New file.
* tests/setuid.c: New file.
* tests/setuid.test: New test.
* tests/.gitignore: Add setuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setuid.test.
(EXTRA_DIST): Add setugid.c.
Fei Jie [Mon, 18 Apr 2016 07:10:54 +0000 (15:10 +0800)]
tests: add shmxt.test
* tests/shmxt.c: New file.
* tests/shmxt.test: New test.
* tests/.gitignore: Add shmxt.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add shmxt.test.
Dmitry V. Levin [Wed, 20 Apr 2016 01:05:18 +0000 (01:05 +0000)]
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.
Fei Jie [Mon, 18 Apr 2016 07:10:53 +0000 (15:10 +0800)]
tests: add semop.test
* tests/semop.c: New file.
* tests/semop.test: New test.
* tests/.gitignore: Add semop.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add semop.test.
Dmitry V. Levin [Mon, 18 Apr 2016 00:20:47 +0000 (00:20 +0000)]
prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations
* tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls.
Reported-by: Steve McIntyre <steve@einval.com>
Dmitry V. Levin [Mon, 18 Apr 2016 00:03:09 +0000 (00:03 +0000)]
tests/pselect6.c: fix potential output mismatch
* tests/pselect6.c (main): In the last case of printing pselect6
syscall, print the last argument the same way as in other cases.
Reported-by: Steve McIntyre <steve@einval.com>
Dmitry V. Levin [Sun, 17 Apr 2016 22:24:41 +0000 (22:24 +0000)]
tests: check decoding of fchown32 syscall
* tests/fchown32.c: New file.
* tests/fchown32.test: New test.
* tests/.gitignore: Add fchown32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchown32.test.
Dmitry V. Levin [Sun, 17 Apr 2016 22:24:41 +0000 (22:24 +0000)]
tests: check decoding of fchown syscall
* tests/fchown.c: New file.
* tests/fchown.test: New test.
* tests/.gitignore: Add fchown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchown.test.
Dmitry V. Levin [Sat, 16 Apr 2016 23:02:27 +0000 (23:02 +0000)]
tests: check decoding of lchown32 syscall
* tests/lchown32.c: New file.
* tests/lchown32.test: New test.
* tests/.gitignore: Add lchown32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add lchown32.test.
Dmitry V. Levin [Sat, 16 Apr 2016 23:02:27 +0000 (23:02 +0000)]
tests: check decoding of lchown syscall
* tests/lchown.c: New file.
* tests/lchown.test: New test.
* tests/.gitignore: Add lchown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add lchown.test.
Dmitry V. Levin [Fri, 15 Apr 2016 23:03:29 +0000 (23:03 +0000)]
tests: check decoding of chown32 syscall
* tests/chown32.c: New file.
* tests/chown32.test: New test.
* tests/.gitignore: Add chown32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add chown32.test.
Dmitry V. Levin [Fri, 15 Apr 2016 23:03:29 +0000 (23:03 +0000)]
tests: check decoding of chown syscall
* tests/chown.c: New file.
* tests/chown.test: New test.
* tests/xchownx.c: New file.
* tests/.gitignore: Add chown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add chown.test.
(EXTRA_DIST): Add xchownx.c.
Dmitry V. Levin [Thu, 14 Apr 2016 23:53:08 +0000 (23:53 +0000)]
Fix decoding of 16-bit uid_t/git_t
* uid.c (printuid): Always cast value to uid_t.
Dmitry V. Levin [Wed, 13 Apr 2016 22:38:17 +0000 (22:38 +0000)]
tests: move kernel uid overflow check to libtests
This code used in two different places, so move it to the library.
* tests/overflowuid.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/tests.h (check_overflowuid, check_overflowgid): New prototypes.
* tests/uid.c (main): Use check_overflowuid.
* tests/uid16.c (main): Likewise.
Dmitry V. Levin [Tue, 12 Apr 2016 04:39:25 +0000 (04:39 +0000)]
tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32
As x86_64 kernel does not support x32 syscall numbers in
SECCOMP_MODE_STRICT, skip affected tests on x32.
* tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out
using error_msg_and_skip.
* tests/prctl-seccomp-strict.c: Likewise.
Dmitry V. Levin [Tue, 12 Apr 2016 00:20:03 +0000 (00:20 +0000)]
tests: add seccomp-filter.test
* tests/seccomp-filter.c: New file.
* tests/seccomp-filter.test: New test.
* tests/.gitignore: Add seccomp-filter.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-filter.test.
Dmitry V. Levin [Tue, 12 Apr 2016 00:05:43 +0000 (00:05 +0000)]
seccomp: fix decoding of sock_fprog and sock_filter structures
Always print struct sock_fprog.len.
Fix printing of unfetchable elements in sock_filter array.
Fix printing of large sock_filter arrays.
* seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and
print_seccomp_fprog.
(print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog.
* tests/prctl-seccomp-filter-v.c (main): Update.
* tests/seccomp-filter-v.c: New file.
* tests/seccomp-filter-v.test: New test.
* tests/.gitignore: Add seccomp-filter-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-filter-v.test.
Dmitry V. Levin [Mon, 11 Apr 2016 20:25:01 +0000 (20:25 +0000)]
seccomp: print SECCOMP_* and BPF_* constants in a more compact way
* seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|".
* tests/prctl-seccomp-filter-v.c: Update.
Dmitry V. Levin [Mon, 11 Apr 2016 15:16:30 +0000 (15:16 +0000)]
tests: rename seccomp.test to prctl-seccomp-filter-v.test
* tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test.
* tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c.
* tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test.
Dmitry V. Levin [Mon, 11 Apr 2016 15:09:09 +0000 (15:09 +0000)]
tests: add seccomp-strict.test
* tests/seccomp-strict.c: New file.
* tests/seccomp-strict.test: New test.
* tests/.gitignore: Add seccomp-strict.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-strict.test.
Dmitry V. Levin [Mon, 11 Apr 2016 15:06:28 +0000 (15:06 +0000)]
tests: add prctl-seccomp-strict.test
* tests/prctl-seccomp-strict.c: New file.
* tests/prctl-seccomp-strict.test: New test.
* tests/.gitignore: Add prctl-seccomp-strict.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add prctl-seccomp-strict.test.
Dmitry V. Levin [Mon, 11 Apr 2016 15:04:08 +0000 (15:04 +0000)]
tests: bring lists back to the sorted order
Dmitry V. Levin [Sun, 10 Apr 2016 23:05:18 +0000 (23:05 +0000)]
tests/epoll_create1.c: extend for the case of ENOSYS
* epoll_create1.c: Make the test work in case of epoll_create1
returning ENOSYS.
Dmitry V. Levin [Sun, 10 Apr 2016 22:38:00 +0000 (22:38 +0000)]
tests/epoll_ctl.c: extend epoll_ctl coverage
* tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding. Check
decoding of long int descriptors and NULL struct epoll_event pointer.
Dmitry V. Levin [Sat, 9 Apr 2016 23:34:18 +0000 (23:34 +0000)]
tests: add mlockall.test
* tests/mlockall.c: New file.
* tests/mlockall.test: New test.
* tests/.gitignore: Add mlockall.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mlockall.test.
Fei Jie [Fri, 8 Apr 2016 07:59:16 +0000 (15:59 +0800)]
tests: add epoll_wait.test
* tests/epoll_wait.c: New file.
* tests/epoll_wait.test: New test.
* tests/.gitignore: Add epoll_wait.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_wait.test.
Fei Jie [Fri, 8 Apr 2016 07:59:15 +0000 (15:59 +0800)]
tests: add epoll_ctl.test
* tests/epoll_ctl.c: New file.
* tests/epoll_ctl.test: New test.
* tests/.gitignore: Add epoll_ctl.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_ctl.test.
Fei Jie [Fri, 8 Apr 2016 07:59:14 +0000 (15:59 +0800)]
tests: add epoll_create.test
* tests/epoll_create.c: New file.
* tests/epoll_create.test: New test.
* tests/.gitignore: Add epoll_create.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_create.test.
Dmitry V. Levin [Fri, 8 Apr 2016 02:16:28 +0000 (02:16 +0000)]
tests/pread64-pwrite64.c: minor cleanup
* tests/pread64-pwrite64.c: Do not include <sys/uio.h>.
Dmitry V. Levin [Thu, 7 Apr 2016 01:15:58 +0000 (01:15 +0000)]
Fix decoding of swapon flags
* swapon.c (SYS_FUNC(swapon)): Print priority regardless
of SWAP_FLAG_PREFER flag being set.
* tests/swap.c (error_msg): Handle EINVAL.
(main): Check decoding of swapon flags.
Dmitry V. Levin [Thu, 7 Apr 2016 00:39:18 +0000 (00:39 +0000)]
tests/unlinkat.c: check AT_* decoding
* tests/unlinkat.c (main): Check decoding of AT_* constants.
Dmitry V. Levin [Thu, 7 Apr 2016 00:31:44 +0000 (00:31 +0000)]
tests/linkat.c: check AT_* decoding
* tests/linkat.c (main): Check decoding of AT_* constants.
Elliott Hughes [Wed, 6 Apr 2016 21:41:36 +0000 (14:41 -0700)]
Improve decoding of Android's PR_SET_VMA prctl
Before:
prctl(0x53564d41 /* PR_??? */, 0, 0x7f8ab53000, 4096,
"atexit handlers") = 0
After:
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7fa8cbd000, 4096,
"atexit handlers") = 0
* prctl.c (SYS_FUNC(prctl)) [__ANDROID__]: Do not define PR_SET_VMA.
* Hard-code PR_SET_VMA_ANON_NAME, the only current sub-option.
* xlat/prctl_options.in: Add PR_SET_VMA.
Fei Jie [Wed, 6 Apr 2016 06:18:51 +0000 (14:18 +0800)]
tests: add mkdirat.test
* tests/mkdirat.c: New file.
* tests/mkdirat.test: New test.
* tests/.gitignore: Add mkdirat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mkdirat.test.
Fei Jie [Wed, 6 Apr 2016 06:18:50 +0000 (14:18 +0800)]
tests: add swap.test
* tests/swap.c: New file.
* tests/swap.test: New test.
* tests/.gitignore: Add swap.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add swap.test.
Fei Jie [Wed, 6 Apr 2016 06:18:49 +0000 (14:18 +0800)]
tests: add unlinkat.test
* tests/unlinkat.c: New file.
* tests/unlinkat.test: New test.
* tests/.gitignore: Add unlinkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add unlinkat.test.
Fei Jie [Wed, 6 Apr 2016 06:18:48 +0000 (14:18 +0800)]
tests: add linkat.test
* tests/linkat.c: New file.
* tests/linkat.test: New test.
* tests/.gitignore: Add linkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add linkat.test.
Dmitry V. Levin [Wed, 6 Apr 2016 00:02:08 +0000 (00:02 +0000)]
tests: add sync_file_range.test and sync_file_range2.test
* configure.ac (AC_CHECK_FUNCS): Add sync_file_range.
* tests/sync_file_range.c: New file.
* tests/sync_file_range2.c: Likewise.
* tests/sync_file_range.test: New test.
* tests/sync_file_range2.test: Likewise.
* tests/.gitignore: Add sync_file_range and sync_file_range2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test.
Dmitry V. Levin [Tue, 5 Apr 2016 23:30:05 +0000 (23:30 +0000)]
Add default values for SYNC_FILE_RANGE_* constants
* xlat/sync_file_range_flags.in: Add default values.
Elliott Hughes [Tue, 5 Apr 2016 19:10:16 +0000 (12:10 -0700)]
Fix sync_file_range2 output
Before:
sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, )
After:
sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0)
* sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", "
in the right place.
Dmitry V. Levin [Mon, 4 Apr 2016 01:35:28 +0000 (01:35 +0000)]
Replace PF_* constants with AF_*
AF_* constants appear to be more standardized, and in practice there's
always a one to one relationship between AF_* and PF_*, so let's
use AF_* instead of PF_*.
* xlat/domains.in: Remove.
* net.c: Do not define PF_UNSPEC. Stop including "xlat/domains.h".
Replace PF_* with AF_*. Replace domains with addrfams.
* tests/inet-cmsg.c: Replace PF_INET with AF_INET.
* tests/net-yy-inet.c: Likewise.
* tests/netlink_inet_diag.c: Likewise.
* tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL.
* tests/net-y-unix.c: Likewise.
* tests/net-yy-unix.c: Likewise.
* tests/netlink_unix_diag.c: Likewise.
* tests/net.expected: Replace PF_ with AF_.
Dmitry V. Levin [Sun, 3 Apr 2016 16:37:43 +0000 (16:37 +0000)]
tests: add read-write.test
* tests/read-write.c: New file.
* tests/read-write.test: New test.
* tests/.gitignore: Add read-write.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add read-write.test.
Dmitry V. Levin [Sat, 2 Apr 2016 18:27:44 +0000 (18:27 +0000)]
tests/pread64-pwrite64.test: extend dumpio coverage
* tests/pread64-pwrite64.c (dump_str, print_hex, test_dump):
New functions.
(main): Use them to test dumping of various data.
* tests/pread64-pwrite64.test: Update.
Dmitry V. Levin [Sat, 2 Apr 2016 18:24:36 +0000 (18:24 +0000)]
tests: add hexdump_memdup function to libtests
* tests/hexdump_strdup.c (hexdump_memdup): New function.
(hexdump_strdup): Use it.
* tests/tests.h (hexdump_memdup): New prototype.
Dmitry V. Levin [Sat, 2 Apr 2016 14:07:02 +0000 (14:07 +0000)]
tests: add fchownat.test
* tests/fchownat.c: New file.
* tests/fchownat.test: New test.
* tests/.gitignore: Add fchownat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchownat.test.
Dmitry V. Levin [Sat, 2 Apr 2016 13:13:16 +0000 (13:13 +0000)]
tests: add fchmodat.test
* tests/fchmodat.c: New file.
* tests/fchmodat.test: New test.
* tests/.gitignore: Add fchmodat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchmodat.test.
Dmitry V. Levin [Sat, 2 Apr 2016 01:08:24 +0000 (01:08 +0000)]
Fix printing of negative offsets in pread64 and pwrite64 syscalls
* io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset
using %lld format string.
* tests/pread64-pwrite64.c: New file.
* tests/pread64-pwrite64.test: New test.
* tests/.gitignore: Add pread64-pwrite64.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(pread64_pwrite64_CPPFLAGS): New variable.
(DECODER_TESTS): Add pread64-pwrite64.
Dmitry V. Levin [Sat, 2 Apr 2016 01:05:25 +0000 (01:05 +0000)]
tests/hexdump_strdup.c: add support for longer strings
* tests/hexdump_strdup.c (hexdump_strdup): Output extra space character
before hexdumping of the 9th symbol.
Dmitry V. Levin [Sat, 2 Apr 2016 01:04:57 +0000 (01:04 +0000)]
tests/preadv-pwritev.c: fix typo in error diagnostics
* tests/preadv-pwritev.c (main): Fix typo in error message.
Fei Jie [Thu, 31 Mar 2016 08:06:52 +0000 (16:06 +0800)]
tests: add chroot.test
* tests/chroot.c: New file.
* tests/chroot.test: New test.
* tests/.gitignore: Add chroot.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add chroot.test.
Fei Jie [Thu, 31 Mar 2016 08:06:51 +0000 (16:06 +0800)]
tests: add fdatasync.test
* tests/fdatasync.c: New file.
* tests/fdatasync.test: New test.
* tests/.gitignore: Add fdatasync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fdatasync.test.
Fei Jie [Thu, 31 Mar 2016 08:06:50 +0000 (16:06 +0800)]
tests: add fsync.test
* tests/fsync.c: New file.
* tests/fsync.test: New test.
* tests/.gitignore: Add fsync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fsync.test.
Fei Jie [Thu, 31 Mar 2016 08:06:49 +0000 (16:06 +0800)]
tests: add sethostname.test
* tests/sethostname.c: New file.
* tests/sethostname.test: New test.
* tests/.gitignore: Add sethostname.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sethostname.test.
Dmitry V. Levin [Fri, 1 Apr 2016 15:31:23 +0000 (15:31 +0000)]
Consistently handle unsigned arguments of mmap* and remap_file_pages
Explicitly declare first 4 arguments of mmap* and all remap_file_pages
arguments as unsigned to avoid potential sign extension issues.
* mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall
arguments to local variables of appropriate types.
Dmitry V. Levin [Fri, 1 Apr 2016 01:03:20 +0000 (01:03 +0000)]
Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned
The second (level) and third (optname) arguments of getsockopt and
setsockopt syscalls are enums, so treat them consistently as enums:
use "unsigned int" type to avoid potential sign extension issues.
* net.c (print_sockopt_fd_level_name, print_getsockopt,
print_setsockopt): Change type of "level" and "name" arguments
from "int" to "unsigned int".
Dmitry V. Levin [Fri, 1 Apr 2016 00:52:01 +0000 (00:52 +0000)]
Add sentinel attribute to printxvals
* gcc_compat.h (ATTRIBUTE_SENTINEL): New macro.
* defs.h (printxvals): Add ATTRIBUTE_SENTINEL.
Dmitry V. Levin [Fri, 1 Apr 2016 00:28:33 +0000 (00:28 +0000)]
Cleanup parser of ptrace syscall
* process.c (print_user_offset_addr): New function for printing offset
address in the tracee's USER area.
(SYS_FUNC(ptrace)): Assign syscall arguments to local variables with
appropriate types. Print pid argument as int. Use switch statement
in the code that handles address argument. Use print_user_offset_addr
to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests.
Jeff Mahoney [Thu, 31 Mar 2016 04:34:17 +0000 (00:34 -0400)]
Define PRI__[uxs]64 macros to print __s64 and __u64 values
Rather than cast every __u64 or __s64 before printing,
define printing helpers for those types directly.
* defs.h (PRI__s64, PRI__u64, PRI__x64): New macros.
Dmitry V. Levin [Thu, 31 Mar 2016 00:01:58 +0000 (00:01 +0000)]
Implement dumping of preadv and pwritev syscalls
* syscall.c (dumpio): Add SEN_preadv and SEN_pwritev.
* NEWS: Mention this.
* tests/preadv-pwritev.c: New file.
* tests/preadv-pwritev.test: New test.
* tests/.gitignore: Add preadv-pwritev.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(preadv_pwritev_CPPFLAGS): New variable.
(DECODER_TESTS): Add preadv-pwritev.
Dmitry V. Levin [Wed, 30 Mar 2016 18:04:00 +0000 (18:04 +0000)]
Fix decoding of preadv syscall in case of short read
* io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead
of tprint_iov and specify syscall return value as a data size limit.
* NEWS: Mention it.
* tests/preadv.c (main): Add a test case for preadv short read.
Dmitry V. Levin [Wed, 30 Mar 2016 03:54:21 +0000 (03:54 +0000)]
Fix printing of negative offsets in preadv and pwritev syscalls
* io.c (print_llu_from_low_high_val): Rename to
print_lld_from_low_high_val, all callers changed.
Print value as a signed integer.
* tests/preadv.c: New file.
* tests/preadv.test: New test.
* tests/pwritev.c: New file.
* tests/pwritev.test: New test.
* tests/.gitignore: Add preadv and pwritev.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables.
(DECODER_TESTS): Add preadv.test and pwritev.test.
Dmitry V. Levin [Wed, 30 Mar 2016 02:22:58 +0000 (02:22 +0000)]
Fix printing of unreadable struct iovec
* io.c (tprint_iov_upto): If the first element of iovec array is
unreadable, print its address without array markup.
* tests/readv.c (main): Check it.
Dmitry V. Levin [Wed, 30 Mar 2016 00:16:24 +0000 (00:16 +0000)]
tests: factor out a part common to many simply organized test scripts
* tests/init.sh (run_strace_match_diff): New function.
* tests/acct.test: Rewrite using run_strace_match_diff.
* tests/aio.test: Likewise.
* tests/alarm.test: Likewise.
* tests/chmod.test: Likewise.
* tests/clock_nanosleep.test: Likewise.
* tests/clock_xettime.test: Likewise.
* tests/copy_file_range.test: Likewise.
* tests/creat.test: Likewise.
* tests/dup.test: Likewise.
* tests/dup2.test: Likewise.
* tests/dup3.test: Likewise.
* tests/epoll_create1.test: Likewise.
* tests/execveat-v.test: Likewise.
* tests/execveat.test: Likewise.
* tests/fchmod.test: Likewise.
* tests/fcntl.test: Likewise.
* tests/file_handle.test: Likewise.
* tests/flock.test: Likewise.
* tests/fork-f.test: Likewise.
* tests/ftruncate.test: Likewise.
* tests/ftruncate64.test: Likewise.
* tests/getcwd.test: Likewise.
* tests/getdents.test: Likewise.
* tests/getdents64.test: Likewise.
* tests/getrandom.test: Likewise.
* tests/getrusage.test: Likewise.
* tests/getxxid.test: Likewise.
* tests/inet-cmsg.test: Likewise.
* tests/init.sh: Likewise.
* tests/membarrier.test: Likewise.
* tests/mincore.test: Likewise.
* tests/mknod.test: Likewise.
* tests/mlock2.test: Likewise.
* tests/mmsg.test: Likewise.
* tests/nanosleep.test: Likewise.
* tests/open.test: Likewise.
* tests/openat.test: Likewise.
* tests/pselect6.test: Likewise.
* tests/readdir.test: Likewise.
* tests/readlink.test: Likewise.
* tests/readv.test: Likewise.
* tests/recvmsg.test: Likewise.
* tests/rename.test: Likewise.
* tests/renameat.test: Likewise.
* tests/rt_sigpending.test: Likewise.
* tests/rt_sigprocmask.test: Likewise.
* tests/rt_sigqueueinfo.test: Likewise.
* tests/rt_sigsuspend.test: Likewise.
* tests/rt_sigtimedwait.test: Likewise.
* tests/rt_tgsigqueueinfo.test: Likewise.
* tests/sched_get_priority_mxx.test: Likewise.
* tests/sched_xetaffinity.test: Likewise.
* tests/sched_xetparam.test: Likewise.
* tests/sched_xetscheduler.test: Likewise.
* tests/seccomp.test: Likewise.
* tests/select.test: Likewise.
* tests/sendfile.test: Likewise.
* tests/sendfile64.test: Likewise.
* tests/splice.test: Likewise.
* tests/statx.sh: Likewise.
* tests/sysinfo.test: Likewise.
* tests/syslog.test: Likewise.
* tests/tee.test: Likewise.
* tests/time.test: Likewise.
* tests/timer_create.test: Likewise.
* tests/timer_xettime.test: Likewise.
* tests/timerfd_xettime.test: Likewise.
* tests/times-fail.test: Likewise.
* tests/times.test: Likewise.
* tests/truncate.test: Likewise.
* tests/truncate64.test: Likewise.
* tests/umask.test: Likewise.
* tests/umount.test: Likewise.
* tests/umount2.test: Likewise.
* tests/userfaultfd.test: Likewise.
* tests/vmsplice.test: Likewise.
* tests/xet_robust_list.test: Likewise.
* tests/xetitimer.test: Likewise.
* tests/xetpgid.test: Likewise.
* tests/xetpriority.test: Likewise.
* tests/xettimeofday.test: Likewise.
Dmitry V. Levin [Wed, 30 Mar 2016 00:13:56 +0000 (00:13 +0000)]
tests: introduce $NAME
* tests/init.sh (NAME): New variable, defined to ${ME_%.test}.
(run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test}
with $NAME.
* tests/fcntl.test: Likewise.
* tests/fstat.test: Likewise.
* tests/mmap.test: Likewise.
* tests/net-y-unix.test: Likewise.
* tests/net-yy-inet.test: Likewise.
* tests/net-yy-unix.test: Likewise.
* tests/open.test: Likewise.
* tests/openat.test: Likewise.
* tests/poll.test: Likewise.
* tests/ppoll.test: Likewise.
* tests/readlink.test: Likewise.
* tests/select.test: Likewise.
* tests/statx.sh: Likewise.
* tests/uname.test: Likewise.
Dmitry V. Levin [Wed, 30 Mar 2016 00:13:37 +0000 (00:13 +0000)]
tests: move definitions of $OUT and $ERR to init.sh
As virtually every test defines either one or both of OUT and ERR
variables and these definitions are exactly the same, move definitions
of these variables from individual tests to init.sh.
* tests/init.sh (OUT, ERR): New variables.
* tests/ipc.sh: Remove initialization of OUT variable.
* tests/statx.sh: Likewise.
* tests/*.test: Remove initialization of OUT and ERR variables.
Dmitry V. Levin [Tue, 29 Mar 2016 17:01:02 +0000 (17:01 +0000)]
tests: simplify sendfile.test and sendfile64.test
Use the executable itself for input by default.
* tests/sendfile.c (main): Use av[0] instead of av[1] for input.
* tests/sendfile64.c (main): Likewise.
* tests/sendfile.test: Invoke run_prog without arguments.
* tests/sendfile64.test: Likewise.
Dmitry V. Levin [Tue, 29 Mar 2016 03:33:00 +0000 (03:33 +0000)]
open.test, openat.test: lift /proc requirement
While -P option needs /proc to match descriptors, it does not use
/proc to match pathnames. As these tests do not need descriptor
match, the /proc requirement can be safely lifted.
* tests/open.test: Lift /proc/self/fd/ requirement.
* tests/openat.test: Likewise.
Dmitry V. Levin [Tue, 29 Mar 2016 01:15:24 +0000 (01:15 +0000)]
quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA
* quota.c (if_nextdqblk): New structure.
(decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.
Dmitry V. Levin [Tue, 29 Mar 2016 00:35:20 +0000 (00:35 +0000)]
Update Q_* constants
* xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced
by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6.
Dmitry V. Levin [Tue, 29 Mar 2016 00:44:50 +0000 (00:44 +0000)]
Update CLONE_* constants
* xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP.
The former was removed by linux kernel commit v2.6.38-rc1~217.
The latter was introduced by linux kernel commit v4.6-rc1~67^2~8.
Dmitry V. Levin [Tue, 29 Mar 2016 00:28:11 +0000 (00:28 +0000)]
Update BPF_MAP_TYPE_* constants
* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH,
BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by
linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and
v4.6-rc1~91^2~212^2~1, respectively.