[v7,19/23] aarch64: Ignore GCS property of ld.so

Message ID 20250103154141.47731-20-yury.khrustalev@arm.com (mailing list archive)
State Superseded
Headers
Series aarch64: Add support for Guarded Control Stack extension |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Yury Khrustalev Jan. 3, 2025, 3:41 p.m. UTC
  From: Szabolcs Nagy <szabolcs.nagy@arm.com>

check_gcs is called for each dependency of a DSO, but the GNU property
of the ld.so is not processed so ldso->l_mach.gcs may not be correct.
Just assume ld.so is GCS compatible independently of the ELF marking.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
---
 sysdeps/aarch64/dl-gcs.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/sysdeps/aarch64/dl-gcs.c b/sysdeps/aarch64/dl-gcs.c
index dc62908d13..c4751ec3e8 100644
--- a/sysdeps/aarch64/dl-gcs.c
+++ b/sysdeps/aarch64/dl-gcs.c
@@ -40,6 +40,11 @@  unsupported (void)
 static void
 check_gcs (struct link_map *l, const char *program)
 {
+#ifdef SHARED
+  /* Ignore GCS marking on ld.so: its properties are not processed.  */
+  if (is_rtld_link_map (l->l_real))
+    return;
+#endif
   bool for_dlopen = program == NULL;
   if (!l->l_mach.gcs)
     {