]> granicus.if.org Git - strace/log
strace
8 years agotests/mkdirat.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 21:03:13 +0000 (21:03 +0000)]
tests/mkdirat.c: print syscall() result using %ld format

8 years agotests/lseek.c: cleanup
Dmitry V. Levin [Thu, 21 Apr 2016 21:01:40 +0000 (21:01 +0000)]
tests/lseek.c: cleanup

* tests/lseek.c (main): Use errno2name, stop using assert.

8 years agotests/llseek.c: cleanup
Dmitry V. Levin [Thu, 21 Apr 2016 21:00:47 +0000 (21:00 +0000)]
tests/llseek.c: cleanup

* tests/llseek.c (main): Use errno2name, stop using assert.

8 years agotests/linkat.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 21:00:18 +0000 (21:00 +0000)]
tests/linkat.c: print syscall() result using %ld format

8 years agotests/iopl.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:59:46 +0000 (20:59 +0000)]
tests/iopl.c: use errno2name

8 years agotests/ioperm.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:59:26 +0000 (20:59 +0000)]
tests/ioperm.c: use errno2name

8 years agotests/getgroups.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:51:15 +0000 (20:51 +0000)]
tests/getgroups.c: use errno2name

* tests/getgroups.c (errno2str): Remove.
(main): Use errno2name.

8 years agotests/ftruncate64.c: cleanup
Dmitry V. Levin [Thu, 21 Apr 2016 20:50:08 +0000 (20:50 +0000)]
tests/ftruncate64.c: cleanup

* tests/ftruncate64.c (main): Use errno2name, stop using assert.

8 years agotests/ftruncate.c: cleanup
Dmitry V. Levin [Thu, 21 Apr 2016 20:48:23 +0000 (20:48 +0000)]
tests/ftruncate.c: cleanup

* tests/ftruncate.c (main): Use errno2name, stop using assert.

8 years agotests/fsync.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:46:44 +0000 (20:46 +0000)]
tests/fsync.c: print syscall() result using %ld format

8 years agotests/flock.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:46:15 +0000 (20:46 +0000)]
tests/flock.c: print syscall() result using %ld format

8 years agotests/file_handle.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:45:17 +0000 (20:45 +0000)]
tests/file_handle.c: use errno2name

8 years agotests/fdatasync.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:41:38 +0000 (20:41 +0000)]
tests/fdatasync.c: print syscall() result using %ld format

8 years agotests/fchownat.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:40:49 +0000 (20:40 +0000)]
tests/fchownat.c: use errno2name

8 years agotests/fchmodat.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:39:58 +0000 (20:39 +0000)]
tests/fchmodat.c: use errno2name

8 years agotests/fchmod.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:39:40 +0000 (20:39 +0000)]
tests/fchmod.c: use errno2name

8 years agotests/faccessat.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:38:47 +0000 (20:38 +0000)]
tests/faccessat.c: print syscall() result using %ld format

8 years agotests/epoll_wait.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:38:15 +0000 (20:38 +0000)]
tests/epoll_wait.c: print syscall() result using %ld format

8 years agotests/epoll_ctl.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:37:50 +0000 (20:37 +0000)]
tests/epoll_ctl.c: print syscall() result using %ld format

8 years agotests/epoll_create1.c: cleanup
Dmitry V. Levin [Thu, 21 Apr 2016 20:36:45 +0000 (20:36 +0000)]
tests/epoll_create1.c: cleanup

* tests/epoll_create1.c (main): Use errno2name, stop using assert.

8 years agotests/epoll_create.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:35:20 +0000 (20:35 +0000)]
tests/epoll_create.c: print syscall() result using %ld format

8 years agotests/dup3.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:34:56 +0000 (20:34 +0000)]
tests/dup3.c: print syscall() result using %ld format

8 years agotests/dup2.c: print syscall() result using %ld format
Dmitry V. Levin [Thu, 21 Apr 2016 20:34:36 +0000 (20:34 +0000)]
tests/dup2.c: print syscall() result using %ld format

8 years agotests/dup.c: cleanup
Dmitry V. Levin [Thu, 21 Apr 2016 20:33:32 +0000 (20:33 +0000)]
tests/dup.c: cleanup

8 years agotests/creat.c: stop using sys/stat.h
Dmitry V. Levin [Thu, 21 Apr 2016 20:32:43 +0000 (20:32 +0000)]
tests/creat.c: stop using sys/stat.h

