Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5
+5
tools/testing/selftests/seccomp/seccomp_bpf.c
··· 3262 3262 int ret; 3263 3263 unsigned int flags; 3264 3264 3265 + ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); 3266 + ASSERT_EQ(0, ret) { 3267 + TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); 3268 + } 3269 + 3265 3270 /* these were exclusive */ 3266 3271 flags = SECCOMP_FILTER_FLAG_NEW_LISTENER | 3267 3272 SECCOMP_FILTER_FLAG_TSYNC;