diff options
| author | Aurelien Jarno <aurelien@aurel32.net> | 2025-02-15 11:08:33 +0100 |
|---|---|---|
| committer | Aurelien Jarno <aurelien@aurel32.net> | 2025-02-15 11:12:18 +0100 |
| commit | 1e0e33e1b19a7634b364ac7b97c3c9612d5b776f (patch) | |
| tree | 667f6118ba54ee86493e404cb41e80c1ae29f027 | |
| parent | 69fda28279b497bd405fdd442a6d8e4d3d5f681b (diff) | |
| download | glibc-1e0e33e1b19a7634b364ac7b97c3c9612d5b776f.tar.xz glibc-1e0e33e1b19a7634b364ac7b97c3c9612d5b776f.zip | |
Fix tst-aarch64-pkey to handle ENOSPC as not supported
The syscall pkey_alloc can return ENOSPC to indicate either that all
keys are in use or that the system runs in a mode in which memory
protection keys are disabled. In such case the test should not fail and
just return unsupported.
This matches the behaviour of the generic tst-pkey.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 60f2d6be657aa8c663ee14bd266d343ae0f35afb)
| -rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c b/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c index 3ff33ef72a..c884efc3b4 100644 --- a/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c +++ b/sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c @@ -55,6 +55,10 @@ do_test (void) if (errno == ENOSYS || errno == EINVAL) FAIL_UNSUPPORTED ("kernel or CPU does not support memory protection keys"); + if (errno == ENOSPC) + FAIL_UNSUPPORTED + ("no keys available or kernel does not support memory" + " protection keys"); FAIL_EXIT1 ("pkey_alloc: %m"); } |
