1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-07-16 03:47:19 +00:00

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 <ross.burton@arm.com>
This commit is contained in:
James McGregor
2024-08-01 09:49:38 +01:00
committed by Ross Burton
parent d2c43f9aba
commit fe553984a9
@@ -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 <dl-prop.h>
+
# 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 ();