OSDN Git Service

selftests: set NO_NEW_PRIVS bit in seccomp user tests
authorTycho Andersen <tycho@tycho.ws>
Sat, 19 Jan 2019 00:12:16 +0000 (17:12 -0700)
committerShuah Khan <shuah@kernel.org>
Wed, 13 Feb 2019 15:48:12 +0000 (08:48 -0700)
commitc7140706cb8affe0155c62b13c59940597825bac
tree9bf78cc13a5cf5262371e57fde3d96adbcb098d0
parent3aa415dd2128e478ea3225b59308766de0e94d6b
selftests: set NO_NEW_PRIVS bit in seccomp user tests

seccomp() doesn't allow users who aren't root in their userns to attach
filters unless they have the nnp bit set, so let's set it so that these
tests can pass when run as an unprivileged user.

This idea stolen from the other seccomp tests, which use this trick :)

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