diff options
author | Mickaël Salaün <mic@digikod.net> | 2016-03-29 14:46:07 -0400 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2016-03-29 15:01:28 -0400 |
commit | 6c045d07bb305c527140bdec4cf8ab50f7c980d8 (patch) | |
tree | 47f87a5283e6dde1eb2b148c1e54a64bc1b148fa | |
parent | f55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff) |
selftest/seccomp: Fix the flag name SECCOMP_FILTER_FLAG_TSYNC
Rename SECCOMP_FLAG_FILTER_TSYNC to SECCOMP_FILTER_FLAG_TSYNC to match
the UAPI.
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Will Drewry <wad@chromium.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
-rw-r--r-- | tools/testing/selftests/seccomp/seccomp_bpf.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index b9453b838162..9c1460f277c2 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c | |||
@@ -1497,8 +1497,8 @@ 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 |
@@ -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 | } |