]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/seccomp: Handle namespace failures gracefully
authorKees Cook <keescook@chromium.org>
Thu, 11 Apr 2019 23:56:31 +0000 (16:56 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 16 Apr 2019 23:04:08 +0000 (17:04 -0600)
commit00462ccf6d6c1d03a7a58e94ad78686b6cb010a4
tree6f1a971fc65ad50b3759c272dce909e834b3aeb4
parentc261443379159e6ffd0b03fa030da148ed3aa1d9
selftests/seccomp: Handle namespace failures gracefully

When running without USERNS or PIDNS the seccomp test would hang since
it was waiting forever for the child to trigger the user notification
since it seems the glibc() abort handler makes a call to getpid(),
which would trap again. This changes the getpid filter to getppid, and
makes sure ASSERTs execute to stop from spawning the listener.

Reported-by: Shuah Khan <shuah@kernel.org>
Fixes: 388c4c8f99d2 ("seccomp: add a return code to trap to userspace")
Cc: stable@vger.kernel.org # > 5.0
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/seccomp/seccomp_bpf.c