selftests/seccomp: Remove the need for HAVE_ARCH_TRACEHOOK
authorMickaël Salaün <mic@digikod.net>
Tue, 29 Dec 2015 20:35:45 +0000 (21:35 +0100)
committerRichard Weinberger <richard@nod.at>
Sun, 10 Jan 2016 20:49:49 +0000 (21:49 +0100)
commit4a0b88070406323487bad730d8945f482151a145
treed4d35cb43c578bab371a1b12e109373b972b348c
parente04c989eb785af61d2895d76d38c09166296f9c5
selftests/seccomp: Remove the need for HAVE_ARCH_TRACEHOOK

Some architectures do not implement PTRACE_GETREGSET nor
PTRACE_SETREGSET (required by HAVE_ARCH_TRACEHOOK) but only implement
PTRACE_GETREGS and PTRACE_SETREGS (e.g. User-mode Linux).

This improve seccomp selftest portability for architectures without
HAVE_ARCH_TRACEHOOK support by defining a new trigger HAVE_GETREGS. For
now, this is only enabled for i386 and x86_64 architectures. This is
required to be able to run this tests on User-mode Linux.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Meredydd Luff <meredydd@senatehouse.org>
Cc: David Drysdale <drysdale@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Kees Cook <keescook@chromium.org>
tools/testing/selftests/seccomp/seccomp_bpf.c