OSDN Git Service

selftests: unshare userns in seccomp pidns testcases
authorTycho Andersen <tycho@tycho.ws>
Sat, 19 Jan 2019 00:12:17 +0000 (17:12 -0700)
committerShuah Khan <shuah@kernel.org>
Wed, 13 Feb 2019 15:48:29 +0000 (08:48 -0700)
commit30d53a5860cf6743db011719d414456b10773d6a
treedcf774369e76e6297a677cc51f3882efc174be59
parentc7140706cb8affe0155c62b13c59940597825bac
selftests: unshare userns in seccomp pidns testcases

The pid ns cannot be unshare()d as an unprivileged user without owning the
userns as well. Let's unshare the userns so that we can subsequently
unshare the pidns.

This also means that we don't need to set the no new privs bit as in the
other test cases, since we're unsharing the userns.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuah@kernel.org>
tools/testing/selftests/seccomp/seccomp_bpf.c