summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/seccomp
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2020-07-10 20:29:41 +0300
committerKees Cook <keescook@chromium.org>2020-07-11 02:01:46 +0300
commite4d05028a07f505a08802a6d1b11674c149df2b3 (patch)
treeb21edd64131428ca31c51c81eacb024a9a2c90bc /tools/testing/selftests/seccomp
parentd7d2e5bb9f361dc05c7dedd38d4d9269ad8c05e2 (diff)
downloadlinux-e4d05028a07f505a08802a6d1b11674c149df2b3.tar.xz
selftests/seccomp: Set NNP for TSYNC ESRCH flag test
The TSYNC ESRCH flag test will fail for regular users because NNP was not set yet. Add NNP setting. Fixes: 51891498f2da ("seccomp: allow TSYNC and USER_NOTIF together") Cc: stable@vger.kernel.org Reviewed-by: Tycho Andersen <tycho@tycho.ws> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'tools/testing/selftests/seccomp')
-rw-r--r--tools/testing/selftests/seccomp/seccomp_bpf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 80223113f3e3..c8f93edc52cc 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -3262,6 +3262,11 @@ TEST(user_notification_with_tsync)
int ret;
unsigned int flags;
+ ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
+ ASSERT_EQ(0, ret) {
+ TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!");
+ }
+
/* these were exclusive */
flags = SECCOMP_FILTER_FLAG_NEW_LISTENER |
SECCOMP_FILTER_FLAG_TSYNC;