8 years agotests/copy_file_range.c: stop using assert
Dmitry V. Levin [Thu, 21 Apr 2016 20:31:32 +0000 (20:31 +0000)]
tests/copy_file_range.c: stop using assert

8 years agotests/chroot.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:30:25 +0000 (20:30 +0000)]
tests/chroot.c: use errno2name

8 years agotests/aio.c: use errno2name
Dmitry V. Levin [Thu, 21 Apr 2016 20:29:29 +0000 (20:29 +0000)]
tests/aio.c: use errno2name

8 years agotests: cleanup acct.test
Dmitry V. Levin [Thu, 21 Apr 2016 20:16:32 +0000 (20:16 +0000)]
tests: cleanup acct.test

* tests/acct.c (main): Use errno2name, stop using assert,
change sample file name.
* tests/acct.test: Update.

8 years agotests: use errno2name()
Dmitry V. Levin [Thu, 21 Apr 2016 17:49:32 +0000 (17:49 +0000)]
tests: use errno2name()

Automatically change tests/*.c files using the following sed regexp:
sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g'

8 years agotests/dup.c: include "tests.h"
Dmitry V. Levin [Thu, 21 Apr 2016 18:16:10 +0000 (18:16 +0000)]
tests/dup.c: include "tests.h"

This is going to be necessary for the following commit.

8 years agotests: add getpgrp.test
Fei Jie [Thu, 21 Apr 2016 07:53:52 +0000 (15:53 +0800)]
tests: add getpgrp.test

* tests/getpgrp.c: New file.
* tests/getpgrp.test: New test.
* tests/.gitignore: Add getpgrp.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getpgrp.test.

8 years agotests: add access.test
Fei Jie [Thu, 21 Apr 2016 07:53:51 +0000 (15:53 +0800)]
tests: add access.test

* tests/access.c: New file.
* tests/access.test: New test.
* tests/.gitignore: Add access.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add access.test.

8 years agotests: add fchdir.test
Fei Jie [Thu, 21 Apr 2016 07:53:50 +0000 (15:53 +0800)]
tests: add fchdir.test

* tests/fchdir.c: New file.
* tests/fchdir.test: New test.
* tests/.gitignore: Add fchdir.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchdir.test.

8 years agotests: add mkdir.test
Fei Jie [Thu, 21 Apr 2016 07:53:49 +0000 (15:53 +0800)]
tests: add mkdir.test

* tests/mkdir.c: New file.
* tests/mkdir.test: New test.
* tests/.gitignore: Add mkdir.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mkdir.test.

8 years agotests: add getsid.test
Fei Jie [Thu, 21 Apr 2016 01:40:01 +0000 (09:40 +0800)]
tests: add getsid.test

* tests/getsid.c: New file.
* tests/getsid.test: New test.
* tests/.gitignore: Add getsid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getsid.test.

8 years agotests: add errno2name function to libtests
Dmitry V. Levin [Wed, 20 Apr 2016 22:51:28 +0000 (22:51 +0000)]
tests: add errno2name function to libtests

Add a simple translator of errno to its name, so one could
simply use errno2name() instead of complex expressions like
errno == EINVAL ? "EINVAL" : "EFAULT".

* tests.h (errno2name): New prototype.
* errno2name.c: New file.
* Makefile.am (libtests_a_SOURCES): Add it.

8 years agohppa: rename ECANCELLED to ECANCELED
Dmitry V. Levin [Wed, 20 Apr 2016 18:04:34 +0000 (18:04 +0000)]
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.

8 years agoRemove parser of unimplemented timerfd syscall
Dmitry V. Levin [Wed, 20 Apr 2016 17:15:05 +0000 (17:15 +0000)]
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.

8 years agotests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test
Dmitry V. Levin [Wed, 20 Apr 2016 14:30:43 +0000 (14:30 +0000)]
tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test

If kernel implementation of strict seccomp mode is buggy, test programs
will be killed by SIGKILL.  This is a known problem at least on
x32 and mips.  Skip affected tests if this is the case.

This change partially revert commit 9c1a72cd3f3d52d573876ce474b620a5f141fb1b.

* tests/seccomp-strict.c (main): Remove workaround for x32.
* tests/prctl-seccomp-strict.c: Likewise.
* tests/seccomp-strict.test: Skip the test if the test program
has been killed by SIGKILL.
* tests/prctl-seccomp-strict.test: Likewise.

8 years agotests/shmxt.c: do not use SHM_RND, it is unreliable
Dmitry V. Levin [Wed, 20 Apr 2016 05:40:58 +0000 (05:40 +0000)]
tests/shmxt.c: do not use SHM_RND, it is unreliable

* tests/shmxt.c (main): Do not set SHM_RND flag.

8 years agotests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long)
Dmitry V. Levin [Wed, 20 Apr 2016 04:32:04 +0000 (04:32 +0000)]
tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long)

* tests/rt_sigsuspend.c (iterate): Do not assume that size will be less
than sizeof(long) on the second iteration.

8 years agoprctl-seccomp-strict.test: robustify against unrelated prctl invocations
Dmitry V. Levin [Wed, 20 Apr 2016 00:26:46 +0000 (00:26 +0000)]
prctl-seccomp-strict.test: robustify against unrelated prctl invocations

* tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls.

8 years agotests: adjust rt_sigpending to older kernels
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.

8 years agotests: adjust readv/writev and preadv/pwritev tests to older kernels
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.

8 years agotests: remove obsolete non-strict uid tests
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.

8 years agotests: extend test coverage of getuid/getgid family syscalls
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.

8 years agotests: extend test coverage of getresgid32 syscall
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.

8 years agotests: extend test coverage of getresgid syscall
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.

8 years agotests: extend test coverage of getresuid32 syscall
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.

8 years agotests: extend test coverage of getresuid syscall
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.

8 years agotests: add symlinkat.test
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.

8 years agotests: add iopl.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.

8 years agomips o32, powerpc, powerpc64: fix decoding of iopl syscall
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.

8 years agotests: add ioperm.test
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.

8 years agoFix corner cases of getgroups and setgroups syscall decoders
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.

8 years agoCleanup setfsuid syscall decoder
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.

8 years agotests: check decoding of setfsgid32 syscall
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.

8 years agotests: check decoding of setfsgid syscall
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.

8 years agotests: check decoding of setfsuid32 syscall
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.

8 years agotests: check decoding of setfsuid syscall
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.

8 years agotests: extend test coverage of setresgid32 syscall
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.

8 years agotests: extend test coverage of setresgid syscall
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.

8 years agotests: extend test coverage of setresuid32 syscall
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.

8 years agotests: extend test coverage of setresuid syscall
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.

8 years agotests: extend test coverage of setregid32 syscall
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.

8 years agotests: extend test coverage of setregid syscall
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.

8 years agotests: extend test coverage of setreuid32 syscall
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.

8 years agotests: extend test coverage of setreuid syscall
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.

8 years agotests: extend test coverage of setgid32 syscall
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.

8 years agotests: extend test coverage of setgid syscall
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.

8 years agotests: extend test coverage of setuid32 syscall
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.

8 years agotests: extend test coverage of setuid syscall
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.

8 years agotests: add shmxt.test
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.

8 years agoalpha: fix decoding of shmat syscall
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.

8 years agotests: add semop.test
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.

8 years agoprctl-seccomp-filter-v.test: robustify against unrelated prctl invocations
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>
8 years agotests/pselect6.c: fix potential output mismatch
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>
8 years agotests: check decoding of fchown32 syscall
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.

8 years agotests: check decoding of fchown syscall
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.

8 years agotests: check decoding of lchown32 syscall
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.

8 years agotests: check decoding of lchown syscall
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.

8 years agotests: check decoding of chown32 syscall
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.

8 years agotests: check decoding of chown syscall
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.

8 years agoFix decoding of 16-bit uid_t/git_t
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.

8 years agotests: move kernel uid overflow check to libtests
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.

8 years agotests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32
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.

8 years agotests: add seccomp-filter.test
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.

8 years agoseccomp: fix decoding of sock_fprog and sock_filter structures
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.

8 years agoseccomp: print SECCOMP_* and BPF_* constants in a more compact way
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.

8 years agotests: rename seccomp.test to prctl-seccomp-filter-v.test
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.

8 years agotests: add seccomp-strict.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.

8 years agotests: add prctl-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.

8 years agotests: bring lists back to the sorted order
Dmitry V. Levin [Mon, 11 Apr 2016 15:04:08 +0000 (15:04 +0000)]
tests: bring lists back to the sorted order

8 years agotests/epoll_create1.c: extend for the case of ENOSYS
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.

8 years agotests/epoll_ctl.c: extend epoll_ctl coverage
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.

8 years agotests: add mlockall.test
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.

8 years agotests: add epoll_wait.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.

8 years agotests: add epoll_ctl.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.

8 years agotests: add epoll_create.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.