]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix tst-aarch64-pkey to handle ENOSPC as not supported
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 15 Feb 2025 10:08:33 +0000 (11:08 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 15 Feb 2025 10:08:43 +0000 (11:08 +0100)
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>
sysdeps/unix/sysv/linux/aarch64/tst-aarch64-pkey.c

index 3ff33ef72a18fdf1f617123ea9cd2f95a51ddc72..c884efc3b4f205a0227372e49cbb9dbfb57eefd9 100644 (file)
@@ -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");
     }