Comment 4 for bug 1933090

Revision history for this message
Roxana Nicolescu (roxanan) wrote :

I run the test locally on a vm running linux-oracle-5.15-1029.
It seems `syscall(__NR__sysctl, NULL)` returns ENOSYS(38) -- Function not implemented.
Checking `/proc/kallsyms` it seems sysctl is not implemented indeed.

If I take a closer look at jammy-ubuntu tag in systemd source (test that is not failing currently)
I can see that it asserts for either EFAULT or ENOSYS:

assert_se(IN_SET(errno, EFAULT, ENOSYS));

This patch will solve the issue:

diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
index 67900d85e..7ebcca4d3 100644
--- a/src/test/test-seccomp.c
+++ b/src/test/test-seccomp.c
@@ -307,7 +307,7 @@ static void test_protect_sysctl(void) {
         if (pid == 0) {
 #if defined __NR__sysctl && __NR__sysctl >= 0
                 assert_se(syscall(__NR__sysctl, NULL) < 0);
- assert_se(errno == EFAULT);
+ assert_se(IN_SET(errno, EFAULT, ENOSYS));
 #endif

                 assert_se(seccomp_protect_sysctl() >= 0);