]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID)
authorTerry Tritton <terry.tritton@linaro.org>
Wed, 24 Jan 2024 14:13:55 +0000 (14:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:32:42 +0000 (16:32 +0200)
commit612fbf658803dd19d49bcc66e7bbfdbe9b6981ff
tree1e5b2f964d80246963765a89bfa358d979851408
parentf4b1e2cc9fd4c87adca18cc5efa0470c8d976c51
selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID)

commit ecaaa55c9fa5e8058445a8b891070b12208cdb6d upstream.

unshare(CLONE_NEWPID) can return EINVAL if the kernel does not have the
CONFIG_PID_NS option enabled.

Add a check on these calls to skip the test if we receive EINVAL.

Signed-off-by: Terry Tritton <terry.tritton@linaro.org>
Link: https://lore.kernel.org/r/20240124141357.1243457-2-terry.tritton@linaro.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/seccomp/seccomp_bpf.c