]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/seccomp: Enhance per-arch ptrace syscall skip tests
authorKees Cook <keescook@chromium.org>
Fri, 25 Jan 2019 18:33:59 +0000 (10:33 -0800)
committerShuah Khan <shuah@kernel.org>
Fri, 25 Jan 2019 22:13:35 +0000 (15:13 -0700)
commit45ed1c31cbfcc1f2eb8f5bcf9179a707212fa06d
tree5865aa0d86940f670ad69d6cb87e1351787522a2
parent899fcf5f74e3cd526d36a4a99873a3f5a18c8a12
selftests/seccomp: Enhance per-arch ptrace syscall skip tests

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: d1e772ec4a5f ("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>
tools/testing/selftests/seccomp/seccomp_bpf.c