Skip to content

Commit

Permalink
selftests/seccomp: Set NNP for TSYNC ESRCH flag test
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kees committed Jul 10, 2020
1 parent d7d2e5b commit e4d0502
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/testing/selftests/seccomp/seccomp_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e4d0502

Please sign in to comment.