Commit Graph

3802 Commits

Author SHA1 Message Date
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
181806136e 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.
2016-04-11 15:16:30 +00:00
b19945bebc 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.
2016-04-11 15:09:09 +00:00
c1aa737325 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.
2016-04-11 15:06:28 +00:00
d9e4ff7fb3 tests: bring lists back to the sorted order 2016-04-11 15:04:08 +00:00
7a06960ff4 tests/epoll_create1.c: extend for the case of ENOSYS
* epoll_create1.c: Make the test work in case of epoll_create1
returning ENOSYS.
2016-04-10 23:05:18 +00:00
2399a6031c 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.
2016-04-10 22:38:00 +00:00
cb6f997114 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.
2016-04-09 23:34:18 +00:00
Fei Jie
c75e2c2e42 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.
2016-04-08 07:59:16 +00:00
Fei Jie
258a22519f 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.
2016-04-08 07:59:15 +00:00
Fei Jie
bbdd23c8ed 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.
2016-04-08 07:59:14 +00:00
17f4b45164 tests/pread64-pwrite64.c: minor cleanup
* tests/pread64-pwrite64.c: Do not include <sys/uio.h>.
2016-04-08 02:16:28 +00:00
fcb94cded0 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.
2016-04-07 01:15:58 +00:00
f2f91c0933 tests/unlinkat.c: check AT_* decoding
* tests/unlinkat.c (main): Check decoding of AT_* constants.
2016-04-07 00:39:18 +00:00
867c1cdf19 tests/linkat.c: check AT_* decoding
* tests/linkat.c (main): Check decoding of AT_* constants.
2016-04-07 00:31:44 +00:00
Elliott Hughes
612368b59e 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.
2016-04-06 21:41:36 +00:00
Fei Jie
c4a30f15ef 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.
2016-04-06 06:18:51 +00:00
Fei Jie
93faa4cc88 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.
2016-04-06 06:18:50 +00:00
Fei Jie
41cd657930 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.
2016-04-06 06:18:49 +00:00
Fei Jie
7a158a18f8 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.
2016-04-06 06:18:48 +00:00
5b2d257839 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.
2016-04-06 00:02:08 +00:00
27bff90e86 Add default values for SYNC_FILE_RANGE_* constants
* xlat/sync_file_range_flags.in: Add default values.
2016-04-05 23:30:05 +00:00
Elliott Hughes
6f072d5e87 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.
2016-04-05 19:10:16 +00:00
71fe62e6b7 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_.
2016-04-04 01:35:28 +00:00