linux-kselftest-4.6-rc3
This update for Kselftest contains seccomp fixes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJXArY0AAoJEAsCRMQNDUMc194P/2X5oQlSzj9MsdASX2ccuTWI HbV50a4BA7BSxVoGuyj25Q84LLRAFosURsk73FNUGsTvRuJykJs7SKjTThp+JXlk O7zttWXTftRhBBxz7MHFK9Jdh/rmwd0Q7kyvH9ciIXdW4TWlJGaomg7VkJCzMHSR sg1U5UAE5St57aYxNEsQ7gfOVklgC70KHl3Gj9PteZ9oiRlhQV8ejf7EVLEew+0u oplKFQxmSZgspY+gab1qtMIMVwNJhHlW7L2q3XiwLBqhjfJo7JvyMC79l41jZ9k7 7ddf3+GtvmKubLpvGI+k2HGZuAre31IS8gSmwS1ipUjkC4sXWsTerdVxS/N2eHjw DB+RTvAOTUa/Q6JjgiS6pSLl9/XYLMjoEs8y4U+79OBqiDZp/raQbAMxXxkPS70U Rzu8x8ryBHci/S5wtPapxxn3Jjmqjya8EczRmZO7fjFmvXO4O9V7hH3UD4djKoDa NF+egjPGYgdoNmnprbipe6awWFdzYKd+culGCHHZ17XS9INGLPpDKw1ktCE9Ucny hohCEeLWQ13io+qSy4ekfZmDRweRqeFNm5L0s7SgHjRAhNEPY6BZuUWLros1QKdJ 7Yv/HnHb6ySWqR12KQ9wYQFpBTzHotSQbX9oFRCLEXx+xLn3VTuOVtgG1sNu72BE q8x+SpBNNPpsrZgNk7S/ =9CyV -----END PGP SIGNATURE----- Merge tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest fixes from Shuah Khan: "This update for Kselftest contains seccomp fixes" * tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftest/seccomp: Fix the seccomp(2) signature selftest/seccomp: Fix the flag name SECCOMP_FILTER_FLAG_TSYNC
This commit is contained in:
commit
1e1e5ce78f
@ -1497,15 +1497,15 @@ TEST_F(TRACE_syscall, syscall_dropped)
|
||||
#define SECCOMP_SET_MODE_FILTER 1
|
||||
#endif
|
||||
|
||||
#ifndef SECCOMP_FLAG_FILTER_TSYNC
|
||||
#define SECCOMP_FLAG_FILTER_TSYNC 1
|
||||
#ifndef SECCOMP_FILTER_FLAG_TSYNC
|
||||
#define SECCOMP_FILTER_FLAG_TSYNC 1
|
||||
#endif
|
||||
|
||||
#ifndef seccomp
|
||||
int seccomp(unsigned int op, unsigned int flags, struct sock_fprog *filter)
|
||||
int seccomp(unsigned int op, unsigned int flags, void *args)
|
||||
{
|
||||
errno = 0;
|
||||
return syscall(__NR_seccomp, op, flags, filter);
|
||||
return syscall(__NR_seccomp, op, flags, args);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1613,7 +1613,7 @@ TEST(TSYNC_first)
|
||||
TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!");
|
||||
}
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&prog);
|
||||
ASSERT_NE(ENOSYS, errno) {
|
||||
TH_LOG("Kernel does not support seccomp syscall!");
|
||||
@ -1831,7 +1831,7 @@ TEST_F(TSYNC, two_siblings_with_ancestor)
|
||||
self->sibling_count++;
|
||||
}
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&self->apply_prog);
|
||||
ASSERT_EQ(0, ret) {
|
||||
TH_LOG("Could install filter on all threads!");
|
||||
@ -1892,7 +1892,7 @@ TEST_F(TSYNC, two_siblings_with_no_filter)
|
||||
TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!");
|
||||
}
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&self->apply_prog);
|
||||
ASSERT_NE(ENOSYS, errno) {
|
||||
TH_LOG("Kernel does not support seccomp syscall!");
|
||||
@ -1940,7 +1940,7 @@ TEST_F(TSYNC, two_siblings_with_one_divergence)
|
||||
self->sibling_count++;
|
||||
}
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&self->apply_prog);
|
||||
ASSERT_EQ(self->sibling[0].system_tid, ret) {
|
||||
TH_LOG("Did not fail on diverged sibling.");
|
||||
@ -1992,7 +1992,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
|
||||
TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
|
||||
}
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&self->apply_prog);
|
||||
ASSERT_EQ(ret, self->sibling[0].system_tid) {
|
||||
TH_LOG("Did not fail on diverged sibling.");
|
||||
@ -2021,7 +2021,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
|
||||
/* Switch to the remaining sibling */
|
||||
sib = !sib;
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&self->apply_prog);
|
||||
ASSERT_EQ(0, ret) {
|
||||
TH_LOG("Expected the remaining sibling to sync");
|
||||
@ -2044,7 +2044,7 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
|
||||
while (!kill(self->sibling[sib].system_tid, 0))
|
||||
sleep(0.1);
|
||||
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
|
||||
ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
|
||||
&self->apply_prog);
|
||||
ASSERT_EQ(0, ret); /* just us chickens */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user