]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
selftests/seccomp: Enhance per-arch ptrace syscall skip tests
authorKees Cook <keescook@chromium.org>
Thu, 16 May 2019 10:20:00 +0000 (12:20 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 24 Jun 2019 14:21:33 +0000 (16:21 +0200)
commit5e1bf4504708f601c57cf72350893bd24b1771b2
tree833f57042092d4c8680f7b7553d3be3aa2f8d798
parent41c5aa46bfc9107ce1ec959985cc51e161299814
selftests/seccomp: Enhance per-arch ptrace syscall skip tests

BugLink: https://bugs.launchpad.net/bugs/1812796
Passing EPERM during syscall skipping was confusing since the test wasn't
actually exercising the errno evaluation -- it was just passing a literal
"1" (EPERM). Instead, expand the tests to check both direct value returns
(positive, 45000 in this case), and errno values (negative, -ESRCH in this
case) to check both fake success and fake failure during syscall skipping.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: a33b2d0359a0 ("selftests/seccomp: Add tests for basic ptrace actions")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuah@kernel.org>
(cherry picked from commit ed5f13261cb65b02c611ae9971677f33581d4286)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
tools/testing/selftests/seccomp/seccomp_bpf.c