diff options
| -rw-r--r-- | tools/testing/selftests/seccomp/seccomp_bpf.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index b9453b838162..150829dd7998 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c | |||
| @@ -1497,15 +1497,15 @@ TEST_F(TRACE_syscall, syscall_dropped) | |||
| 1497 | #define SECCOMP_SET_MODE_FILTER 1 | 1497 | #define SECCOMP_SET_MODE_FILTER 1 |
| 1498 | #endif | 1498 | #endif |
| 1499 | 1499 | ||
| 1500 | #ifndef SECCOMP_FLAG_FILTER_TSYNC | 1500 | #ifndef SECCOMP_FILTER_FLAG_TSYNC |
| 1501 | #define SECCOMP_FLAG_FILTER_TSYNC 1 | 1501 | #define SECCOMP_FILTER_FLAG_TSYNC 1 |
| 1502 | #endif | 1502 | #endif |
| 1503 | 1503 | ||
| 1504 | #ifndef seccomp | 1504 | #ifndef seccomp |
| 1505 | int seccomp(unsigned int op, unsigned int flags, struct sock_fprog *filter) | 1505 | int seccomp(unsigned int op, unsigned int flags, void *args) |
| 1506 | { | 1506 | { |
| 1507 | errno = 0; | 1507 | errno = 0; |
| 1508 | return syscall(__NR_seccomp, op, flags, filter); | 1508 | return syscall(__NR_seccomp, op, flags, args); |
| 1509 | } | 1509 | } |
| 1510 | #endif | 1510 | #endif |
| 1511 | 1511 | ||
| @@ -1613,7 +1613,7 @@ TEST(TSYNC_first) | |||
| 1613 | TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); | 1613 | TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); |
| 1614 | } | 1614 | } |
| 1615 | 1615 | ||
| 1616 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1616 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 1617 | &prog); | 1617 | &prog); |
| 1618 | ASSERT_NE(ENOSYS, errno) { | 1618 | ASSERT_NE(ENOSYS, errno) { |
| 1619 | TH_LOG("Kernel does not support seccomp syscall!"); | 1619 | TH_LOG("Kernel does not support seccomp syscall!"); |
| @@ -1831,7 +1831,7 @@ TEST_F(TSYNC, two_siblings_with_ancestor) | |||
| 1831 | self->sibling_count++; | 1831 | self->sibling_count++; |
| 1832 | } | 1832 | } |
| 1833 | 1833 | ||
| 1834 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1834 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 1835 | &self->apply_prog); | 1835 | &self->apply_prog); |
| 1836 | ASSERT_EQ(0, ret) { | 1836 | ASSERT_EQ(0, ret) { |
| 1837 | TH_LOG("Could install filter on all threads!"); | 1837 | TH_LOG("Could install filter on all threads!"); |
| @@ -1892,7 +1892,7 @@ TEST_F(TSYNC, two_siblings_with_no_filter) | |||
| 1892 | TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); | 1892 | TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); |
| 1893 | } | 1893 | } |
| 1894 | 1894 | ||
| 1895 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1895 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 1896 | &self->apply_prog); | 1896 | &self->apply_prog); |
| 1897 | ASSERT_NE(ENOSYS, errno) { | 1897 | ASSERT_NE(ENOSYS, errno) { |
| 1898 | TH_LOG("Kernel does not support seccomp syscall!"); | 1898 | TH_LOG("Kernel does not support seccomp syscall!"); |
| @@ -1940,7 +1940,7 @@ TEST_F(TSYNC, two_siblings_with_one_divergence) | |||
| 1940 | self->sibling_count++; | 1940 | self->sibling_count++; |
| 1941 | } | 1941 | } |
| 1942 | 1942 | ||
| 1943 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1943 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 1944 | &self->apply_prog); | 1944 | &self->apply_prog); |
| 1945 | ASSERT_EQ(self->sibling[0].system_tid, ret) { | 1945 | ASSERT_EQ(self->sibling[0].system_tid, ret) { |
| 1946 | TH_LOG("Did not fail on diverged sibling."); | 1946 | TH_LOG("Did not fail on diverged sibling."); |
| @@ -1992,7 +1992,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter) | |||
| 1992 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); | 1992 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); |
| 1993 | } | 1993 | } |
| 1994 | 1994 | ||
| 1995 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1995 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 1996 | &self->apply_prog); | 1996 | &self->apply_prog); |
| 1997 | ASSERT_EQ(ret, self->sibling[0].system_tid) { | 1997 | ASSERT_EQ(ret, self->sibling[0].system_tid) { |
| 1998 | TH_LOG("Did not fail on diverged sibling."); | 1998 | TH_LOG("Did not fail on diverged sibling."); |
| @@ -2021,7 +2021,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter) | |||
| 2021 | /* Switch to the remaining sibling */ | 2021 | /* Switch to the remaining sibling */ |
| 2022 | sib = !sib; | 2022 | sib = !sib; |
| 2023 | 2023 | ||
| 2024 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 2024 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 2025 | &self->apply_prog); | 2025 | &self->apply_prog); |
| 2026 | ASSERT_EQ(0, ret) { | 2026 | ASSERT_EQ(0, ret) { |
| 2027 | TH_LOG("Expected the remaining sibling to sync"); | 2027 | TH_LOG("Expected the remaining sibling to sync"); |
| @@ -2044,7 +2044,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter) | |||
| 2044 | while (!kill(self->sibling[sib].system_tid, 0)) | 2044 | while (!kill(self->sibling[sib].system_tid, 0)) |
| 2045 | sleep(0.1); | 2045 | sleep(0.1); |
| 2046 | 2046 | ||
| 2047 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 2047 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, |
| 2048 | &self->apply_prog); | 2048 | &self->apply_prog); |
| 2049 | ASSERT_EQ(0, ret); /* just us chickens */ | 2049 | ASSERT_EQ(0, ret); /* just us chickens */ |
| 2050 | } | 2050 | } |
