bea707377d
tests/shmxt.c: do not use SHM_RND, it is unreliable
...
* tests/shmxt.c (main): Do not set SHM_RND flag.
2016-04-20 05:40:58 +00:00
c8cc0f2a87
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.
2016-04-20 04:35:25 +00:00
d424c765f7
prctl-seccomp-strict.test: robustify against unrelated prctl invocations
...
* tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls.
2016-04-20 01:08:13 +00:00
fdb2a1867e
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.
2016-04-20 01:08:13 +00:00
f73a3a44dd
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.
2016-04-20 01:08:13 +00:00
87c0b56a77
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.
2016-04-20 01:08:13 +00:00
f096422882
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.
2016-04-20 01:08:13 +00:00
7f3da2ff4c
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.
2016-04-20 01:08:13 +00:00
91119e5306
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.
2016-04-20 01:08:13 +00:00
dcc6660256
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.
2016-04-20 01:08:13 +00:00
fbe1a9ec6e
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.
2016-04-20 01:08:13 +00:00
Fei Jie
bff70d4311
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.
2016-04-20 01:08:13 +00:00
Fei Jie
1eb0051663
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.
2016-04-20 01:08:13 +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
Fei Jie
2e069fcc0d
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.
2016-04-20 01:08:13 +00:00
5e9944df2c
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.
2016-04-20 01:08:13 +00:00
ba210af060
Cleanup setfsuid syscall decoder
...
* uid.c (SYS_FUNC(setfsuid)): Remove redundant check.
2016-04-20 01:08:13 +00:00
f184989593
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.
2016-04-20 01:08:13 +00:00
fba762db71
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.
2016-04-20 01:08:13 +00:00
2def3d4a04
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.
2016-04-20 01:08:13 +00:00
281e4578dd
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.
2016-04-20 01:08:13 +00:00
fa7c988bd9
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.
2016-04-20 01:08:13 +00:00
4f6d95dd58
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.
2016-04-20 01:08:12 +00:00
2b42d8e32f
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.
2016-04-20 01:08:12 +00:00
0eac88a00a
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.
2016-04-20 01:08:12 +00:00
7d7dfbede8
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.
2016-04-20 01:08:12 +00:00
28d02ea6f3
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.
2016-04-20 01:08:12 +00:00
619a96a295
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.
2016-04-20 01:08:12 +00:00
e6d8473850
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.
2016-04-20 01:08:12 +00:00
6511b2df01
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.
2016-04-20 01:08:12 +00:00
cf273016fe
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.
2016-04-20 01:08:12 +00:00
8f0e41afb7
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.
2016-04-20 01:08:12 +00:00
aa399261ac
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.
2016-04-20 01:08:12 +00:00
Fei Jie
39a33b171b
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.
2016-04-20 01:08:12 +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
Fei Jie
f22db4e753
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.
2016-04-20 00:11:27 +00:00
7d23d33933
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>
2016-04-18 01:10:44 +00:00
bcdd2041fa
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>
2016-04-18 01:10:44 +00:00
96492b2acd
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.
2016-04-18 01:10:44 +00:00
e6828b1102
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.
2016-04-18 01:10:44 +00:00
11f98f21b7
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.
2016-04-18 01:10:44 +00:00
408420f51f
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.
2016-04-18 01:10:43 +00:00
f559a876f8
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.
2016-04-18 01:10:43 +00:00
4ccdbd698e
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.
2016-04-18 01:10:43 +00:00
a99bcbf916
Fix decoding of 16-bit uid_t/git_t
...
* uid.c (printuid): Always cast value to uid_t.
2016-04-18 01:10:43 +00:00
c1f1cc1b4c
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.
2016-04-18 01:10:41 +00:00
9c1a72cd3f
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.
2016-04-12 04:39:25 +00:00
c2523e0d9c
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.
2016-04-12 00:20:03 +00:00
6ba947f36e
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.
2016-04-12 00:05:43 +00:00
3ea6a59802
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.
2016-04-11 20:25:01 +00:00