Skip to content

Commit e4d0502

Browse files
committed
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: 5189149 ("seccomp: allow TSYNC and USER_NOTIF together") Cc: [email protected] Reviewed-by: Tycho Andersen <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent d7d2e5b commit e4d0502

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,6 +3262,11 @@ TEST(user_notification_with_tsync)
32623262
int ret;
32633263
unsigned int flags;
32643264

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+
32653270
/* these were exclusive */
32663271
flags = SECCOMP_FILTER_FLAG_NEW_LISTENER |
32673272
SECCOMP_FILTER_FLAG_TSYNC;

0 commit comments

Comments
 (0)