seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 20 Sep 2019 08:30:07 +0000 (10:30 +0200)
committerKees Cook <keescook@chromium.org>
Thu, 10 Oct 2019 21:45:51 +0000 (14:45 -0700)
commit0eebfed2954f152259cae0ad57b91d3ea92968e8
tree28f64d70ba1ca207d30db32aaba10d181b5f4f31
parentfb3c5386b382d4097476ce9647260fc89b34afdb
seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE

Test whether a syscall can be performed after having been intercepted by
the seccomp notifier. The test uses dup() and kcmp() since it allows us to
nicely test whether the dup() syscall actually succeeded by comparing whether
the fds refer to the same underlying struct file.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: Tycho Andersen <tycho@tycho.ws>
CC: Tyler Hicks <tyhicks@canonical.com>
Cc: stable@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: bpf@vger.kernel.org
Link: https://lore.kernel.org/r/20190920083007.11475-4-christian.brauner@ubuntu.com
Signed-off-by: Kees Cook <keescook@chromium.org>
tools/testing/selftests/seccomp/seccomp_bpf.c