kselftest/arm64: Add a GCS test program built with the system libc

There are things like threads which nolibc struggles with which we want
to add coverage for, and the ABI allows us to test most of these even if
libc itself does not understand GCS so add a test application built
using the system libc.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Tested-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241001-arm64-gcs-v13-35-222b78d87eee@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
Mark Brown
2024-10-04 12:04:44 +01:00
committed by Catalin Marinas
parent 3d37d4307e
commit a505a52b4e
4 changed files with 742 additions and 1 deletions
@@ -1 +1,2 @@
basic-gcs basic-gcs
libc-gcs
+3 -1
View File
@@ -6,7 +6,9 @@
# nolibc. # nolibc.
# #
TEST_GEN_PROGS := basic-gcs TEST_GEN_PROGS := basic-gcs libc-gcs
LDLIBS+=-lpthread
include ../../lib.mk include ../../lib.mk
@@ -16,6 +16,16 @@
#define __NR_prctl 167 #define __NR_prctl 167
#endif #endif
#ifndef NT_ARM_GCS
#define NT_ARM_GCS 0x410
struct user_gcs {
__u64 features_enabled;
__u64 features_locked;
__u64 gcspr_el0;
};
#endif
/* Shadow Stack/Guarded Control Stack interface */ /* Shadow Stack/Guarded Control Stack interface */
#define PR_GET_SHADOW_STACK_STATUS 74 #define PR_GET_SHADOW_STACK_STATUS 74
#define PR_SET_SHADOW_STACK_STATUS 75 #define PR_SET_SHADOW_STACK_STATUS 75
File diff suppressed because it is too large Load Diff