From fe553984a90174f2a348526417ac1e9b2e4e94b6 Mon Sep 17 00:00:00 2001 From: James McGregor Date: Thu, 1 Aug 2024 09:49:38 +0100 Subject: [PATCH] arm-gcs/glibc: fix prctl() argument definitions The values prctl() expects for shadow stack operations have changed. Update the glibc patch to match the values in the kernel. Signed-off-by: Ross Burton --- meta-arm-gcs/recipes-core/glibc/files/gcs.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meta-arm-gcs/recipes-core/glibc/files/gcs.patch b/meta-arm-gcs/recipes-core/glibc/files/gcs.patch index 534fbb45..6612860b 100644 --- a/meta-arm-gcs/recipes-core/glibc/files/gcs.patch +++ b/meta-arm-gcs/recipes-core/glibc/files/gcs.patch @@ -1053,9 +1053,9 @@ index 0000000000..ccf0f8af5c +#ifndef SHARED + +# ifndef PR_SET_SHADOW_STACK_STATUS -+# define PR_GET_SHADOW_STACK_STATUS 71 -+# define PR_SET_SHADOW_STACK_STATUS 72 -+# define PR_LOCK_SHADOW_STACK_STATUS 73 ++# define PR_GET_SHADOW_STACK_STATUS 74 ++# define PR_SET_SHADOW_STACK_STATUS 75 ++# define PR_LOCK_SHADOW_STACK_STATUS 76 +# define PR_SHADOW_STACK_ENABLE (1UL << 0) +# define PR_SHADOW_STACK_WRITE (1UL << 1) +# define PR_SHADOW_STACK_PUSH (1UL << 2) @@ -1145,7 +1145,7 @@ index d645484e79..271bd5bf00 100644 + + /* Enable GCS before user code runs. Note that IFUNC resolvers and + LD_AUDIT hooks may run before, but should not create threads. */ -+#define PR_SET_SHADOW_STACK_STATUS 72 ++#define PR_SET_SHADOW_STACK_STATUS 75 + mov x0, PR_SET_SHADOW_STACK_STATUS + mov x2, 0 + mov x3, 0 @@ -1582,8 +1582,8 @@ index ccf0f8af5c..6e2e9762ee 100644 +# include + # ifndef PR_SET_SHADOW_STACK_STATUS - # define PR_GET_SHADOW_STACK_STATUS 71 - # define PR_SET_SHADOW_STACK_STATUS 72 + # define PR_GET_SHADOW_STACK_STATUS 74 + # define PR_SET_SHADOW_STACK_STATUS 75 @@ -36,6 +38,16 @@ aarch64_libc_setup_tls (void) { __libc_setup_tls ();