tests: run-time detect constructor order

It seems not all toolchains actually run constructors in reverse. To
make sure we get tests run in source order, detect which direction
constructors are executed in, and adjust the list building logic.

Signed-off-by: Kees Cook <keescook@chromium.org>
tests: add ARM seccomp syscall number

Add expected syscall number for seccomp on ARM.

Signed-off-by: Kees Cook <keescook@chromium.org>
tests: make sure TSYNC can be used on first filter

There was an unneeded sanity check in the TSYNC logic that was causing
the first installed filter to not allow TSYNC to be used.

Reported-by: David Drysdale <drysdale@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
tests: Add test of PR_GET_SECCOMP

Check that the seccomp mode is 0 before doing anything
and is 2 after setting filter mode.

Can't check on a seccomp mode of 1 because strict mode
doesn't allow the prctl(2) call.

Signed-off-by: David Drysdale <drysdale@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
tests: validate pre-existing threads get nnp and filter

Makes sure that nnp gets set on threads getting TSYNCed.

Signed-off-by: David Drysdale <drysdale@google.com>
[added test for framework detecting lack of nnp]
Signed-off-by: Kees Cook <keescook@chromium.org>
tests: add run_tests target and .gitignore

In preparation for putting into upstream kernel tree, add targets.

Signed-off-by: David Drysdale <drysdale@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
tests: add aarch64 support

This switches to using GET/SETREGSET which should work on all archs, and
adds support for aarch64.

Based on patch by AKASHI Takahiro <takahiro.akashi@linaro.org>.

Signed-off-by: Kees Cook <keescook@chromium.org>
Merge pull request #10 from kees/trace

test order and ARM seccomp syscall