Skip to content

Commit a505a52

Browse files
brooniectmarinas
authored andcommitted
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 <[email protected]> Tested-by: Thiago Jung Bauermann <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 3d37d43 commit a505a52

File tree

4 files changed

+742
-1
lines changed

4 files changed

+742
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
basic-gcs
2+
libc-gcs

tools/testing/selftests/arm64/gcs/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# nolibc.
77
#
88

9-
TEST_GEN_PROGS := basic-gcs
9+
TEST_GEN_PROGS := basic-gcs libc-gcs
10+
11+
LDLIBS+=-lpthread
1012

1113
include ../../lib.mk
1214

tools/testing/selftests/arm64/gcs/gcs-util.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
#define __NR_prctl 167
1717
#endif
1818

19+
#ifndef NT_ARM_GCS
20+
#define NT_ARM_GCS 0x410
21+
22+
struct user_gcs {
23+
__u64 features_enabled;
24+
__u64 features_locked;
25+
__u64 gcspr_el0;
26+
};
27+
#endif
28+
1929
/* Shadow Stack/Guarded Control Stack interface */
2030
#define PR_GET_SHADOW_STACK_STATUS 74
2131
#define PR_SET_SHADOW_STACK_STATUS 75

0 commit comments

Comments
 (0)