The attached patch fixes the prctl() testcase for alpha
and sparc64.
The prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, ...)
syscall may return EFAULT (on most arches) or EINVAL on
alpha and sparc64.
diff -up ./tests/test_prctl.c.org ./tests/test_prctl.c
--- ./tests/test_prctl.c.org 2024-11-05 21:02:01.910783841 +0000
+++ ./tests/test_prctl.c 2024-11-05 21:03:03.318802271 +0000
@@ -61,7 +61,11 @@ static void test_prctl_PR_SET_SECCOMP_fa
rc = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
assert_int_equal(rc, -1);
- assert_int_equal(errno, EFAULT);
+ /* alpha and sparc64 return EINVAL, which is OK for us. */
+ if (errno == EINVAL)
+ assert_int_equal(errno, EINVAL);
+ else
+ assert_int_equal(errno, EFAULT);
}
/* Once PR_SET_NO_NEW_PRIVS is set to 1, it cannot be reset to 0. */